-
Notifications
You must be signed in to change notification settings - Fork 1
Row related functions
The functions on this page are available by loading the row.lua extension. It is loaded by default.
Returns the row at index index
in the form of an object with functions to modify values of it.
Example:
mycoolrow = level:getrow(0) -- Get the first row in the level.
-- Now you can do stuff with it, such as
mycoolrow:movex(1, 75, 1, 'Linear')
-- to move the first row in the level.
-- The function used above will be explained later.
Moves the row into the room room
at beat beat
. Note that room
is 0-indexed.
Example:
mycoolrow:setroom(2, 1) -- at beat 2 mycoolrow will be moved into room 1 (second room),
mycoolrow:setroom(6, 0) -- and at beat 6 it will be moved into room 0.
Moves the row to x
% on the x axis at beat beat
with a duration duration
and ease ease
.
x
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movex(4, 75, 1, 'OutExpo') -- at beat 4, move mycoolrow's x position to 75% with a duration of 1 beat and OutExpo ease
mycoolrow:movex(6, '{f0}', 1, 'Linear') -- and at beat 6, move to f0 over 1 beat, linearly. if f0 is 25, it will go to 25%
Moves the row to y
% on the y axis at beat beat
with a duration duration
and ease ease
.
y
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movey(6, 30, 0, 'OutQuad') -- at beat 6, move mycoolrow's y position to 30% with a duration of 0 beats and OutQuad ease
Scales the row on the x axis to x
times its original size with a duration duration
and ease ease
.
x
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movesx(8, 2, 1, 'InQuint') -- at beat 8, set mycoolrow's horizontal size to 2 times its original size (equivalent to 200% in the editor) with a duration of 1 beat and InQuint ease.
Scales the row on the y axis to y
times its original size with a duration duration
and ease ease
.
y
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movesy(6, 1.5, 1, 'InQuint') -- at beat 6, set mycoolrow's vertical size to 1.5 times its original size (equivalent to 150% in the editor) with a duration of 1 beat and InQuint ease.
Rotates the row to rot
degrees with a duration duration
and ease ease
.
rot
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:rotate(3, 90, 0.5, 'OutSine') -- at beat 3, rotate mycoolrow to 90 degrees with a duration of 0.5 beats and OutSine ease.
Moves the row's pivot to pivot
with a duration duration
and ease ease
. pivot
0 is equivalent to 0% and pivot
1 is equivalent to 100%.
Example:
mycoolrow:movepivot(2, 0.5, 1, 'InExpo') -- at beat 2, move the row's pivot to its center with a duration of 1 beat and InExpo ease.
Offsets the row's character from its original position by x
% on the x axis at beat beat
with a duration duration
and ease ease
.
x
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movecx(2, -5, 0.5, 'InElastic') -- at beat 2, offset the row's character by -5% (5% to the left) with a duration of 0.5 beats and InElastic ease.
Offsets the row's character from its original position by y
% on the y axis at beat beat
with a duration duration
and ease ease
.
y
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movecy(2, 10, 0.5, 'InElastic') -- at beat 2, offset the row's character by 10% (10% up) with a duration of 0.5 beats and InElastic ease.
Rotates the row's character to rot
degrees with a duration duration
and ease ease
.
rot
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:crotate(4, -90, 1, 'OutElastic') -- at beat 4, rotate mycoolrow's character to -90 degrees with a duration of 1 beat and OutElastic ease.
Scales the row's character on the x axis to x
times its original size with a duration duration
and ease ease
.
x
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movecsx(8, 2, 1, 'InQuint') -- at beat 8, set mycoolrow's character's horizontal size to 2 times its original size (equivalent to 200% in the editor) with a duration of 1 beat and InQuint ease.
Scales the row's character on the y axis to y
times its original size with a duration duration
and ease ease
.
y
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movecsy(6, 1.5, 1, 'InQuint') -- at beat 6, set mycoolrow's character's vertical size to 1.5 times its original size (equivalent to 150% in the editor) with a duration of 1 beat and InQuint ease.
Offsets the row's heart from its original position by x
% on the x axis at beat beat
with a duration duration
and ease ease
.
x
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movehx(2, -5, 0.5, 'InElastic') -- at beat 2, offset the row's heart by -5% (5% to the left) with a duration of 0.5 beats and InElastic ease.
Offsets the row's heart from its original position by y
% on the y axis at beat beat
with a duration duration
and ease ease
.
y
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movehy(2, 10, 0.5, 'InElastic') -- at beat 2, offset the row's heart by 10% (10% up) with a duration of 0.5 beats and InElastic ease.
Rotates the row's heart to rot
degrees with a duration duration
and ease ease
.
rot
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:hrotate(4, -90, 1, 'OutElastic') -- at beat 4, rotate mycoolrow's heart to -90 degrees with a duration of 1 beat and OutElastic ease.
Scales the row's heart on the x axis to x
times its original size with a duration duration
and ease ease
.
x
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movehsx(8, 2, 1, 'InQuint') -- at beat 8, set mycoolrow's heart's horizontal size to 2 times its original size (equivalent to 200% in the editor) with a duration of 1 beat and InQuint ease.
Scales the row's heart on the y axis to y
times its original size with a duration duration
and ease ease
.
y
can be a string surrounded by {}
instead, representing a RDCode formula.
Example:
mycoolrow:movehsy(6, 1.5, 1, 'InQuint') -- at beat 6, set mycoolrow's heart's vertical size to 1.5 times its original size (equivalent to 150% in the editor) with a duration of 1 beat and InQuint ease.
A helper function to make creating multiple movements at once easier. p
is a key-value table where the key is what function to call and the value is the parameter.
Example:
mycoolrow:move(2, { -- at beat 2,
x = 40, -- move the row to 40% on the x axis,
sy = 0.5, -- scale the row to half its size on the y axis,
rotate = 90, -- rotate the row by 90 degrees, (you can also use rot!)
crotate = -90, -- rotate the row's character by -90 degrees, (you can also use crot!)
hrotate = 180 -- rotate the row's heart by 180 degrees, (you can also use hrot!)
}, 1, 'Linear') -- with a duration of 1 beat and Linear ease.
Plays the expression expression
at beat beat
.
Example:
mycoolrow:playexpression(2, 'happy') -- play the happy expression at beat 2
Replaces the expression target
with the expression expression
at beat beat
.
Example:
mycoolrow:swapexpression(2, 'neutral', 'happy') -- replace the neutral expression with the happy expression at beat 2
Set whether the row will be visible at start.
Example:
mycoolrow:setvisibleatstart(true) -- mycoolrow will be visible at start
mycoolrow:setvisibleatstart(false) -- mycoolrow will no longer be visible at start
Sets the row's border to bordertype
, with the color color
, opacity opacity
at beat beat
with a duration duration
and ease ease
.
bordertype
should be None
, Outline
or Glow
.
Example:
mycoolrow:setborder(2, 'Glow', 'FF0000', 100, 1, 'OutExpo') -- at beat 2, sets mycoolrow's border to Glow, with a color of FF0000 (red), opacity of 100 (fully opaque) with a duration of 1 beat and OutExpo ease.
If showtint
is true, sets the row's tint to color
with opacity
% opacity, with a duration duration
and ease ease
.
If false, removes the tint from the row.
Example:
mycoolrow:settint(4, true, '0000FF', 50, 1, 'OutExpo') -- at beat 4, sets mycoolrow's tint to 0000FF (blue), opacity of 50 with a duration of 1 beat and OutExpo ease.
Sets the row's opacity to opacity
at beat beat
with a duration duration
and ease ease
.
Example:
mycoolrow:setopacity(6, 50, 1, 'InQuint') -- at beat 6, set mycoolrow's opacity to 50% with a duration of 1 beat and InQuint ease.
Shows the whole row at beat beat
. smooth
0 makes the transition instant, 1 makes the transition smooth (particles of smoke) and 2 makes the full transition, with the expanding of the row.
Example:
mycoolrow:show(4, 0) -- at beat 4, show the row instantly
mycoolrow:hide(6, 1) -- at beat 6, hide the row smoothly (more about this lower)
mycoolrow:show(8, 2) -- at beat 8, show the full appearing of the row
Hides the whole row at beat beat
. smooth
0 makes the transition instant and 1 makes the transition smooth.
Example:
mycoolrow:hide(4, 1) -- at beat 4, hide the row smoothly
mycoolrow:show(5, 0) -- at beat 5, show the row instantly
mycoolrow:hide(8, 0) -- at beat 8, hide the row instantly
Shows only the row's character at beat beat
. smooth
0 makes the transition instant and 1 makes the transition smooth.
Example:
mycoolrow:showchar(4, 1) -- at beat 4, show only the row's character smoothly
mycoolrow:show(5, 0) -- at beat 5, show the whole row instantly
mycoolrow:showchar(8, 0) -- at beat 8, show only the row's character instantly
Shows only the row's row (everything except the character) at beat beat
. smooth
0 makes the transition instant and 1 makes the transition smooth.
Example:
mycoolrow:showrow(4, 1) -- at beat 4, show only the row's row smoothly
mycoolrow:show(5, 0) -- at beat 5, show the whole row instantly
mycoolrow:showrow(8, 0) -- at beat 8, show only the row's row instantly
Toggles the row's visibility at beat beat
, shows the row if it's hidden and hides it if it's visible. smooth
0 makes the transition instant and 1 makes the transition smooth.
Example:
mycoolrow:hide(2, 0) -- at beat 2, hide the row instantly
mycoolrow:togglevis(4, 0) -- at beat 4, toggle its visibility, showing it instantly
mycoolrow:togglevis(6, 1) -- at beat 6, toggle it again, hiding it smoothly
Sets every row's border to bordertype
, with the color color
, opacity opacity
at beat beat
with a duration duration
and ease ease
.
bordertype
should be None
, Outline
or Glow
.
Same as calling row:setborder
for every row manually.
Example:
level:allborder(2, 'Glow', 'FF0000', 100, 1, 'OutExpo') -- at beat 2, sets every row's border to Glow, with a color of FF0000 (red), opacity of 100 (fully opaque) with a duration of 1 beat and OutExpo ease.
Sets every row's border to the glow, with the color color
, opacity opacity
at beat beat
with a duration duration
and ease ease
.
Same as calling row:setborder
for every row manually or level:allborder
with 'Glow' for bordertype
.
Example:
level:allglow(2, 'FF0000', 100, 1, 'OutExpo') -- at beat 2, sets every row's border to Glow, with a color of FF0000 (red), opacity of 100 (fully opaque) with a duration of 1 beat and OutExpo ease.
Sets every row's border to the outline, with the color color
, opacity opacity
at beat beat
with a duration duration
and ease ease
.
Same as calling row:setborder
for every row manually or level:allborder
with 'Outline' for bordertype
.
Example:
level:alloutline(2, 'FF0000', 100, 1, 'OutExpo') -- at beat 2, sets every row's border to Outline, with a color of FF0000 (red), opacity of 100 (fully opaque) with a duration of 1 beat and OutExpo ease.
If showtint
is true, sets every row's tint to color
with opacity
% opacity, with a duration duration
and ease ease
.
If false, removes the tint from every row.
Same as calling row:settint
for every row manually.
Example:
level:alltint(4, true, '0000FF', 50, 1, 'OutExpo') -- at beat 4, sets every row's tint to 0000FF (blue), opacity of 50 with a duration of 1 beat and OutExpo ease.
Takes no parameters, and simply marks all rows to be hidden at the start of the level.
Example:
level:hideallatstart()