Jump to content

How can you extend Phaser.Graphics?


notalentgeek
 Share

Recommended Posts

So I made this object of which inherits Phaser.Graphics.

ybwhSQ0.png

 

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.

FUPLkCp.png

And here is the code of which I called UpdatePreRender() of ObjectPlayer in my state.

P4aFjPE.png

 

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.

awyYaDM.png

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

 Share

  • Recently Browsing   0 members

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