-
Notifications
You must be signed in to change notification settings - Fork 1
Room related functions
The functions on this page are available by loading the room.lua extension. It is loaded by default.
Creates some helpful room events at beat beat
: a Move Room
event which moves the room to 50x 50y and scales them to 100%x 100%y and a Set Room Content Mode
event that makes the room stretch for every room.
beat
can be omitted and they will be created at the start of the level.
Example:
level:setuprooms() -- it's that simple!
Orders the rooms in the order r1
, r2
, r3
, r4
at beat beat
. The first room is the highest, showing above all the others and the last room is the lowest, showing under all the others. Note that r1
, r2
, r3
and r4
are 0-indexed.
Example:
level:reorderrooms(2, 1, 0, 2, 3) -- room 2 becomes above all the others, then comes room 1, 3 and 4
Returns the room at index index
(0-3 for regular rooms, 4 for the ontop room) in the form of an object with functions to modify values of it.
Example:
mycoolroom = level:getroom(0) -- Get the first room.
-- Now you can do stuff with it, such as
mycoolroom:movex(1, 75, 1, 'Linear')
-- to move it.
-- The function used above will be explained later.
Returns a room in either a numerical or table format. Only useful for developers.
mycoolroom = level:getroom(0)
normalrow = level:getrow(1)
print( level:parseroom(mycoolroom) ) -- 0
print( level:parseroom(0) ) -- 0
print( level:parseroom(mycoolroom, true) == mycoolroom ) -- true
print( level:parseroom(0, true) == mycoolroom ) -- true
print( level:parseroom(normalrow) ) -- Error!
Moves the room to x
% on the x axis at beat beat
with a duration duration
and ease ease
.
Example:
mycoolroom:movex(4, 75, 1, 'OutExpo') -- at beat 4, move mycoolroom's x position to 75% with a duration of 1 beat and OutExpo ease
Moves the room to y
% on the y axis at beat beat
with a duration duration
and ease ease
.
Example:
mycoolroom:movey(6, 30, 0, 'OutQuad') -- at beat 6, move mycoolroom's y position to 30% with a duration of 0 beats and OutQuad ease
Scales the room on the x axis to x
% with a duration duration
and ease ease
.
Example:
mycoolroom:movesx(8, 200, 1, 'InQuint') -- at beat 8, set mycoolroom's horizontal size to 200% with a duration of 1 beat and InQuint ease.
Scales the room on the y axis to y
% with a duration duration
and ease ease
.
Example:
mycoolroom:movesy(6, 150, 1, 'InQuint') -- at beat 6, set mycoolroom's vertical size to 150% with a duration of 1 beat and InQuint ease.
Rotates the room to rot
degrees with a duration duration
and ease ease
.
Example:
mycoolroom:rotate(3, 90, 0.5, 'OutSine') -- at beat 3, rotate mycoolroom to 90 degrees with a duration of 0.5 beats and OutSine ease.
Moves the room's pivot to x
% on the x axis at beat beat
with a duration duration
and ease ease
.
Example:
mycoolroom:movepx(4, 75, 1, 'OutExpo') -- at beat 4, move mycoolroom's x pivot to 75% with a duration of 1 beat and OutExpo ease
Moves the room's pivot to y
% on the y axis at beat beat
with a duration duration
and ease ease
.
Example:
mycoolroom:movepx(4, 75, 1, 'OutExpo') -- at beat 4, move mycoolroom's y pivot to 75% with a duration of 1 beat and OutExpo 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:
mycoolroom:move(2, { -- at beat 2,
x = 40, -- move the room to 40% on the x axis,
sy = 0.5, -- scale the room to half its size on the y axis,
rotate = 90, -- rotate the room by 90 degrees, (you can also use rot!)
}, 1, 'Linear') -- with a duration of 1 beat and Linear ease.
Moves the room's camera to x
% on the x axis at beat beat
with a duration duration
and ease ease
.
Example:
mycoolroom:camx(4, 75, 1, 'OutExpo') -- at beat 4, move mycoolroom's camera's x position to 75% with a duration of 1 beat and OutExpo ease
Moves the room's camera to y
% on the y axis at beat beat
with a duration duration
and ease ease
.
Example:
mycoolroom:camy(6, 30, 0, 'OutQuad') -- at beat 6, move mycoolroom's camera's y position to 30% with a duration of 0 beats and OutQuad ease
Zooms in the room's camera to zoom
%.
Example:
mycoolroom:camzoom(8, 200, 1, 'InQuint') -- at beat 8, zoom in mycoolroom's camera to 200%.
Rotates the room's camera to rot
degrees with a duration duration
and ease ease
.
Example:
mycoolroom:camrot(3, 90, 0.5, 'OutSine') -- at beat 3, rotate mycoolroom's camera to 90 degrees with a duration of 0.5 beats and OutSine 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:
mycoolroom:cam(2, { -- at beat 2,
x = 40, -- move the room's camera to 40% on the x axis,
zoom = 200, -- zoom in the room's camera to 200%, (you can also use z!)
rot = 90, -- rotate the room's camera by 90 degrees, (you can also use r!)
}, 1, 'Linear') -- with a duration of 1 beat and Linear ease.
Flips or unflips the room horizontally based on the state
at beat beat
.
Omit state
in order to toggle it instead!
Example:
mycoolroom:xflip(2, true) -- flips horizontally at beat 2
mycoolroom:xflip(5, false) -- unflips horizontally at beat 5
mycoolroom:xflip(6) -- flips horizontally at beat 6
Flips or unflips the room vertically based on the state
at beat beat
.
Omit state
in order to toggle it instead!
Example:
mycoolroom:yflip(2, true) -- flips vertically at beat 2
mycoolroom:yflip(5, false) -- unflips vertically at beat 5
mycoolroom:yflip(6) -- flips vertically at beat 6
Sets the room's stretch mode based on the state
at beat beat
.
Omit state
in order to toggle it instead!
Example:
mycoolroom:stretchmode(2, true) -- room stretches from beat 2
mycoolroom:stretchmode(5, false) -- room no longer stretch 😔 at beat 5
mycoolroom:stretchmode(6) -- room stretch again at beat 6
Sets the room's mask to the array filenames
, with an fps fps
at beat beat
.
You can omit filenames
if you want to unset the room's mask, or you can set it to a single string if you're just using one image.
Note you still need the file extensions.
Example:
mycoolroom:mask(2, {'bg.png', 'fg.png'}, 30) -- set the room's mask to the two images 'bg.png' and 'fg.png' at beat 2
mycoolroom:mask(5, {'bg.png'}) -- set the room's mask to the single image 'bg.png' at beat 5
mycoolroom:mask(6, '') -- unset the room's mask at beat 6
mycoolroom:mask(7, 'fg.png') -- set the room's mask to the single image 'fg.png' at beat 7
mycoolroom:mask(8) -- unset the room's mask at beat 8
Sets the room's perspective to the array pos
at beat beat
.
pos
is an array of points: {x, y}
, the point's x position and y position respectively.
Points are in this order: bottom-left (default: {0, 0}), bottom-right (default: {100, 0}), top-left (default: {0, 100}), top-right (default: {100, 100}).
You can omit one coordinate from the points or an entire point.
Example:
mycoolroom:setperspective(2, { -- at beat 2,
{20, 0}, -- move the bottom-left point to 20 on the x and 0 on the y,
{}, -- don't move the bottom-right point at all,
nil, -- don't move the top-left point at all,
{80, nil} -- move the top-right point to 80 on the x and don't move it on the y,
}, 1, 'OutExpo') -- with a duration of 1 beat and OutExpo easing.
room:floatingtext(beat, text, times, x, y, size, angle, mode, showChildren, color, outlineColor, anchor, fadeOutRate)
Creates a floating text at beat beat
with the text text
at x
and y
. Its size is size
(pixels? no idea), rotated at angle
degrees, its text color is color
and outline color is outlineColor
.
anchor
dictates how it should be anchored should either be 'MiddleLeft'
, 'MiddleCenter'
, 'MiddleRight'
, 'UpperLeft'
, 'UpperCenter'
, 'UpperRight'
, 'LowerLeft'
, 'LowerCenter'
or 'LowerRight'
.
times
is an array of numbers of when the text should advance, relative to the initial floating text event.
mode
is how it should fade out: 'FadeOut'
makes it slowly fade out for fadeOutRate
beats, while 'HideAbruptly'
makes it disappear instantly after fadeOutRate
beats.
color
and outlineColor
are strings in hexadecimal format, like ff0000
.
Example:
mycoolroom:floatingtext(3.5, 'Yo!\nYo, again!\nwoo', {1, 3}, 50, 50, 16, 0, 'FadeOut', true, 'ff0000', '0000ff', 'MiddleCenter', 2)
-- at beat 3.5, make a floating text at 50x 50y, with a size of 16 and 0 rotation, and have it advance after 1 beat to 'Yo, again!' and then, 2 beats later (3 beats after the initial event, 2 beats after the previous advance) advance to 'woo'
-- additionally, text color is red ('ff0000') and outline color is blue ('0000ff')
Set the room's theme to theme
, with variant variant
at beat beat
.
A theme may have various variants, and one must be specified in case it does.
Additionally, some themes include Paint Row effects in themselves - in which case, skipPaintEffects
can be set to true
to avoid them being run.
-
'Intimate'
:'Standard'
,'Simple'
-
'Insomniac'
:'Day'
,'Night'
-
'Crosses'
:'Straight'
,'Falling'
-
'CubesFalling'
:'Standard'
,'NiceBlue'
-
'Rooftop'
:'Standard'
,'Summer'
,'Autumn'
-
'Sky'
:'Day'
,'Night'
-
'CoffeeShop'
:'Day'
,'Night'
-
'Garden'
:'Day'
,'Night'
-
'Train'
:'Day'
,'Night'
-
'Desert'
:'Day'
,'Night'
-
'HospitalWard'
:'Day'
,'Night'
-
'ColeWard'
:'Night'
,'Sunrise'
-
'Skyline'
:'Pink'
,'Blue'
-
'FloatingHeart'
:'Standard'
,'WithCubes'
-
'FloatingHeartBroken'
:'Standard'
,'WithCubes'
-
'Stadium'
:'Sunny'
,'Stormy'
-
'AthleteWard'
:'Day'
,'Night'
(if using themes not in the above list, the value of variant
is not taken into consideration)
Example:
mycoolroom:settheme(2, "OrientalTechno") -- set the theme to Samurai Techno at beat 2
Enable or disable the preset preset
according to state
.
Omit state
in order to toggle it instead!
More preset options later.
Example:
mycoolroom:setpreset(2, 'rain', true) -- enable rain at beat 2
mycoolroom:setpreset(4, 'rain', false) -- disable rain at beat 4
mycoolroom:setpreset(5, 'sepia') -- enable sepia at beat 5
If property
is omitted, returns whether the preset's enabled. Otherwise, returns the value of the property.
Example:
print(mycoolroom:getpreset(2.5, 'rain')) -- print whether or not the rain preset active at beat 2.5
print(mycoolroom:getpreset(3, 'rain', 'intensity')) -- print the rain preset's intensity at beat 3
Enable or disable the 'Sepia' preset according to state
.
Omit state
to toggle it instead!
Can also be applied on-top.
Example:
mycoolroom:sepia(2, true)
Enable or disable the 'VHS' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:vhs(2, true)
Enable or disable the 'Silhouettes on Heartbeat' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:silhouettesonhbeat(2, true)
Enable or disable the 'Vignette' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:vignette(2, true)
Enable or disable the 'Vignette Flicker' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:vignetteflicker(2, true)
Enable or disable the 'Colourful Shockwaves' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:colourfulshockwaves(2, true)
Enable or disable the 'Bass Drop on Hit' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:bassdroponhit(2, true)
Enable or disable the 'Shake on Heartbeat' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:shakeonheartbeat(2, true)
Enable or disable the 'Shake on Hit' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:shakeonhit(2, true)
Enable or disable the 'Screen Tile 2x2' preset according to state
.
Omit state
to toggle it instead!
Can also be applied on-top.
Example:
mycoolroom:tile2(2, true)
Enable or disable the 'Screen Tile 3x3' preset according to state
.
Omit state
to toggle it instead!
Can also be applied on-top.
Example:
mycoolroom:tile3(2, true)
Enable or disable the 'Screen Tile 4x4' preset according to state
.
Omit state
to toggle it instead!
Can also be applied on-top.
Example:
mycoolroom:tile4(2, true)
Enable or disable the 'Vertical Light Strip' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:lightstripvert(2, true)
Enable or disable the 'Horizontal Screen Scroll + VHS' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:screenscrollx(2, true)
Enable or disable the 'Vertical Screen Scroll + VHS' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:screenscrolly(2, true)
Enable or disable the 'Row Glow White' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:rowglowwhite(2, true)
Enable or disable the 'Row Outline' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:rowoutline(2, true)
Enable or disable the 'Row Silhouette Glow' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:rowsilhouetteglow(2, true)
Enable or disable the 'Row Shadow' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:rowshadow(2, true)
Enable or disable the 'Row All White' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:rowallwhite(2, true)
Enable or disable the 'Row Plain' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:rowplain(2, true)
Enable or disable the 'Horizontal Screen Scroll' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:screenscrollxsansvhs(2, true)
Enable or disable the 'Vertical Screen Scroll' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:screenscrollysansvhs(2, true)
Enable or disable the 'Cutscene Mode' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:cutscene(2, true)
Enable or disable the 'Blackout' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:blackout(2, true)
Enable or disable the 'Noise' preset according to state
.
Omit state
to toggle it instead!
Can also be applied on-top.
Example:
mycoolroom:noise(2, true)
Enable or disable the 'Glitch Obstruction' preset according to state
.
Omit state
to toggle it instead!
Can also be applied on-top.
Example:
mycoolroom:glitchobstruction(2, true)
Enable or disable the 'Matrix' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:matrix(2, true)
Enable or disable the 'Confetti' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:confetti(2, true)
Enable or disable the 'Falling Petals' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:fallingpetals(2, true)
Enable or disable the 'Falling Petals Instant' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:fallingpetalsinstant(2, true)
Enable or disable the 'Falling Petals Snow' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:fallingpetalssnow(2, true)
Enable or disable the 'Snow' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:snow(2, true)
Enable or disable the 'Orange Bloom' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:orangebloom(2, true)
Enable or disable the 'Blue Bloom' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:bluebloom(2, true)
Enable or disable the 'Hall of Mirrors' preset according to state
.
Omit state
to toggle it instead!
Can also be applied on-top.
Has an alias: room:hom(beat, state)
Example:
mycoolroom:hallofmirrors(2, true)
mycoolroom:hom(4, false)
Enable or disable the 'Grayscale' preset according to state
.
Omit state
to toggle it instead!
Can also be applied on-top.
Has an alias: room:grayscale(beat, state)
Example:
mycoolroom:blackandwhite(2, true)
mycoolroom:grayscale(4, false)
Enable or disable the 'Numbers above Pulses' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:numbersabovepulses(2, true)
Enable or disable the 'Funk' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:funk(2, true)
Enable or disable the 'Rain' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Example:
mycoolroom:rain(2, true, 50)
Enable or disable the 'Grain' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Example:
mycoolroom:grain(2, true, 50)
Enable or disable the 'Mosaic' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Example:
mycoolroom:mosaic(2, true, 50, 2, 'OutExpo')
Enable or disable the 'Bloom' preset according to state
, with a threshold of threshold
, intensity
intensity and color
color.
Omit state
to toggle it instead!
Color is a string in hexadecimal format, like '000000'
.
Example:
mycoolroom:bloom(2, true, 0.3, 2, '000000')
Enable or disable the 'Screen Waves' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Example:
mycoolroom:screenwaves(2, true, 50, 1, 'InOutQuint')
Enable or disable the 'Drawing' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Example:
mycoolroom:drawing(2, true, 50, 1, 'InOutQuint')
Enable or disable the 'JPEG' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Example:
mycoolroom:jpeg(2, true, 50, 1, 'InOutQuint')
Enable or disable the 'Custom Screen Tile' preset according to state
, with floatX
horizontal tiles and floatY
vertical tiles.
Omit state
to toggle it instead!
Can be applied on-top.
Has an alias, room:screentile
.
Example:
mycoolroom:tilen(2, true, 2, 3)
mycoolroom:screentile(4, false, 2, 3)
Enable or disable the 'Custom Screen Scroll' preset according to state
, scrolling at the speed of floatX
horizontally and floatY
vertically.
Omit state
to toggle it instead!
Can be applied on-top.
Has an alias, room:screenscroll
.
Example:
mycoolroom:customscreenscroll(2, true, 2, 3)
mycoolroom:screenscroll(4, false, 2, 3)
Enable or disable the 'Aberration' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Example:
mycoolroom:aberration(2, true, 75, 2, 'InExpo')
Enable or disable the 'Blizzard' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Example:
mycoolroom:blizzard(2, true, 75, 2, 'InExpo')
Enable or disable the 'Wavy Rows' preset according to state
, with an amplitude of amplitude
, with a duration of duration
beats. Additionally, sets the frequency to frequency
.
Omit state
to toggle it instead!
Omit amplitude
or frequency
to not set them!
Example:
mycoolroom:wavyrows(2, true, 20, 4, 2)
Enable or disable the 'Brightness' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Can also be applied on-top.
Example:
mycoolroom:brightness(2, true, 75, 2, 'InExpo')
Enable or disable the 'Brightness' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Can also be applied on-top.
Example:
mycoolroom:contrast(2, true, 75, 2, 'InExpo')
Enable or disable the 'Brightness' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Can also be applied on-top.
Example:
mycoolroom:saturation(2, true, 75, 2, 'InExpo')
Enable or disable the 'Blur' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Example:
mycoolroom:blur(2, true, 75, 2, 'InExpo')
Enable or disable the 'Radial Blur' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Example:
mycoolroom:radialblur(2, true, 75, 2, 'InExpo')
Enable or disable the 'Dot Matrix' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Has an alias, dots
.
Example:
mycoolroom:dotmatrix(2, true, 75, 2, 'InExpo')
mycoolroom:dots(3)
Enable or disable the 'Tutorial Notes' preset according to state
, with an intensity of intensity
%, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Color is a string in hexadecimal format, like '000000'
.
Has an alias, tutorial
.
Example:
mycoolroom:tutorialnotes(2, true, 75, '00FF00', 2, 'InExpo')
mycoolroom:tutorial(3)
Enable or disable the 'Diamonds' preset according to state
, with an intensity of intensity
%, with color
color, with a duration of duration
beats and ease
ease.
Omit state
to toggle it instead!
Color is a string in hexadecimal format, like '000000'
.
Example:
mycoolroom:diamonds(2, true, 75, 'FF0000', 2, 'InExpo')
Enable or disable the 'Balloons' preset according to state
.
Omit state
to toggle it instead!
Example:
mycoolroom:balloons(2, true)
Flashes the room at beat beat
, starting at the color startcolor
with an opacity of startopacity
, transitioning to a color of endcolor
with an opacity of endopacity
for duration
beats, with ease
easing.
If bg
is true, it will flash in the background layer.
startcolor
and endcolor
are strings in hexadecimal format, like "ffffff"
, where the first two characters represent the red color, the next two represent green and the last two represent blue.
Omitting endcolor
and endopacity
will set them to startcolor
and startopacity
respectively.
Example:
mycoolroom:flash(2, 'ffffff', 100, nil, 0, 2, "InQuint", false) -- flash the room in the foreground at beat 2, starting at white with an opacity of 100 and ending at white with an opacity of 0, over 2 beats and with InQuint easing.
Pulse the room's camera at beat beat
for count
times (must be at least 1), with frequency
beats between each pulse and strength
strength.
strength
must be 0, 1 or 2.
Example:
mycoolroom:pulsecamera(2, 3, 0.5, 1) -- at beat 2, pulse the camera 3 times every 0.5 beats at a strength of 1
Shows either the left, right or both hands at beat beat
. instant
dictates whether the hand(s) show up instantly or they smoothly move into view. If align
is true, the hands will align with the room's visible area.
hand
is a string and should either be "Left"
, "Right"
or "Both"
, changing which hand is shown (or both, in the case of Both
).
Example:
mycoolroom:showhand(1, 'Left', false, true) -- at beat 1, show the left hand smoothly and align it to the room's visible area
Hides either the left, right or both hands at beat beat
. instant
dictates whether the hand(s) hide instantly or they smoothly move out of view. If align
is true, the hands will align with the room's visible area.
hand
is a string and should either be "Left"
, "Right"
or "Both"
, changing which hand is hidden (or both, in the case of Both
).
Example:
mycoolroom:hidehand(1, 'Left', false, true) -- at beat 1, hide the left hand smoothly and align it to the room's visible area
Shows/hides either the left, right or both hands if they're already hidden/shown, respectively, at beat beat
. instant
dictates whether the hand(s) show/hide instantly or they smoothly move into/out of view. If align
is true, the hands will align with the room's visible area.
hand
is a string and should either be "Left"
, "Right"
or "Both"
, changing which hand is shown/hidden (or both, in the case of Both
).
Example:
mycoolroom:togglehand(1, 'Left', false, true) -- at beat 1, show the left hand smoothly and align it to the room's visible area
mycoolroom:togglehand(2, 'Left', true, true) -- at beat 2, hide the left hand instantly and align it to the room's visible area
If bgtype
is "Image"
, sets the background image to filenames
with fps
fps, mode
content mode, filter
filter and colored color
. Additionally, if mode
is set to "Tiled"
, the background will scroll by sx
and sy
pixels per second.
If bgtype
is "Color"
, sets the background to a solid color, color
.
Valid content modes are "ScaleToFill"
, "AspectFit"
, "AspectFill"
, "Center"
and "Tiled"
.
color
is a string in hexadecimal format, like ffffffff
, where the first two characters represent red, next two represent green, next two represent blue and the last two represent the opacity.
filenames
can either be an array of strings or one string.
filter
can either be "NearestNeighbor"
or "Bilinear"
.
Example:
mycoolroom:setbg(1, {'bg.png', 'fg.png'}, 'Image', 30, 'ScaleToFill', nil, nil, 'ff0000ff') -- at beat 1, set the room's background to 'bg.png' and 'fg.png' with a fps of 30, with 'ScaleToFill' content mode and colored 'ff0000ff', or red
Sets the foreground image to filenames
with fps
fps, mode
content mode, filter
filter and colored color
. Additionally, if mode
is set to "Tiled"
, the foreground will scroll by sx
and sy
pixels per second.
Valid content modes are "ScaleToFill"
, "AspectFit"
, "AspectFill"
, "Center"
and "Tiled"
.
color
is a string in hexadecimal format, like ffffffff
, where the first two characters represent red, next two represent green, next two represent blue and last two represent the opacity.
filenames
can either be an array of strings or one string.
filter
can either be "NearestNeighbor"
or "Bilinear"
.
Example:
mycoolroom:setfg(1, {'bg.png', 'fg.png'}, 30, 'ScaleToFill', nil, nil, 'ff0000ff') -- at beat 1, set the room's foreground to 'bg.png' and 'fg.png' with a fps of 30, with 'ScaleToFill' content mode and colored 'ff0000ff', or red
At beat beat
, fade the room to opacity
opacity for duration
beats with ease
easing.
Example:
mycoolroom:fade(2, 50, 1, "OutQuint") -- at beat 2, fade the room to 50% opacity for 1 beat with OutQuint easing
At beat beat
, play a bassdrop effect with strength
strength.
strength
should be a string, either Low
, Medium
or High
, dictating the strength of the effect.
Example:
mycoolroom:bassdrop(1, 'Medium') -- at beat 1, play a medium bass drop effect
At beat beat
, play a shake effect with shakelevel
strength.
shakelevel
should be a string, either Low
, Medium
or High
, dictating the strength of the effect.
Example:
mycoolroom:shake(1, 'Medium') -- at beat 1, play a medium shake effect
Sets whether or not the room's colors are inverted at beat beat
.
Omit state
in order to toggle it instead!
Example:
mycoolroom:invertcolors(1, true) -- invert the colors at beat 1
mycoolroom:invertcolors(2, false) -- revert the colors at beat 2
mycoolroom:invertcolors(3) -- invert the colors again at beat 3
mycoolroom:invertcolors(4) -- revert the colors again at beat 4
Creates a text explosion effect at beat beat
, with the text text
, color mode mode
, direction direction
and color color
.
color
is a string in hexadecimal format, like '000000', where the first two characters represent red, next two represent green and the last two represent blue.
mode
is a string and should be either 'OneColor'
or 'Random'
.
direction
is a string and should be either 'Left'
or 'Right'
.
Example:
mycoolroom:textexplosion(1, 'Text', 'ff0000', 'OneColor', 'Right') -- create a text explosion at beat 1, each with the text `Text` and colored `ff0000`, or red, moving from the left to the right
Creates or removes a stutter effect at beat beat
, depending on action
.
action
should be either Add
or Cancel
, with Add
creating a stutter effect and Cancel
cancelling it.
sourcebeat
is the beat to stutter from.
length
is how long each loop is, in beats.
loops
is how many loops we do.
Example:
mycoolroom:stutter(2, 'Add', 1, 0.5, 4) -- create a new stutter at beat 2, with the source beat 1, length 0.5 and 4 loops
mycoolroom:stutter(3, 'Cancel', 1, 0.5, 4) -- cancel the previous stutter. note that the parameters after Cancel do not affect this in any way
Additionally, each room-specific function can be called in the form: level:function(beat, room, ...)
, where room
is the room's index and ...
are the function parameters.
For functions that can be applied on-top, they can also be called level:ontopfunction(beat, ...)
.
On-top functions: setbg
, setfg
, flash
, bassdrop
, shake
, xflip
, yflip
, floatingtext
, camx
, camy
, camzoom
, camrot
, sepia
, tile2
, tile3
, tile4
, noise
, glitchobstruction
, hallofmirrors
, hom
, blackandwhite
, grayscale
, tilen
, screentile
, customscreenscroll
, screenscroll
.
Example:
level:sepia(1, 1, true) -- enable sepia on room 2 at beat 1
level:ontopsepia(2, true) -- enable sepia on-top at beat 2
level:sepia(3, 4) -- toggle (thus, disable) sepia on-top at beat 3