WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Lua equivalent for Animation.targetKey (https://www.wowinterface.com/forums/showthread.php?t=46097)

Haleth 03-22-13 06:45 PM

Lua equivalent for Animation.targetKey
 
I've noticed that in Blizzard's XML code, animations can have a 'targetKey' attribute which specifies which region of the animation's animation group's target frame (:p) is animated. This allows frames to have multiple animations which each affect a different region of the frame, rather than the frame as a whole.

Example:

Code:

<Frame name="WorldMapPing" framestrata="FULLSCREEN" hidden="true">
                <Size x="64" y="64"/>
                <Anchors>
                        <Anchor point="CENTER" relativeTo="WorldMapFrame"/>
                </Anchors>
                <Layers>
                        <Layer level="OVERLAY">
                                <Texture parentKey="centerRing" file="Interface\minimap\UI-Minimap-Ping-Center">
                                        <Size x="32" y="32"/>
                                        <Anchors>
                                                <Anchor point="CENTER"/>
                                        </Anchors>
                                </Texture>
                                <Texture parentKey="rotatingRing" file="Interface\minimap\UI-Minimap-Ping-Rotate">
                                        <Size x="48" y="48"/>
                                        <Anchors>
                                                <Anchor point="CENTER"/>
                                        </Anchors>
                                </Texture>
                                <Texture parentKey="expandingRing" file="Interface\minimap\UI-Minimap-Ping-Expand">
                                        <Size x="32" y="32"/>
                                        <Anchors>
                                                <Anchor point="CENTER"/>
                                        </Anchors>
                                </Texture>
                        </Layer>
                </Layers>
                <Animations>
                        <AnimationGroup parentKey="Ping" looping="REPEAT">
                                <Rotation targetKey="$parent.$parent.rotatingRing" degrees="-180" duration="0.75" order="1"/>
                                <Scale targetKey="$parent.$parent.expandingRing" scaleX="1.75" scaleY="1.75" duration="0.75" order="1"/>
                                <Scripts>
                                        <OnPlay function="WorldMapPing_OnPlay"/>
                                        <OnLoop function="WorldMapPing_OnLoop"/>
                                        <OnStop function="WorldMapPing_OnStop"/>
                                </Scripts>
                        </AnimationGroup>
                </Animations>
        </Frame>

The only way to more or less replicate this in lua is to create an animation group for the region itself, apparently, and then attach the animation to that animation group. This would mean having several animation groups, one for each region.

Is there any lua API to replicate the XML functionality?

Reason I'm asking this is because I'm trying to more or less restore the old world map player arrow. I managed to scale the thing down again and I can edit individual animations, but I'm trying to assign the scale animation to rotatingRing instead of expandingRing (which I'll hide).


All times are GMT -6. The time now is 02:16 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI