Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Possible to keep focus if a mouse_move moves off an object? — Gideros Forum

Possible to keep focus if a mouse_move moves off an object?

GhandoGhando Member
edited January 2012 in General questions
Hi guys,
I'm working on a game that's similar-ish to "Train Conductor". If you aren't familiar with the game the main goal is to click and drag out paths for the trains to follow to their destinations (see: ).

Having dabbled with Corona I know that they have a "display.getCurrentStage():setFocus" which allows the object to keep focus even when the touch has moved off the object. (see: http://developer.anscamobile.com/reference/index/stagesetfocus )

Does Gideros have something similar?

If it doesn't I'm guessing I have two approaches:
1. On MOUSE_DOWN set a variable somewhere to reference the touched object. On MOUSE_UP, if the touch was on a track I then give the mouse_up x,y to the object so it can move to that location.

2. um?

Any other ideas?
Tagged:

Comments

  • MikeHartMikeHart Guru
    edited January 2012
    Maybe stopping the event propagation in the event of your object. At least this way no more objects will be affected during a frame. But I think you need to use your workaround.
    event:stopPropagation()
  • atilimatilim Maintainer
    Also "Drag Me" example can help you. It demonstrates the combination of stopPropagation() and hitTestPoint()
  • Also "Drag Me" example can help you. It demonstrates the combination of stopPropagation() and hitTestPoint()
    Thanks MikeHart and Atlim.
    I'd based my code off of the "Drag Me" example but was calling stopPropagation in the wrong place. All now works as it should!
Sign In or Register to comment.