-- The pieces the ActionMax port asked for, over the menu video: a text look with a font, size, -- and anchor of its own; a sprite drawn in copies (a row of coins); a crosshair on the pointer; -- the disc paused and played by rules; and pointerX in an expression. return { title = "Author test: overlay bits", players = 1, size = { w = 720, h = 480 }, layers = { { kind = "disc", file = "Singe/menuBackground.mkv", start = 100 }, { kind = "overlay" } }, vars = { coins = 3, side = "", held = 0 }, types = { title = { look = { kind = "text", text = "OVERLAY BITS", r = 255, g = 220, b = 80, font = "Singe/FreeSansBold.ttf", size = 36, anchor = "top" } }, foot = { look = { kind = "text", text = "standing on the bottom", r = 200, g = 200, b = 255, anchor = "feet" } }, mid = { look = { kind = "text", text = "", r = 255, g = 255, b = 255, anchor = "centre" } }, coins = { look = { kind = "sprite", file = "Forge/kit/coin.png", step = 40 }, vars = { copies = 3 } }, cross = { look = { kind = "box", w = 9, h = 9, r = 255, g = 80, b = 80 }, behaviours = { { kind = "pointer", player = 1 } } } }, rooms = { { name = "board", entities = { { type = "title", id = "title", x = 360, y = 10 }, { type = "foot", id = "foot", x = 360, y = 480 }, { type = "mid", id = "mid", x = 360, y = 240 }, { type = "coins", id = "coins", x = 40, y = 40 }, { type = "cross", id = "cross", x = 0, y = 0 } } } }, rules = { { note = "The coins follow the var", on = "frame", act = { { "setVar", entity = "coins", name = "copies", value = "coins" } } }, { note = "Which side the pointer is on", on = "frame", when = { { "test", expr = "pointerX(1) < 360" } }, act = { { "setVar", name = "side", value = "\"left\"" }, { "setText", entity = "mid", text = "\"pointer on the \" .. side" } } }, { note = "Or the other", on = "frame", when = { { "test", expr = "pointerX(1) >= 360" } }, act = { { "setVar", name = "side", value = "\"right\"" }, { "setText", entity = "mid", text = "\"pointer on the \" .. side" } } }, { note = "SPACE holds the disc", on = "pressed", key = "SPACE", act = { { "discPause" }, { "setVar", name = "held", value = "frame" } } }, { note = "RETURN lets it go", on = "pressed", key = "RETURN", act = { { "discPlay" } } } } }