You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i've been using FlxMouseEventManager in psych engine a lot of time and it works always but when i try it in codename it just doesnt detect or go into the functions i want.
does anybody know why?
The text was updated successfully, but these errors were encountered:
overridefunctionupdate(elapsed:Float){
super.update(elapsed);
if(FlxG.mouse.overlaps(spr, /*If the sprite in question is using a camera, put it here.*/)){
if(FlxG.mouse.justPressed){
// justPressedCode
}
// selectedCode
} else {
// nonSelectedCode
}
}
ty but the reason i really need the FlxMouserEventManager to work is because so when i hover(overlaps) a object(spr) it plays the scroll sound.
when i try it with the normal FlxG.mouse.overlaps(spr) the sound is looped until i un-hover.
varhasSoundPlayed:Bool=false;
overridefunctionupdate(elapsed:Float) :Void {
super.update(elapsed);
if(FlxG.mouse.overlaps(/* Sprite u wanna click */, /*If the sprite in question is using a camera, put it here.*/)){ // Selectedif(!hasSoundPlayed){
// Plays the sound onceFlxG.sound.play(/*soundPath*/);
hasSoundPlayed=true;
}
if(FlxG.mouse.justPressed){
// justPressedCode
}
// selectedCode
} else { // Not SelectedhasSoundPlayed=false;
// nonSelectedCode
}
}
I'm half asleep, so if it doesn't work, put the hasSoundPlayed variable inside the update function.
[X] Windows
[ ] Linux
[ ] Mac
i've been using FlxMouseEventManager in psych engine a lot of time and it works always but when i try it in codename it just doesnt detect or go into the functions i want.
does anybody know why?
The text was updated successfully, but these errors were encountered: