Turn off Mouse / Keyboard when running SubState
hi, I am running a subState successfully, but need to turn off all sprite and keyboard inputs for the parent / calling state.
The substate only covers the bottom half of the screen and if you click on the sprites from other and it still fires it, but the update is clearly not running because the animations are frozen.
Here is how I call the substate and pass and variable in.
var tempState:StoryState = new StoryState(); tempState.isPersistant = true; tempState.trigger = trigger; // pass trigger number into substate. openSubState(tempState);
and here is how a close the substate.
Where is the code that handles the sprite clicks?
////Define Monster Idle var texFrogmanIdle = FlxAtlasFrames.fromSparrow("assets/monsters/frogmanIdle.png", "assets/monsters/frogmanIdle.xml"); _monsterIdle = new FlxSprite(-30, 30); _monsterIdle.frames = texFrogmanIdle; _monsterIdle.animation.addByPrefix("frogmanIdle", "img", 15, true); _monsterIdle.animation.play("frogmanIdle"); #if desktop FlxMouseEventManager.add(_monsterIdle, null, showPlayerAttackMonster, null, null ); #end #if mobile FlxMouseEventManager.add(_monsterIdle, null, null, showPlayerAttackMonster, null ); #end