Files
itgmania212121/stepmania/Themes/default/Scripts/Actor.lua
T

97 lines
2.4 KiB
Lua
Raw Normal View History

2006-01-23 05:49:22 +00:00
function Actor:ease(t, fEase)
-- Optimizations:
-- fEase = -100 is equivalent to TweenAccelerate.
if fEase == -100 then
self:accelerate(t);
return;
end
-- fEase = 0 is equivalent to TweenLinear.
if fEase == 0 then
self:linear(t);
return;
end
-- fEase = +100 is equivalent to TweenDecelerate.
if fEase == 100 then
self:decelerate(t);
return;
end
self:tween( t, TweenBezier,
{
0,
scale(fEase, -100, 100, 0/3, 2/3),
scale(fEase, -100, 100, 1/3, 3/3),
1
}
);
end
local BounceBeginBezier =
{
0, 0,
0.42, -0.42,
2/3, 0.3,
1, 1
}
function Actor:bouncebegin(t)
self:tween( t, TweenBezier, BounceBeginBezier );
end
local BounceEndBezier =
{
0,0,
1/3, 0.7,
0.58, 1.42,
1, 1
}
function Actor:bounceend(t)
self:tween( t, TweenBezier, BounceEndBezier );
end
2006-01-23 06:54:23 +00:00
local SmoothBezier =
{
0, 0, 1, 1
}
function Actor:smooth(t)
self:tween( t, TweenBezier, SmoothBezier );
end
2006-01-18 08:47:00 +00:00
-- Hide if b is true, but don't unhide if b is false.
function Actor:hide_if(b)
if b then
self:hidden(1)
end
end
2006-01-24 02:10:50 +00:00
function ActorFrame:propagatecommand( cmd )
self:propagate(1);
self:playcommand(cmd);
self:propagate(0);
end
2006-03-03 02:03:42 +00:00
-- (c) 2006 Glenn Maynard
-- All rights reserved.
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
-- without limitation the rights to use, copy, modify, merge, publish,
-- distribute, and/or sell copies of the Software, and to permit persons to
-- whom the Software is furnished to do so, provided that the above
-- copyright notice(s) and this permission notice appear in all copies of
-- the Software and that both the above copyright notice(s) and this
-- permission notice appear in supporting documentation.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
-- THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
-- INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
-- OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-- OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.