Jump to content

Clickable graphics line


Recommended Posts


Sorry guys, I've just start using phaser, i wonder if it is possible for to create a line which is clickable?

Here's the code

    function create(){
        graphics = this.add.graphics();
        graphics.lineStyle(20, 0x33FF00);
        graphics.lineTo(300, 200);

        graphics.inputEnabled = true;
        graphics.input.useHandCursor = true;


Image 2.png


When i use inputEnabled method,  it works on most of other things like sprite or image, but for graphics it wont respond. 

I've look into the offical example provide by phaser web

i saw them adding 

graphics.input.useHandCursor = true;

However for some reason it doesn't work like the example?


Thank You so much for the time

Link to comment
Share on other sites

  • 1 month later...

  • Recently Browsing   0 members

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