Jump to content

How can I start dragging one text by clicking another one?


Aguacero
 Share

Recommended Posts

(phaser 2.11.1)

I have some text objects at my stage, and by clicking one of them (actually on input down) I need to 
 1) create new text object
 2) start dragging that object

I've created some example of what I have now: http://taketen.ru/question

Source code could be found at https://github.com/dsamoylov/phaser-question

Basically, there are some parts of text that are clickable. Now the user scenario looks like
1) Click/tap the text, so that new text object would be created
2) Drag newly created text to one of the zones (green/red)

I want to make it easier for user so that it could just perform drag'n'drop action, but initially tapped text object should stay at its place, and draggable object should be created on down event.

Well... the first problem is - I can't event get onInputDown to work ?

highlightedText.events.onInputDown.add(() => {
    console.log('Input Down Detected')
})

This gets me nothing (

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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