readme clarifications

This commit is contained in:
Michael Freno
2025-12-06 13:43:35 -05:00
parent d8e160f083
commit c2cf29eab8

View File

@@ -38,33 +38,34 @@ likely.
```lua
local FlexLove = require("FlexLove")
-- Initialize with base scaling and theme
-- (Optional) Initialize with a theme and immediate mode
FlexLove.init({
baseScale = { width = 1920, height = 1080 },
theme = "space"
immediateMode = true -- Optional: enable immediate mode (default: false)
immediateMode = true
})
-- Create a button with flexbox layout
local button = FlexLove.new({
width = "20vw",
height = "10vh",
backgroundColor = Color.new(0.2, 0.2, 0.8, 1),
text = "Click Me",
textSize = "md",
themeComponent = "button",
onEvent = function(element, event)
print("Button clicked!")
end
})
-- In your love.update and love.draw:
function love.update(dt)
FlexLove.update(dt)
end
function love.draw()
FlexLove.draw()
FlexLove.draw(function()
-- Game content (will be blurred by backdrop blur)
local button = FlexLove.new({
width = "20vw",
height = "10vh",
backgroundColor = Color.new(0.2, 0.2, 0.8, 1),
text = "Click Me",
textSize = "md",
themeComponent = "button",
onEvent = function(element, event)
print("Button clicked!")
end
})
end, function()
-- This is drawn AFTER all GUI elements - no backdrop blur
SomeMetaComponent:draw()
end)
end
```