singe/testScripts/scene41.singe
2026-09-07 23:44:37 -05:00

37 lines
1.4 KiB
Text

-- GUI layers: testScripts/scene41.rml (styled by scene41.rcss on top of the shipped
-- Singe/gui.rcss) in a GUI the size of the overlay, over the disc. Group opacity through
-- filter: opacity() next to the per-element opacity property (the overlap of the two squares
-- must not darken in the group), a mask-image fading a panel through maskFade.png, a group
-- inside a group (nested layers), and a box-shadow without blur, which RmlUi renders through a
-- layer saved as a texture. Two screenshots, the second after the group has faded further
-- through the script.
local font = fontLoad("Singe/FreeSansBold.ttf", 24)
local frames = 0
fontSelect(font)
overlaySetResolution(discGetWidth(), discGetHeight())
local gui = guiNew(overlayGetWidth(), overlayGetHeight())
local doc = guiLoad(gui, "testScripts/scene41.rml")
function onOverlayUpdate()
frames = frames + 1
overlayClear()
colorForeground(255, 255, 255, 255)
fontPrint(10, overlayGetHeight() - 30, "scene41 frame " .. frames .. " (overlay text under the GUI)")
guiSetValue(gui, doc, "frame", "frame " .. frames)
guiDraw(gui)
if frames == 40 then
singeScreenshot()
end
if frames == 60 then
rmlui.contexts["gui0"].documents["scene41"]:GetElementById("group").style.filter = "opacity(0.25)"
end
if frames == 110 then
singeScreenshot()
end
if frames == 130 then
singeQuit()
end
return OVERLAY_UPDATED
end