rotate an image while incombat
Looking for some help rotating an image like an hourglass while in combat.. Ive tried many WHILE and IF setups but every one freezes the game.
Im looking basically to do this : Code:
zo_callLater(function() TeleportHourglass:SetTransformRotationZ(math.rad(45)) end, effectDelay)-- test Code:
EVENT_MANAGER:RegisterForEvent("RidinDirty", EVENT_PLAYER_COMBAT_STATE, RidinDirty.TeleportQueue) Basically im looking to be able to repeat the following or something similarly effective, looped until combat ends and then jump to new code: Code:
zo_callLater(function() TeleportHourglass:SetTransformRotationZ(math.rad(45)) end, effectDelay)-- test |
Quote:
EDIT: Inspect the code in the function FyrMM.CheapAnimation(pin, rotate) in my Minimap by Fyrakin version, I use it to make the world event cyclon texture spin when it's active. |
Or use the animation framework the game already provides instead of setting properties in your own code manually. ;)
You can find an example of how it is used in the ui source code. "LoadIconAnimation" rotates a texture by 360° every 1.5 seconds as defined here. |
Quote:
Or maybe what I should be asking is.. How do I call that function to load and rotate "/esoui/art/screens_app/load_ourosboros.dds" while i want it to and then shut it down after? I havent the slightest how to make sense or use of that XML yet. |
this seems mind blowing but i assume i need to create the window and the control 1st with the image and then animate it? Heres kinda what im working with so far.. no errors but no animation either just image. I feel im close but missing something.
Code:
function Initialize() |
wiki:
https://wiki.esoui.com/How_to_animate_textures which just sends to this thread: https://www.esoui.com/forums/showthread.php?t=1191 The animation manager is till very obscure to me though... |
Quote:
|
You almost got it right. Instead of GetControl(image, "/esoui/art/screens_app/load_ourosboros.dds") you need to pass the image to it directly though.
GetControl is used to get a control by name, so passing a texture path to it doesn't make any sense. Lua Code:
You don't have to mess with xml if you do not want to do that yet. You can just use the existing animation templates. It's also possible to modify them in Lua once you created it, but I don't really recommend it, as it's bad for long-term maintainability of your addon. Lua Code:
EDIT: you should also take care to make your variables local or store them on a table your addon "owns". Otherwise you may accidentally overwrite something somewhere that is out of your scope and break stuff. |
MOst of that makes sense thank you! with the exception of point 2 and 3:
2. image:SetAnchorFill(hourglass) 3. image:SetTexture("/esoui/art/screens_app/load_ourosboros.dds") -- no point in doing that via the global variable when you already have it locally its unclear what u were suggesting for #2 and for #3 if i dont load the "/esoui/art/screens_app/load_ourosboros.dds" there then how will it load that image as thats the only place its even mentioned? |
the comment was regarding how you accessed the image in your original code:
Lua Code:
|
Quote:
also got it animating!!! with that line so far... now just trying to put a text label on it thats visible.. its just a waiting for combat to end message and hourglass for a teleport function i have.. I wanted something visible so you knew its still running or waiting. |
Quote:
|
ok got the sound working too yay!! now one last thing.. Id like it to toggle on and off during combat if you press it again. im working with this section now only and like only the if statement line. What im wanting is repeated presses check if the animation is visible and if it is turn it off and the combat state monitoring etc like you see below:
Code:
if IsHidden(hourglass) == (false) then |
nevermind i got it!! thank you all so much for all the help.. i love this little tool :)
Code:
if not hourglass:IsHidden() then |
All times are GMT -6. The time now is 09:19 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI