screen, flash, vignette¶
Colours over the whole picture: a flash that fades by itself, a colour that stays (a cut to black, a red tint), and a dark vignette around the edges. Cheap, quick, and great for big moments.
How to use it
Always there. All three are drawn over the playfield and the world, under the texts and pictures on the
"top" layer.
flashis meant to fade: set its alpha high, tween it to 0.screenstays until you change it - fades to black, a white-out, a tint.vignettedarkens (or tints) the edges.
Shortcuts: flash, fadeOut / fadeIn.
Psych: cameraFlash, cameraFade · Kade: flashCamera
Example code¶
-- A red flash on the drop, then a slow fade to black over the last bar.
flash.color = #FF3040
flash.alpha = 0.8
tween(flash.alpha, 0, beats(1))
after(beats(28), function()
screen.color = #000000
tween(screen.alpha, 1, beats(4))
end)
Properties¶
| Property | Kind | Default | |
|---|---|---|---|
| screen.color | colour | #FFFFFF |
The colour that stays over everything. |
| screen.alpha | number | 0 |
Its opacity: 0 = not there, 1 = the whole picture in that colour. |
| flash.color | colour | #FFFFFF |
The flash's colour. |
| flash.alpha | number | 0 |
The flash's opacity. Set it high and tween it to 0 - the game doesn't fade it by itself. |
| vignette.color | colour | #000000 |
The colour of the edges. |
| vignette.alpha | number | 0 |
How strong the edges are: 0 = none, 1 = deep. |
| screen.width | number, read | 0 |
The playfield's width in pixels - the canvas the HUD and texts are laid out on, not the … |
| screen.height | number, read | 0 |
The playfield's height in pixels: 480 for a 16:9 window or a narrower one, less for a … |
screen.color¶
colour screen.color = #FFFFFF
The colour that stays over everything.
screen.alpha¶
number screen.alpha = 0
Its opacity: 0 = not there, 1 = the whole picture in that colour.
Note
The song's end keeps it - a song can end on black. The results are drawn over it.
flash.color¶
colour flash.color = #FFFFFF
The flash's colour.
flash.alpha¶
number flash.alpha = 0
The flash's opacity. Set it high and tween it to 0 - the game doesn't fade it by itself.
vignette.color¶
colour vignette.color = #000000
The colour of the edges.
vignette.alpha¶
number vignette.alpha = 0
How strong the edges are: 0 = none, 1 = deep.
screen.width¶
number screen.width = 0
The playfield's width in pixels - the canvas the HUD and texts are laid out on, not the window's pixels: 853 for a 16:9 window or a wider one, less for a narrower window (it keeps its height then, so the notes don't shrink).
screen.height¶
number screen.height = 0
The playfield's height in pixels: 480 for a 16:9 window or a narrower one, less for a wider window.