dvdkwak Posted December 17, 2018 Share Posted December 17, 2018 I have made an external file with a class which extends on phaser's Sprite class. Now I gave it a texture (texture works on normal phaser sprites) but this texture won't show on screen within my project. Anyone out there who can help me out? The Town.scene.js file is the scene which I use. The NPC file is the own made Phaser Sprite Object The Sprite class is the file I extends the NPC object on. Town.scene.js NPC.js Sprite.class.js Quote Link to comment Share on other sites More sharing options...
dvdkwak Posted December 19, 2018 Author Share Posted December 19, 2018 After some research I came to a post with the following codepen: https://codepen.io/samme/pen/jpaBOR (Thank you samme) I learned to use the function add.existing to add my objects made from the Phaser.Class method to my scene. Doing it this way somehow does make use of the given Texture. Still my Question remains, why didn't my other option work? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.