Moving a control with
Hey guys, I need some help with the following task:
I want the icon to be dragable, but only by clicks inside the green square in it's top left corner. If I apply SetMouseEnabled(true) and SetMovable(true) to the base control, the whole control will react to mouse clicks, not only the green square. If I apply SetMouseEnabled(true) and SetMovable(true) to the green square, then only the green square reacts to mouse clicks, but the icon does not move with it despite being it's parent element. This is the XML code: Code:
<!-- Icon aura --> |
What about adding a parent to it that is taller, so that you have a bar across the top that can move it? Not exactly what you're going for, but it's a fallback option.
|
One option would be to set the anchor of the parent to be relative to the green square. For example,parent:SetAnchor(TOPLEFT, greenSquare, TOPLEFT, 0,0)
Another option (if that doesn't work) would be to use the OnMoveStart and OnMoveStop of the green square, and put something like: EVENT_MANAGER:RegisterForUpdate("moving", 10, moveParentToGreenSquare) |
Quote:
Thanks for your help, guys! :) |
All times are GMT -6. The time now is 01:20 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI