update syntax plans

This commit is contained in:
2026-05-01 13:04:06 +01:00
parent 0b3470d483
commit 8ef525c8f5
4 changed files with 179 additions and 142 deletions
+23
View File
@@ -0,0 +1,23 @@
window = Window.new 400, 400, title: "Button Test"
main_scene = Scene.new
default_font = Font.new "assets/DejaVuSans.ttf", 24, italic: true
text = ElementText.new "Click me!", font: default_font, position: {x: 50, y: 50}, z: 1
rect = ElementRect.new {x: 50, y: 50, w: 100, h: 25}, color: 0xFF0000, z: 0
rect.on_click do
rect.color = rect.color == 0xFF0000 ?
0x00FF00
:
0xFF0000
end
main_scene.add_element text
main_scene.add_element rect
window.add_scene :main_scene, main_scene
window.start :main_scene