flixel-ui
flixel-ui copied to clipboard
[BUG] FlxUIButton resets sprite to the default when resize and UpOverDown are used.
var uiButtonUp = new FlxUIButton(BUTTON_X, BUTTON_Y, null, onClickButton.bind(-1));
uiButtonUp.loadGraphicsUpOverDown(FlxUIAssets.IMG_BUTTON_ARROW_UP);
uiButtonUp.resize(24, 24);
Expected behavior: the UI button should display the provided graphic FlxUIAssets.IMG_BUTTON_ARROW_UP
at the specified size.
Actual behavior: the UI button resets its graphic to FlxUIAssets.SLICE9_BUTTON
before performing a loadGraphicSlice9
operation to create the button of the desired size.
Should it calling it for static graphics just tell it to set the width
and height
? Something like this:
if (_slice9_arrays == null)
{
width = W;
height = H;
}
else
loadGraphicSlice9(null, Std.int(W), Std.int(H), null, tile);
No, loadGraphicUpOverDown doesn't load a static graphic from what I understand. It loads a graphic which switches when you hover over, or click, the button.
Sorry, I meant that the graphic frames are static rather than pieced together like slice9. When calling resize()
on a non-slice9, do you picture it rescaling the graphic to the specified size?
If you can provide any graphic examples of the expected behavior it would be appreciated.
Sorry, I meant that the graphic frames are static rather than pieced together like slice9. When calling
resize()
on a non-slice9, do you picture it rescaling the graphic to the specified size?If you can provide any graphic examples of the expected behavior it would be appreciated.
I do picture rescaling each piece of the graphic to the specified size.
I can try to create an example later, but basically I'm trying to create an arrow button using the built-in Flixel graphic, but the button is too small as is and I would like to make it larger. Trying to use the scaling function replaces the graphic with a square button which is clearly not intentional.