Animationstechniken ...

zork-tdmog

Rare-Mob
Registriert
08.06.2009
Beiträge
152
Reaktionspunkte
0
Kommentare
2
Am Anfang war das Rad und nun wollen wir das Rad mal ans laufen kriegen.

Dies ist ein Re-Post von:
http://ui.phcnet.de/index.php?topic=51.0

Beziehen tue ich mich hier auf meine Erfahrungen aus meinem Diablo 3 UI.
http://www.wowinterface.com/downloads/fileinfo.php?id=9175

Ich versuche in dem Thread die mir bisher bekannten Möglichkeiten aufzuzeigen, wie man Animationen im WoW UI anzeigen kann.

Methode 1
Man erstellt einen Frame mit einer Textur und tauscht per OnUpdate die Textur aus.

Methode 2
Man erstellt einen Frame mit einer Textur und ändert per OnUpdate den jeweils sichtbaren Bereich der Textur (Stichwort: SetTexCoord)

Methode 3
Man bedient sich der *.m2 - Dateien welche gut versteckt im WoW Code schlummern. Dazu erstellt man einen Frame als PlayerModel und kann auf diesen dann eine m2-Datei legen.

Methode 4
Man erstellt einen Frame mit einer Textur und ändert per OnUpdate den Rotationswinkel der Textur mit SetTexCoord().

Methode 5
Man erstellt in XML sogenannte AnimationGroups und kann dann Elementen ähnlich wie in Flash zeitgesteuert bestimmte Bewegungsmuster zuweisen.

Vorteile der 1. Methode
- Man kann pro Textur eine hohe Auflösung verwenden
- Es sind runde Texturen möglich, da man mit TGA Dateien arbeitet welche über einen Alpha-Kanal verfügen
- Man kann Texturen im Graufarb-Modus erstellen und sie dann durch das UI beliebig mit SetVertexColor einfärben

Nachteile der 1. Methode
- Durch den OnUpdate ist die Rechenbelastung relativ stark und bei langsamen Rechner beginnt es merklich zu ruckeln

Vorteile der 2. Methode
- Man benötigt nur eine Textur, was das ruckeln enorm minimiert, da per OnUpdate nur die Coordinaten für den sichtbaren Bereich angepasst werden
- Es sind runde Texturen möglich, da man mit einer TGA Datei arbeitet welche über einen Alpha-Kanal verfügt
- Man kann Texturen im Graufarb-Modus erstellen und sie dann durch das UI beliebig mit SetVertexColor einfärben

Nachteile der 2. Methode
- Texturen können maximal 512x512 Pixel groß werden, daher ist der Platz stark begrenzt. Wie man wissen sollte benötigt man für eine flüssige Animation 25 Bilder pro Sekunde, das bedeutet alle 0.04 Sekunde muss ein neues Bild geladen werden. 5x5 entspricht genau 25, also hat man bei dieser Methode maximal 102px x 102px pro Einzelbild, was für die Qualität nicht besonders gut ist. Ok es sind "immerhin" 102px ...
smile.gif

- Die maximale Anzahl der Texturen ist klein, dadurch wiederholen sich die Bilder relativ häufig und die Kugel (in diesem Beispiel) dreht sich sehr schnell.

Vorteile der 3. Methode
- Da die ganze Animation in der m2-Datei steckt braucht man nicht mit OnUpdate arbeiten, das spart Rechenleistung und ist zudem absolut flüssig
- Durch den mathematischen Aufbau der Animation welche sich intern immer neu berechnet hat man nie das Gefühl, dass sich die Animation wiederholt

Nachteile der 3. Methode
- Die Animationen sind abhängig von der Zauberdetailstufe. Je höher sie ist umso deutlicher die Animation.
- Das PlayerFrame ist recheckig, demzufolge muss man die Ecken irgendwie überdecken, man hat kaum eine Möglichkeit die Animation diesbezüglich zu beeinflussen.
- Aus mir unerfindlichen Gründen wirkt sich das betreten von Instanzen auf den Paramter "SetPosition" von Animationen aus. Das hat zur Folge, dass man meist mit SetPosition(-10,0,0) o.ä. arbeiten muss. Die WoW Api ist diesbezüglich zumindest was Animationen betrifft falsch. Es muss lauten SetPosition(z,x,y).
- Man kann die Animationen nachträglich nicht einfärben

Vorteile der 4. Methode
- Man braucht nur eine Textur
- Die Textur kann sehr groß und Detailreich sein (512x512px möglich)
- Man kann durch die Gradzahl definieren wieviel mögliche Bilder es geben wird, Endbild wird eigenständig errechnet
- Dank TGA Format sind runde Texturen möglich

Nachteile der 4. Methode
- Die Textur dreht sich immer in eine Richtung und kann sich dabei nicht selbst verändern.
- Macht nur bei meist nur bei runden Texturen Sinn, da eine quadratische Textur in der Rotation wahrscheinlich nicht den gewünschten Effekt erzeugt.

Nachteile der 5. Methode
- Derzeit nur gut in XML dokumentiert, die LUA API ist noch recht unausgegoren.

Hinweis: Methode 3 lässt sich mit Methode 1, 2 und 4 koppeln. Da die m2. Files selber halbtransparent sind.

Quellen:
http://www.wowwiki.com/World_of_Warcraft_API
http://www.mpqnav.com/2008/06/11/m2s-have-...glorious-trees/
http://wowdev.org/wiki/index.php/M2
http://www.gameguidesonline.com/guides/art...ctober05_02.asp
http://www.wowprogramming.com/docs/widgets
 
Zuletzt bearbeitet von einem Moderator:
Methode 1

Code:
local mod = CreateFrame("Frame", nil, UIParent)

mod:RegisterEvent("PLAYER_LOGIN")

mod:SetScript("OnEvent", function ()
  if(event=="PLAYER_LOGIN") then
	 mod:initme()
  end
end)

function mod:initme()

  myFrame = CreateFrame("Frame", "myFrame", UIParent)
  myFrame:SetWidth(120)
  myFrame:SetHeight(120)
  myFrame:ClearAllPoints()
  myFrame:SetPoint("CENTER",0,0)

  myFrameFilling = myFrame:CreateTexture("myFrameFilling", "ARTWORK")
  myFrameFilling:SetPoint("CENTER", myFrame, "CENTER", 0,0)
  myFrameFilling:SetWidth(myFrame:GetWidth())
  myFrameFilling:SetHeight(myFrame:GetHeight())
  myFrameFilling:SetTexture("Interface\\AddOns\\Interface\\AddOns\\my_TexturePath\\my_TextureFile0.tga")
  myFrameFilling:SetVertexColor(1,0,0)
 
  local totalElapsed = 0
  local counter = 0
  local modifier = 100
  local update_timer = 0.04
  
  local function OnUpdateFunc(self, elapsed)
	totalElapsed = totalElapsed + elapsed * modifier
	local update_me = update_timer * modifier
	if (totalElapsed < update_me) then 
	  return 
	else
	  totalElapsed = totalElapsed - floor(totalElapsed)
	  myFrameFilling:SetTexture("Interface\\AddOns\\my_TexturePath\\my_TextureFile"..counter..".tga")
	  counter = counter+1
	  if counter > 24 then
		counter = 0
	  end
	end
  end

  myFrame:SetScript("OnUpdate", OnUpdateFunc)
 
end

Im Anhang ist eine Beispieltextur (nur eine von den 'n'-Texturen)

Beispielmod: http://code.google.com/p/rothui/source/bro...unk/Diablo3Orbs

Dazu ist nicht viel zu sagen. Wir erstellen einen Frame und für diesen Frame eine Textur, dann gehen wir mit einem OnUpdate-Script auf den Frame los und tauschen bei jedem update den Texturnamen aus.

[attachment=7935:example_texture1.jpg]
 
Zuletzt bearbeitet von einem Moderator:
Methode 2

Code:
  local mod = CreateFrame("Frame", nil, UIParent)
  
  mod:RegisterEvent("PLAYER_LOGIN")
  
  mod:SetScript("OnEvent", function ()
	if(event=="PLAYER_LOGIN") then
	  mod:initme()
	end 
  end)

  function mod:initme()
  
	local base_texture = "Interface\\AddOns\\my_TexturePath\\my_TextureFile.tga"
	
	local orbsize = 120

	--sets the number of textures that are inside
	local num_rows = 8
	local num_columns = 4
	local num_all_textures = num_rows * num_columns
	
	--width of one texture in texcoords
	local texcoord_width = 1/num_rows
	local texcoord_height = 1/num_columns
  
	local f = CreateFrame("Frame","my_FrameName")
	f:SetFrameStrata("BACKGROUND")
	f:SetWidth(orbsize)
	f:SetHeight(orbsize)
	f:SetPoint("CENTER",0,0)
	f:Show()
	
	local t = f:CreateTexture("D3Orb2HealthFilling","ARTWORK")
	t:SetTexture(base_texture)
	t:SetAllPoints(f)
	t:SetVertexColor(1,0,0)
	
	local modifier = 100
	local totalElapsed = 0
	
	--UPDATE TIMER
	local update_timer = 0.04
	
	local counter = 1
	local row = 1 --spalte
	local column = 1 --zeile
	
	local tex_left = 0
	local tex_right = 1
	local tex_top = 0
	local tex_bottom = 1

	local function OnUpdateFunc(self, elapsed)
	
	  totalElapsed = totalElapsed + elapsed * modifier
	  local update_me = update_timer * modifier
	  if (totalElapsed < update_me) then 
		return 
	  else
		
		totalElapsed = totalElapsed - floor(totalElapsed)

		tex_left = (row - 1) * texcoord_width
		tex_right = row * texcoord_width
		
		tex_top = (column - 1) * texcoord_height
		tex_bottom = column * texcoord_height
		
		t:SetTexCoord(tex_left,tex_right,tex_top,tex_bottom)
		
		if (counter % num_rows) == 0 then
		  column = column + 1
		  row = 0
		end		
		
		counter = counter + 1
		row = row + 1
		
		if counter > num_all_textures then
		  counter = 1
		  column = 1
		  row = 1
		end
		
	  end
	end
	mod:SetScript("OnUpdate", OnUpdateFunc)
	
  end

Im Anhang ist die Basistextur, welche dann entsprechend durchgegangen wird.

Beispielmod:
http://www.wowinterface.com/downloads/download9207-Disco2

Das ganze ist schon ein wenig defizieller, da SetTexCoord nicht so leicht zu kapieren ist. Daher hab ich mir dafür auch selber eine Grafik zur Anschauung gemacht (siehe Anhang).

Man sieht, das sich alles zwischen 0 und 1 abspielt und das die Anzahl der Felder einer Textur entscheidenden Anteil daran haben. Feld 6 z.b. hat in dem Beispiel SetTexCoord(0.25,0.5,0.25,0.5).

Daher eine wichtige Sache, macht euch selbst nich das Leben zur Hölle und wählt eine sinnvolle Größe bei der Textur welche optimalerweise die Textur komplett ausfüllen sollte, sonst dürft ihr irgendwo was abziehen und dann viel Spass.

Was wir machen: Wir erstellen einen Frame und dann eine Textur für die Füllung. Dann setzen wir ein onUpdate-Script auf den Frame an, welches alle 0.04 Sekunden durchlaufen wird und dann den SetTexCoord-Wert so verändert, dass man immer den richtigen Ausschnitt sieht.

[attachment=7936:example_texture2.jpg]
[attachment=7937:settexcoord.jpg]
 
Zuletzt bearbeitet von einem Moderator:
Methode 3

Code:
  local mod = CreateFrame("Frame", nil, UIParent)

  mod:RegisterEvent("PLAYER_LOGIN")
  
  mod:SetScript("OnEvent", function ()
	if(event=="PLAYER_LOGIN") then
	  mod:initme()
	end 
  end)

  function mod:initme()
  
	local orbsize = 130

	local f = CreateFrame("Frame","myFrameName",UIParent)
	f:SetFrameStrata("BACKGROUND")
	f:SetWidth(orbsize)
	f:SetHeight(orbsize)
	f:SetPoint("CENTER",0,0)
	f:Show()	
   
	local t2 = f:CreateTexture("myTextureName","ARTWORK")
	t2:SetTexture("Interface\\AddOns\\myTexturePath\\myTextureFile.tga")
	t2:SetPoint("BOTTOMLEFT",0,0)
	t2:SetWidth(orbsize)
	t2:SetHeight(orbsize)
	t2:SetVertexColor(0.2,0.2,0.2)
		
	local pm1 = CreateFrame("PlayerModel", "myAnimationFrameName",f)
	pm1:SetFrameStrata("BACKGROUND")
	pm1:SetWidth(orbsize)
	pm1:SetHeight(orbsize)
	pm1:SetPoint("TOPRIGHT",0,0)
	pm1:SetPoint("BOTTOMLEFT",0,0)
	pm1:SetModel("SPELLS\\RedRadiationFog.m2")
	pm1:SetPosition(-7, 0, 0) 
	
	pm1:SetScript("OnShow",function() 
	  pm1:SetModel("SPELLS\\RedRadiationFog.m2")
	  pm1:SetPosition(-7, 0, 0) 
	end)
  
  end

Beispielmod: http://www.wowinterface.com/downloads/info...lowingOrbs.html

Ok, was machen wir hier?

Zuerst einmal erstellen wir einen Frame und legen dann auf diesen Frame eine Textur zum Beispiel eine Füllung.
Jetzt erstellen wir einen zweiten Frame, allerdings eins vom Template PlayerModel, das machen wir deshalb, da wir auf diesen Frame ein Model anwenden können. In unserem Fall ist dieses Model ein roter Nebel.

Wichtig: je dunkler die Füllung und je höher die Zauberdetailstufe (unter Grafik-Settings) umso heller und stärker kommt der Nebel zur Geltung.

[attachment=7938:orb.jpg]
 
Zuletzt bearbeitet von einem Moderator:
Ganz hab ich das mit den m2 Files noch nicht aufgegeben
wink.gif
.

Man kann 4 Arten von Frames erstellen welche m2 Files laden könnten.

Sieht man ganz schön hier: http://www.wowprogramming.com/docs/widgets_hierarchy

- Model - A widget to display a real 3D-mesh as part of the UI.
- PlayerModel - A widget to display a 3D player mesh.
- DressUpModel - A 3D player mesh with functions to dress-up in different items.
- TabardModel - A 3D mesh used by the tabard frame for designing a new tabard.

Aufruf ist dann also so:
Code:
local var = CreateFrame("Model", "myFrameName")
local var = CreateFrame("PlayerModel ", "myFrameName")
local var = CreateFrame("DressUpModel ", "myFrameName")
local var = CreateFrame("TabardModel ", "myFrameName")

Einen tollen Artikel dazu gabs bereits 2005:
http://www.gameguidesonline.com/guides/art...ctober05_02.asp

Ich frage mich was z.b. in Instanzen passiert, evtl verändert sich ja nicht SetPosition, sondern es wird eine andere Animationssequenz geladen welche eben andere Paramter mit sich bringt.

Werd damit auf jeden Fall noch ein wenig rumspielen.

Code:
  local addon = CreateFrame("Frame", nil, UIParent)
 
  addon:RegisterEvent("PLAYER_LOGIN")
  
  addon:SetScript("OnEvent", function ()
	if(event=="PLAYER_LOGIN") then
	  addon:initme()
	end 
  end)

  function addon:initme()
  
	local m1 = CreateFrame("Model", "AnitestModel",UIParent)

	--model stuff
	m1:SetModel("SPELLS\\RedRadiationFog.m2")
	m1:SetCamera(0)
	m1:SetModelScale(1)
	--m1:SetPosition(-5, 0.5, 0.5) 
	
	--frame stuff
	m1:SetAllPoints(f)
	m1:SetFrameStrata("BACKGROUND")
	m1:SetWidth(256)
	m1:SetHeight(256)
	m1:SetPoint("CENTER",0,0)
	m1:Show()

	--[[
	--onshow = do stuff
	m1:SetScript("OnShow",function() 
	  m1:SetModel("SPELLS\\RedRadiationFog.m2")
	  m1:SetPosition(-5, 0.5, 0.5) 
	end)
	]]--

  end

Die Möglichkeiten sind wirklich enorm. Man kann ohne viel Rechenaufwand z.B. eine Goldkiste unten links in sein UI setzen o.ä. Späße.
 
Zuletzt bearbeitet von einem Moderator:
Methode 4 - Simple rotation of square textures around the center

While the above section about matrix manipulation gives a lot of flexibility, most often much simpler math suffice. Here's an example of rotating a square texture around its center with an arbitrary angle:

Beispiel 1
Code:
local s2 = sqrt(2);
local cos, sin, rad = math.cos, math.sin, math.rad;
local function CalculateCorner(angle)
	local r = rad(angle);
	return 0.5 + cos(r) / s2, 0.5 + sin(r) / s2;
end
local function RotateTexture(texture, angle)
	local LRx, LRy = CalculateCorner(angle + 45);
	local LLx, LLy = CalculateCorner(angle + 135);
	local ULx, ULy = CalculateCorner(angle + 225);
	local URx, URy = CalculateCorner(angle - 45);
	
	texture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy);
end

Beispiel 2
Code:
function RotateTexture(self, degrees)
	local angle = math.rad(degrees)
	local cos, sin = math.cos(angle), math.sin(angle)
	self:SetTexCoord((sin - cos), -(cos + sin), -cos, -sin, sin, -cos, 0, 0)
end

Beispiel aus oUF_Circle
Code:
self.InnerRing:SetVertexColor(1,0,0,1)
self:SetScript("OnUpdate", function(frame, event, addon)
  local time = GetTime()
  local ofs = time*180
  local high =  self.InnerRing 
  high:SetTexCoord(
	0.5+r2*cos(ofs+135), 0.5+r2*sin(ofs+135),
	0.5+r2*cos(ofs-135), 0.5+r2*sin(ofs-135),
	0.5+r2*cos(ofs+45), 0.5+r2*sin(ofs+45),
	0.5+r2*cos(ofs-45), 0.5+r2*sin(ofs-45)
  )
end)

Quelle: http://www.wowwiki.com/SetTexCoord_Transformations

Was genau ist das hier?
Wir haben nur eine Textur und verwenden dann SetTexCoord um diese Textur um ihren Mittelpunkt zu drehen. Wenn man sich jetzt eine runde Textur vorstellt, so wird diese sozusagen rechts- oder linksherum um den Mittelpunkt rotieren. Man braucht nur eine Textur und kann daher auf eine sehr hochwertige Grafik zurückgreifen. Die übernimmt dann eine mathematische Formel sowie ein OnUpdateScript.

Beispielmod:
http://www.wowinterface.com/downloads/info...ameRotater.html
 
Zuletzt bearbeitet von einem Moderator:
Methode 5

So langsam kommt eine neue Animationstechnik hinzu. Blizzard erlaubt nun sogenannte Animationsgruppen, das sind Frames und Texturen, denen man eine Art Animationspfad mitgeben kann, der sich dann z.b. ständig wiederholt. Kommt dann noch math.random mit ins Boot erhält man eine Animation die sich ganz natürlich verhält.

Angucken kann man sich das bereits im Glyphen Fenster. Dort werden ja ständig aus der mitte so kleine "sparkles" gesendet. Diese sind mit der neuen Animationstechnik erstellt.

Wer sich das ganze mal näher anschauen will sollte nach "sparkle" Ausschau halten und sich diese Dateien mal angucken:

Blizzard Info:
http://forums.worldofwarcraft.com/thread.h...cId=15443414368

Beispiel:
http://wowcompares.com/3119835/AddOns/Bliz...ard_GlyphUI.xml
http://wowcompares.com/3119835/AddOns/Bliz...ard_GlyphUI.lua

[attachment=7939:glyph_interface.jpg]

LUA API Changes
Code:
 Changes to Existing Types

Region

	* Region:CreateAnimationGroup(["name"[,"inheritsFrom"]])
	  Create and return a new AnimationGroup as a child of this Region.

	* Region:StopAnimating()
	  Stops any active animations on the Region and its children.

	* Region:GetAnimationGroups()
	  Returns all AnimationGroups that are children of this Region

	* Region:IsDragging()
	  True if this Region or its Parent is being dragged.

New Types

Object

This is a new abstract type. Animations and Regions both derive from this type.

	* Object:GetParent()
	  Moved from Region:GetParent(). This is essentially the same as the old version, except that you can no longer assume that your object has a Frame type in its hierarchy somewhere.

AnimationGroup

This manages playback, order, and looping of its child Animations. Animations in a group will play in ascending order according to their order fields (accessible via SetOrder and GetOrder). If two or more Animations have the same order value, then they will play simultaneously. The next animation will not play until all Animations with that order value are done.

	* AnimationGroup:Play()
	  Start playing the animations in this group.

	* AnimationGroup:Pause()
	  Pause the animations in this group.

	* AnimationGroup:Stop()
	  Stop all animations in this group.

	* AnimationGroup:Finish()
	  Notify this group to stop playing once the current loop cycle is done. Does nothing if this group is not playing.

	* AnimationGroup:GetProgress()
	  Returns the progress of this animation as a unit value [0,1].

	* AnimationGroup:IsDone()
	  Returns true if the group has finished playing.

	* AnimationGroup:IsPlaying()
	  Returns true if the group is playing.

	* AnimationGroup:IsPaused()
	  Returns true if the group is paused.

	* AnimationGroup:GetDuration()
	  Gets the total duration across all child Animations that the group will take to complete one loop cycle.

	* AnimationGroup:SetLooping(loopType)
	  Sets the type of looping for the group. Input is [NONE, REPEAT, or BOUNCE].

	* AnimationGroup:GetLooping()
	  Gets the type of looping for the group.

	* AnimationGroup:GetLoopState()
	  Gets the current loop state of the group. Output is [NONE, FORWARD, or REVERSE].

	* AnimationGroup:CreateAnimation("animationType", ["name"[,"inheritsFrom"]])
	  Create and return an Animation as a child of this group.

	* AnimationGroup:HasScript()
	  Same as Frame:HasScript. Input is [OnLoad, OnPlay, OnPaused, OnStop, OnFinished, OnUpdate].

	* AnimationGroup:GetScript()
	  Same as Frame:HasScript. Input is [OnLoad, OnPlay, OnPaused, OnStop, OnFinished, OnUpdate].

	* AnimationGroup:SetScript()
	  Same as Frame:HasScript. Input is [OnLoad, OnPlay, OnPaused, OnStop, OnFinished, OnUpdate].


Animation

This is a base animation type. This handles all animation timing and bookkeeping. An animation tag must always be parented by an AnimationGroup tag.

	* Animation:Play()
	  Play the animation.

	* Animation:Pause()
	  Pause the animation.

	* Animation:Stop()
	  Stop the animation.

	* Animation:IsDone()
	  Returns true if the animation has finished playing.

	* Animation:IsPlaying()
	  Returns true if the animation is playing.

	* Animation:IsPaused()
	  Returns true if the animation is paused.

	* Animation:IsStopped()
	  Returns true if the animation is stopped.

	* Animation:IsDelaying()
	  Returns true if the animation is in the middle of a start or end delay.

	* Animation:GetElapsed()
	  Gets the amount of time in seconds that the animation has been playing for.

	* Animation:SetStartDelay(delaySec)
	  Set the number of seconds that the animation delays before it starts to progress.

	* Animation:GetStartDelay()
	  Get the number of seconds that the animation delays before it starts to progress.

	* Animation:SetEndDelay(delaySec)
	  Set the number of seconds the animation delays after finishing.

	* Animation:GetEndDelay()
	  Get the number of seconds the animation delays after finishing.

	* Animation:SetDuration(durationSec)
	  Set the number of seconds it takes for the animation to progress from start to finish.

	* Animation:GetDuration()
	  Get the number of seconds it takes for the animation to progress from start to finish.

	* Animation:GetProgress()
	  Returns the progress of the animation as a unit value [0,1]. Ignores start and end delay.

	* Animation:GetSmoothProgress()
	  Returns a smoothed, [0,1] progress value for the animation.

	* Animation:GetProgressWithDelay()
	  Returns the progress of the animation combined with its start and end delay.

	* Animation:SetMaxFramerate(framerate)
	  Sets the maximum frames per second that the animation will update its progress.

	* Animation:GetMaxFramerate()
	  Gets the maximum frames per second that the animation will update its progress.

	* Animation:SetOrder(order)
	  Sets the order that the animation plays within its parent group. Range is [1,100].

	* Animation:GetOrder()
	  Gets the order of the animation within its parent group.

	* Animation:SetSmoothing(smoothType)
	  Sets the smoothing type for the animation. Input is [IN,OUT, or IN_OUT].

	* Animation:GetSmoothing()
	  Gets the smoothing type for the animation.

	* Animation:SetParent(animGroup or "animGroupName")
	  Sets the parent for the animation. If the animation was not already a child of the parent, the parent will insert the animation into the proper order amongst its children.

	* Animation:GetRegionParent()
	  Gets the Region object that the animation operates on. The region object is this Animation's parent's parent (the AnimationGroup's parent).

	* Animation:HasScript("handler")
	  Same as Frame:HasScript, Input is [OnLoad, OnPlay, OnPaused, OnStop, OnFinished, OnUpdate].

	* Animation:GetScript("handler")
	  Same as Frame:GetScript, Input is [OnLoad, OnPlay, OnPaused, OnStop, OnFinished, OnUpdate].

	* Animation:SetScript("handler")
	  Same as Frame:SetScript, Input is [OnLoad, OnPlay, OnPaused, OnStop, OnFinished, OnUpdate].


Translation

This is an affine transformation that moves a parent Region by an offset. Translation has all of the methods of Animation, plus the following:

	* Translation:SetOffset(x, y)
	  Sets the offset that the animation's parent Region would travel.

	* Translation:GetOffset()
	  Gets the offset that the animation's parent Region would travel.

Rotation

This is an affine transformation that rotates a parent Region about an origin. Rotation has all of the methods of Animation, plus the following:

	* Rotation:SetDegrees(degrees)
	  Sets the amount of degrees that the animation's parent Region would rotate.

	* Rotation:GetDegrees()
	  Gets the amount of degrees that the animation's parent Region would rotate.

	* Rotation:SetRadians(radians)
	  Sets the amount of radians that the animation's parent Region would travel.

	* Rotation:GetRadians()
	  Sets the amount of radians that the animation's parent Region would travel.

	* Rotation:SetOrigin(point, offsetX, offsetY)
	  Sets the animation's origin of rotation for its parent Region.

	* Rotation:GetOrigin()
	  Gets the point, X offset, and Y offset of the animation's origin of rotation for its parent Region.

Scale

This is an affine transformation that scales a parent Region about an origin. The scale can be non-uniform. Scale has all of the methods of Animation, plus the following:

	* Scale:SetScale(x, y)
	  Sets the X scalar and the Y scalar that the animation's parent Region should scale by.

	* Scale:GetScale()
	  Gets the X scalar and the Y scalar that the animation's parent Region should scale by.

	* Scale:SetOrigin(point, offsetX, offsetY)
	  Sets the animation's origin of rotation for its parent Region.

	* Scale:GetOrigin()
	  Gets the point, X offset, and Y offset of the animation's origin of rotation for its parent Region.

Alpha

This animation changes the alpha value of its parent region. Alpha has all of the methods of Animation plus the following:

	* Alpha:SetChange(change)
	  Sets the amount that the alpha value of this animation's parent Region changes by.

	* Alpha:GetChange()
	  Gets the amount that the alpha value of this animation's parent Region changes by.
 
Zuletzt bearbeitet von einem Moderator:
Zurück