bitDecayGames / haxeflixel-template

Basic game template with FMOD and Bitlytics tie-ins ready to build from
3 stars 1 forks source link

Try a macro to add the pause/unpause functions to any given state #28

Closed MondayHopscotch closed 3 years ago

MondayHopscotch commented 3 years ago

Instead of having to add this to every state:

    override public function onFocusLost() {
        super.onFocusLost();
        this.handleFocusLost();
    }

    override public function onFocus() {
        super.onFocus();
        this.handleFocus();
    }

It would be cool if we were able to do something like this:

  public function new() {
    BDMacro.addFocusHandlers();
  }

Where this is some macro that automatically adds these premade focus handling functions to the class. Not sure if this is a good idea or if it's even worth the effort, but it's something to think about.

MondayHopscotch commented 3 years ago

Thinking on this more, it seems like this AT BEST just makes something we have to add to each state smaller. The underlying issue doesn't go away. Likely this could just be done through inheritance