Author Topic: Basic FlxButton enhancement  (Read 2744 times)


  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Basic FlxButton enhancement
« on: Wed, Aug 17, 2011 »

I found a useful change to the FlxButton for my own purposes is to change it from

   public function FlxButton(X:int,Y:int,Callback:Function)


   public function FlxButton(X:int,Y:int,Callback:Function, W:int = 100, H:int = 20)

and change the lines

   width = 100;
   height = 20;


   width = W;
   height = H;
This makes it very easy to change the size of your FlxButton while keeping it perfectly backwards compatible to any previously made buttons.  I thought this might be a useful and easy change to include in a future version of Flixel or might be useful for someone frustrated with button size.