Room related functions - DPS2004/Doctor-s-Notepad GitHub Wiki

The functions on this page are available by loading the room.lua extension. It is loaded by default.

level:setuprooms(beat)

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!

level:reorderrooms(beat, r1, r2, r3, r4)

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

level:getroom(index)

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.

level:parseroom(room, returntable)

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!

room:movex(beat, x, duration, ease)

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

room:movey(beat, y, duration, 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

room:movesx(beat, x, duration, 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.

room:movesy(beat, y, duration, 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.

room:rotate(beat, rot, duration, 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.

room:movepx(beat, x, duration, 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

room:movepy(beat, y, duration, 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

room:move(beat, p, duration, 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.

room:camx(beat, x, duration, 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

room:camy(beat, y, duration, 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

room:camzoom(beat, zoom, duration, 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%.

room:camrot(beat, rot, duration, ease)

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.

room:cam(beat, p, duration, 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.

room:xflip(beat, state)

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

room:yflip(beat, state)

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

room:stretchmode(beat, state)

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

room:mask(beat, filenames, fps)

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

room:setperspective(beat, pos, duration, ease)

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')

room:settheme(beat, theme)

Set the room's theme to theme at beat beat.

Example:

mycoolroom:settheme(2, "OrientalTechno") -- set the theme to Samurai Techno at beat 2

room:setpreset(beat, preset, state)

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

room:getpreset(beat, preset, property)

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

room:sepia(beat, state)

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)

room:vhs(beat, state)

Enable or disable the 'VHS' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:vhs(2, true)

room:silhouettesonhbeat(beat, state)

Enable or disable the 'Silhouettes on Heartbeat' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:silhouettesonhbeat(2, true)

room:vignette(beat, state)

Enable or disable the 'Vignette' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:vignette(2, true)

room:vignetteflicker(beat, state)

Enable or disable the 'Vignette Flicker' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:vignetteflicker(2, true)

room:colourfulshockwaves(beat, state)

Enable or disable the 'Colourful Shockwaves' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:colourfulshockwaves(2, true)

room:bassdroponhit(beat, state)

Enable or disable the 'Bass Drop on Hit' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:bassdroponhit(2, true)

room:shakeonheartbeat(beat, state)

Enable or disable the 'Shake on Heartbeat' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:shakeonheartbeat(2, true)

room:shakeonhit(beat, state)

Enable or disable the 'Shake on Hit' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:shakeonhit(2, true)

room:tile2(beat, state)

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)

room:tile3(beat, state)

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)

room:tile4(beat, state)

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)

room:lightstripvert(beat, state)

Enable or disable the 'Vertical Light Strip' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:lightstripvert(2, true)

room:screenscrollx(beat, state)

Enable or disable the 'Horizontal Screen Scroll + VHS' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:screenscrollx(2, true)

room:screenscrolly(beat, state)

Enable or disable the 'Vertical Screen Scroll + VHS' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:screenscrolly(2, true)

room:rowglowwhite(beat, state)

Enable or disable the 'Row Glow White' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:rowglowwhite(2, true)

room:rowoutline(beat, state)

Enable or disable the 'Row Outline' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:rowoutline(2, true)

room:rowsilhouetteglow(beat, state)

Enable or disable the 'Row Silhouette Glow' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:rowsilhouetteglow(2, true)

room:rowshadow(beat, state)

Enable or disable the 'Row Shadow' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:rowshadow(2, true)

room:rowallwhite(beat, state)

Enable or disable the 'Row All White' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:rowallwhite(2, true)

room:rowplain(beat, state)

Enable or disable the 'Row Plain' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:rowplain(2, true)

room:screenscrollxsansvhs(beat, state)

Enable or disable the 'Horizontal Screen Scroll' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:screenscrollxsansvhs(2, true)

room:screenscrollysansvhs(beat, state)

Enable or disable the 'Vertical Screen Scroll' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:screenscrollysansvhs(2, true)

room:cutscene(beat, state)

Enable or disable the 'Cutscene Mode' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:cutscene(2, true)

room:blackout(beat, state)

Enable or disable the 'Blackout' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:blackout(2, true)

room:noise(beat, state)

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)

room:glitchobstruction(beat, state)

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)

room:matrix(beat, state)

Enable or disable the 'Matrix' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:matrix(2, true)

room:confetti(beat, state)

Enable or disable the 'Confetti' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:confetti(2, true)

room:fallingpetals(beat, state)

Enable or disable the 'Falling Petals' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:fallingpetals(2, true)

room:fallingpetalsinstant(beat, state)

Enable or disable the 'Falling Petals Instant' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:fallingpetalsinstant(2, true)

room:fallingpetalssnow(beat, state)

Enable or disable the 'Falling Petals Snow' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:fallingpetalssnow(2, true)

room:snow(beat, state)

Enable or disable the 'Snow' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:snow(2, true)

room:orangebloom(beat, state)

Enable or disable the 'Orange Bloom' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:orangebloom(2, true)

room:bluebloom(beat, state)

Enable or disable the 'Blue Bloom' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:bluebloom(2, true)

room:hallofmirrors(beat, state)

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)

room:blackandwhite(beat, state)

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)

room:numbersabovepulses(beat, state)

Enable or disable the 'Numbers above Pulses' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:numbersabovepulses(2, true)

room:funk(beat, state)

Enable or disable the 'Funk' preset according to state.
Omit state to toggle it instead!

Example:

mycoolroom:funk(2, true)

room:rain(beat, state, intensity, duration, ease)

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)

room:grain(beat, state, intensity, duration, ease)

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)

room:mosaic(beat, state, intensity, duration, ease)

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')

room:bloom(beat, state, threshold, intensity, color)

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')

room:screenwaves(beat, state, intensity, duration, ease)

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')

room:drawing(beat, state, intensity, duration, ease)

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')

room:jpeg(beat, state, intensity, duration, ease)

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')

room:tilen(beat, state, floatX, floatY)

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)

room:customscreenscroll(beat, state, floatX, floatY)

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)

room:aberration(beat, state, intensity, duration, ease)

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')

room:blizzard(beat, state, intensity, duration, ease)

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')

room:wavyrows(beat, state, amplitude, frequency, duration)

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)

room:flash(beat, startcolor, startopacity, endcolor, endopacity, duration, ease, bg)

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.

room:pulsecamera(beat, count, frequency, strength)

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

room:showhand(beat, hand, instant, align)

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

room:hidehand(beat, hand, instant, align)

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

room:togglehand(beat, hand, instant, align)

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

room:setbg(beat, filenames, bgtype, fps, mode, sx, sy, color, filter)

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

room:setfg(beat, filenames, fps, mode, sx, sy, color, filter)

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

room:fade(beat, opacity, duration, ease)

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

room:bassdrop(beat, strength)

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

room:shake(beat, shakelevel)

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

room:invertcolors(beat, state)

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

room:textexplosion(beat, text, color, mode, direction)

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

room:stutter(beat, action, sourcebeat, length, loops)

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

level: functions

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