resizing virtualpad

68 views
Skip to first unread message

Ali Bahrami

unread,
Aug 12, 2015, 9:11:01 AM8/12/15
to HaxeFlixel
Hey everyone!
I'm working on a platform game for android using HaxeFlixel. I used FlxVirtualPad as mentioned in the tutorials. Because of the pixelart style, I have to do a good zoom on my game, so I set gameWidth and gameHeight in 200 pixels. The problem is the virtual pad seems too big, and scale is read only. How can I resize it ?
If you want, I can send you the code. Thanks!

SruloArt

unread,
Aug 12, 2015, 9:47:23 AM8/12/15
to HaxeFlixel
* Your question is really about scaling a FlxSpriteGroup (which the FlxVirtualPad extends),

* and it does have a public scale var that works (yourPad.scale.set(0.25,0.25); for example, I've just tested it).

* But since it (SpriteGroup) doesn't do relative positioning that means it won't work properly (your buttons will get very small but also very far apart).

* This is why stuff like the FlxVirtualPad should be a part of the flixel-ui really (which supports relative positioning),

* But sadly this isn't the case and there's no easy fix but to reposition your pad's buttons based on their scale.
Reply all
Reply to author
Forward
0 new messages