Graphics Window
Opens a window and draws a rectangle that follows the mouse, using the Love2D-style Shine2D native package. Shows how Saule calls into a dynamically-loaded Rust library.
Run it
Section titled “Run it”git clone https://github.com/lauriszz123/saule.gitcd saule/examples/toyingsaule runsaule.config
Section titled “saule.config”name: "toying"version: "0.1.0"entry: "src/main.sau"src_dirs: ["src"]dependencies: ["lauriszz123@saule-shine:main"]min_saule_version: "26.1"src/main.sau
Section titled “src/main.sau”from "shine" import *
class Main static fn main() Window.create(800, 600, "Sau Engine") while Window.isOpen() do Window.pollEvents()
Graphics.clear(0.0, 0.0, 0.0)
local x, y = Mouse.getPos()
Graphics.rectangle("fill", x, y, 50.0, 50.0)
Graphics.present() end endend