Search the Community
Showing results for tags 'phaser sprite stretchable'.
Hello everyone ! I'm new to Phaser and can't figure out how to create a sprite that contains a stretchable area as well as fixed parts. My goal is to have something similar to the following image : I want this sprite to be resizable at any time (myStretchableSprite.width = w). I tried the following way : * Create a main Sprite * Add a left child Sprite with a fixed width * Add a center child TileSprite with variable width * Add a right child Sprite with fixed width It works fine when initializing the parent sprite with a given width, but if I try to update the parent sprite's width later, some kind of scale is applied to all its child elements and the result is far from what I expected. Any ideas on how to achieve this ? Thanks a lot !