Closed hashg closed 7 months ago
Change 'key'
in line 28 ( button.setBaseTexture('key',...
) to 'atlas'
. There has no key named 'key'
in this test code.
Thanks for directing my focus to key.
https://codepen.io/Harish-Gowda/pen/QWoZaeV
I have updated my codepen to show actual issue, when I try to use ninepatch inside a container class and then use same PointerEvent functions. It throws these errors -
Texture "__DEFAULT" has no frame "button_green_s_b_slice9"
Texture "__DEFAULT" has no frame "button_coral_s_b_slice9"
I plan to build two more class extended from BaseButton where in it will include a image (ImageButton) and text (TextButton). Is my approach right?
this.texture
in line 30,34 is undefined
. Please check your logic/vairables first.
I want to change frame onPointerDown on ninepatch2 image which is pulled from atlas.
https://codepen.io/Harish-Gowda/pen/QWoZaeV
In this example (from -https://raw.githubusercontent.com/rexrainbow/phaser3-rex-notes/master/assets/images/ninepatch/atlas.json) On load (baseFrame) -
button_coral_s_b_slice9
On Pointer down (setBaseTexture) -button_green_s_b_slice9
It fails with following console log -
Texture "__MISSING" has no frame "button_green_s_b_slice9"