Jump to content

How can you extend Phaser.Graphics?


Recommended Posts

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


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...