Announcement

Collapse
No announcement yet.

Drag & Drop

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Drag & Drop

    Greetings,

    i have just discovered this awesome engine, and would like some help.
    I've got a sprite component which is in a BaseDecorator, and would like to implement a drag and drop behavior.
    Could anyone give instructions on how to do this or point me to an example?

    Thank you!

  • #2
    Hi Kgabr,

    Welcome to WaveEngine community!. I think that a good point to start is our documentation wiki. And respect to drag a drop behavior you can use TouchGestures component or can implement your own component.

    How to drag and drop with TouchGesture (Manipulate 2D entities with touch)
    Code:
    sprite.AddComponent(new RectangleCollider2D()).
             AddComponent(new TouchGestures()
             {
                   EnabledGestures = SupportedGesture.Translation
             });
    If you prefer to implement your own component you can read Detect Keyboard, Mouse and Touch inputs.

    I hope that you find it useful

    Regards!
    Jorge Canton

    Comment


    • #3
      Thank you very much!
      Once the game is in an somewhat presentable form, i will show it to you guys. In the meantime there will probably be more questions.

      Comment


      • #4
        Hi!
        Here comes the next question:
        On the main window, i am adding with the EntityManager a popup which is derived from BaseDecorator and covers most of the screen. It is set as invisible at first, and is set as visible in the event of a certain button click. However, when it appears, all the buttons underneath are still clickable. Am i doing this wrong? How can i stop the clicks from going through the popup? Any help would be appreciated. Thank you!

        Comment


        • #5
          Hi kgabr,

          If an entity is marked as IsVisible = false then this entity doen't have touches assigned. Anyway if you can send us a sample app we could understand your issue and help you .

          Thanks for your support

          Regards!
          Jorge Cantón

          Comment

          Working...
          X