Hi,
I created a textureatlas with shoebox on Default settings.
I can get images for FlxSprite and show on screen.
But when I use FlxButton on the same way, FlxButton shows different image on screen.
My code is as follows, I working on mobile and LG G3 device.
texturepack = new SparrowData("assets/images/sprites.xml","assets/images/sprites.png");
chief = new FlxSprite();
chief.loadGraphicFromTexture(texturepack, true, "welcome_chief.png");
chief.centerOrigin();
FlxSpriteUtil.screenCenter(chief);
add(chief);
works as expected.
//Play Button
start = new FlxButton();
start.loadGraphicFromTexture(texturepack, true, "welcome_play.png");
start.x = chief.x+chief.width/2-start.width/2;
start.y = chief.y+chief.height-start.height;
start.onDown.callback = onDownClick.bind(start);
add(start);
works but do not show correct image. It gets different image from the textureatlas.
Any idea?
Thanks.