notalentgeek Posted August 28, 2015 Share Posted August 28, 2015 So I made this object of which inherits Phaser.Graphics. I put this object in another object which is ObjectPlayer and then update the whole ObjectPlayer in preRender() function in my state.Here is the code for the ObjectPlayer.And here is the code of which I called UpdatePreRender() of ObjectPlayer in my state. The problem is that the graphics that I made using ObjectRangeLine does not appear in the scene. Weirdly, it has all information like its xy position, rotation, and width.Hence, the ObjectRangeLine is actually there but just not appeared in the scene. If I moved the object and just create the whole object in my scene directly it is working but it is not shown if I do the OOP approach. What could be wrong here? Link to comment Share on other sites More sharing options...
tips4design Posted August 28, 2015 Share Posted August 28, 2015 Don't you have to add the graphics to the game (stage) ? http://phaser.io/examples/v2/sprites/extending-sprite-demo-2game.add.existing(this); notalentgeek 1 Link to comment Share on other sites More sharing options...
notalentgeek Posted August 28, 2015 Author Share Posted August 28, 2015 Don't you have to add the graphics to the game (stage) ? http://phaser.io/examples/v2/sprites/extending-sprite-demo-2game.add.existing(this);Damn... Thanks man. Link to comment Share on other sites More sharing options...
Recommended Posts