You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm in the middle of trying to figure out why I can't extends a FlxUIButton and construct it with a specific 9 slice button graphic and change the size immediately afterwards.
I've traced my self to a spot in FlxSprite loadGraphic which has the following lines:
if (!Std.is(Graphic, TextureRegion))
{
region = new Region(0, 0, Width, Height);
region.width = cachedGraphics.bitmap.width;
region.height = cachedGraphics.bitmap.height;
}
so In Region.hx it constructs as such:
new(startX:Int = 0, startY:Int = 0, tileWidth:Int = 0, tileHeight:Int = 0,
So when I do:
(in an extended FlxUIButton constructor)
the FlxSprite.loadGraphic's Width == 200, Height == 100
and cachedGraphics.bitmap.width == 18 and cachedGraphics.bitmap.height == 18
but the Region.width is getting set to 18 and Region.tileWidth is getting set to 200
Should it be: ?
if (!Std.is(Graphic, TextureRegion))
{
region = new Region(0, 0, cachedGraphics.bitmap.width, cachedGraphics.bitmap.height);
region.width = Width;
region.height = Height;
}
(i tried the change but errors out, and I know this includes elements from flixel-ui so the issue could be before flxSprite but maybe one of you can spot an issue if there is one)
The text was updated successfully, but these errors were encountered:
So I'm in the middle of trying to figure out why I can't extends a FlxUIButton and construct it with a specific 9 slice button graphic and change the size immediately afterwards.
I've traced my self to a spot in FlxSprite loadGraphic which has the following lines:
if (!Std.is(Graphic, TextureRegion))
{
region = new Region(0, 0, Width, Height);
region.width = cachedGraphics.bitmap.width;
region.height = cachedGraphics.bitmap.height;
}
so In Region.hx it constructs as such:
new(startX:Int = 0, startY:Int = 0, tileWidth:Int = 0, tileHeight:Int = 0,
So when I do:
(in an extended FlxUIButton constructor)
this.loadGraphicSlice9( ["assets/gfx/ui/buttons/button_blue.png"], 18, 18, ["6,6,11,11"] );
this.resize( 200, 100 );
the FlxSprite.loadGraphic's Width == 200, Height == 100
and cachedGraphics.bitmap.width == 18 and cachedGraphics.bitmap.height == 18
but the Region.width is getting set to 18 and Region.tileWidth is getting set to 200
Should it be: ?
if (!Std.is(Graphic, TextureRegion))
{
region = new Region(0, 0, cachedGraphics.bitmap.width, cachedGraphics.bitmap.height);
region.width = Width;
region.height = Height;
}
(i tried the change but errors out, and I know this includes elements from flixel-ui so the issue could be before flxSprite but maybe one of you can spot an issue if there is one)
The text was updated successfully, but these errors were encountered: