diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index 599f9e9dba..bf68845f0e 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -1372,7 +1372,10 @@ save yourself some time, copy this for undocumented things: Determines if the Actor should use texture wrapping or not. - + + Uses type to determine the tween to use. The type must be one of the TweenType enum values. If the type is note TweenType_Bezier, the params table is ignored. If the type is TweenType_Bezier, then the params table must have 4 or 8 numbers. 4 numbers in the params creates a 1 dimensional bezier curve, 8 numbers creates a 2 dimensional bezier curve.
+ It's usually more convenient to use Actor:linear, Actor:accelerate, and so on, rather than using Actor:tween directly. +
Set the fractional vertical alignment of the Actor according to fAlign which should be a float in the range 0..1. An alignment of 0 is top aligned while an alignment of 1 is bottom aligned. See for the common case. @@ -1434,8 +1437,8 @@ save yourself some time, copy this for undocumented things: Sets z writing to true or false based on bWrite. - - [02 Actor.lua] + + [02 Actor.lua] Plays the commands that follow using a bezier curve to determine the rate. The curve must have 4 or 8 elements. This is a convenience wrapper around calling Actor:tween with TweenType_Bezier. [02 Actor.lua] Stretches an Actor to cover the screen. (equivalent to stretchto,0,0,SCREEN_WIDTH,SCREEN_HEIGHT) diff --git a/Themes/_fallback/Scripts/02 Actor.lua b/Themes/_fallback/Scripts/02 Actor.lua index 231d8b212c..e10890aab7 100644 --- a/Themes/_fallback/Scripts/02 Actor.lua +++ b/Themes/_fallback/Scripts/02 Actor.lua @@ -209,16 +209,10 @@ function Actor:CenterX() self:x(SCREEN_CENTER_X) return self end function Actor:CenterY() self:y(SCREEN_CENTER_Y) return self end function Actor:Center() self:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y) return self end -function Actor:bezier(...) - local a = {...} - local b = {} - local c = 0 - assert((a == 9 or a == 5), "bad number of arguments for Actor:bezier()") - for i=3,c do - b[#b+1] = a[i] - end - self:tween(a[2], "TweenMode_Bezier", b) - return self +function Actor:bezier(time, curve) + assert(type(time) == "number", "bezier tween time must be a number") + assert((#curve == 4 or #curve == 8), "bezier tween curve must have 4 or 8 elements") + return self:tween(time, "TweenType_Bezier", curve) end function Actor:Real()