Hello,
I need component or container coordinates in a toolkit screen to animate with DoTween.
For example, I want to move entity A to position B.
I looked at resolvedStyle, GeometryChangedEvent but I can’t.
Can you help me ?
Hi! Is your animation a “fire and forget” thing? If so, you could just use the animation/transition system in UI toolkit to achieve what you want.
If you want to drive the position of a visual element through code to fit with something in world space for example, you could use the method provided in UIElements.RuntimePanelUtils.
Finally, you could check the position of a visual element using VisualElement.worldBound of ChangeCoordinatesTo if the coordinate to check for is between two visual elements.
Let us know how we could help you, but providing more context would definitely be beneficial to understand what you are trying to achieve.
Thank you for your quick reply.
I want to be able to change entity locations dynamically (via c#) in a ui builder screen using doTween’s generic functions.
I’ll be looking at UIElements.RuntimePanelUtils, specifically the ScreenToPanel function.
Thanks for your help.
What does a “fire and forget” thing mean? …lol
It is an animation that would start and that you don’t need to adjust or change as long as it is not finished. If you want to “float around the mouse position” and that the mouse move, you will need to adjust/modify the trajectory, so it is not fire-and-forget. On the opposite, USS transitions, deeply based on CSS transitions, are not really intended to be modified after they are lunched.
you can look here for really simple transition : https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions/Using_CSS_transitions
and here for more advanced: https://blog.hubspot.com/website/css-animation-examples