Fixed Actor:bezier function in 02 Actor.lua. Documented Actor:bezier and Actor:tween properly.
This commit is contained in:
@@ -1372,7 +1372,10 @@ save yourself some time, copy this for undocumented things:
|
||||
<Function name='texturewrapping' return='void' arguments='bool bWrap'>
|
||||
Determines if the Actor should use texture wrapping or not.
|
||||
</Function>
|
||||
<!-- tween -->
|
||||
<Function name='tween' return= '' arguments='float time, TweenType type, table params'>
|
||||
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.<br />
|
||||
It's usually more convenient to use Actor:linear, Actor:accelerate, and so on, rather than using Actor:tween directly.
|
||||
</Function>
|
||||
<Function name='valign' return='void' arguments='float fAlign'>
|
||||
Set the fractional vertical alignment of the Actor according to <code>fAlign</code> 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 <Link function="vertalign" /> for the common case.
|
||||
</Function>
|
||||
@@ -1434,8 +1437,8 @@ save yourself some time, copy this for undocumented things:
|
||||
Sets z writing to <code>true</code> or <code>false</code> based on <code>bWrite</code>.
|
||||
</Function>
|
||||
<!-- addons from scripts that come with sm-ssc (non-compat) -->
|
||||
<Function name='bezier' theme='_fallback' return='void' arguments=''>
|
||||
[02 Actor.lua]
|
||||
<Function name='bezier' theme='_fallback' return='' arguments='float time, table curve'>
|
||||
[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.
|
||||
</Function>
|
||||
<Function name='FullScreen' theme='_fallback' return='void' arguments=''>
|
||||
[02 Actor.lua] Stretches an Actor to cover the screen. (equivalent to <code>stretchto,0,0,SCREEN_WIDTH,SCREEN_HEIGHT</code>)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user