readme clarifications
This commit is contained in:
25
README.md
25
README.md
@@ -38,14 +38,19 @@ 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
|
||||
function love.update(dt)
|
||||
FlexLove.update(dt)
|
||||
end
|
||||
|
||||
function love.draw()
|
||||
FlexLove.draw(function()
|
||||
-- Game content (will be blurred by backdrop blur)
|
||||
local button = FlexLove.new({
|
||||
width = "20vw",
|
||||
height = "10vh",
|
||||
@@ -57,14 +62,10 @@ local button = FlexLove.new({
|
||||
print("Button clicked!")
|
||||
end
|
||||
})
|
||||
|
||||
-- In your love.update and love.draw:
|
||||
function love.update(dt)
|
||||
FlexLove.update(dt)
|
||||
end
|
||||
|
||||
function love.draw()
|
||||
FlexLove.draw()
|
||||
end, function()
|
||||
-- This is drawn AFTER all GUI elements - no backdrop blur
|
||||
SomeMetaComponent:draw()
|
||||
end)
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user