threeninenineone Posted October 13, 2017 Share Posted October 13, 2017 Hi guys I am creating interface elements using sprite images. Not sure if this is best practice, open to suggestion. For example; at the moment a have large image for an input field which is fine and it works. ------------------------------------ | | ------------------------------------ However now i need nearly the exact same sprite just half the width for a small input field. -------------------- | | -------------------- So the middle of the sprite is actually the same but the corners can't be stretched as I would like to maintain the same corner radius I don't really want to create a seperate sprite for each of the corners unless you think that is best. So what I really want is to be able to create a very small sprite. --- | | --- And stretch the center pixel horizontally. However as I have said this may be far away from what is the best way to achieve this, so let me know! Thanks! Link to comment Share on other sites More sharing options...
WiLD11 Posted October 14, 2017 Share Posted October 14, 2017 You should use the 9 slice method! Heres a plugin that does it for you: https://github.com/orange-games/phaser-nineslice threeninenineone 1 Link to comment Share on other sites More sharing options...
threeninenineone Posted October 14, 2017 Author Share Posted October 14, 2017 Yes, thank you! Link to comment Share on other sites More sharing options...
Recommended Posts