Sign in to follow this  
Aguacero

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

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 (

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.