fix layout
This commit is contained in:
@@ -1,85 +0,0 @@
|
|||||||
package = "flexlove"
|
|
||||||
version = "0.6.1-1"
|
|
||||||
|
|
||||||
source = {
|
|
||||||
url = "git+https://github.com/mikefreno/FlexLove.git",
|
|
||||||
tag = "v0.6.1",
|
|
||||||
}
|
|
||||||
|
|
||||||
description = {
|
|
||||||
summary = "A comprehensive UI library providing flexbox/grid layouts, theming, animations, and event handling for LÖVE2D games",
|
|
||||||
detailed = [[
|
|
||||||
FlexLöve is a lightweight, flexible GUI library for LÖVE2D that implements a
|
|
||||||
flexbox-based layout system. The goals of this project are two-fold: first,
|
|
||||||
anyone with basic CSS knowledge should be able to use this library with minimal
|
|
||||||
learning curve. Second, this library should take you from early prototyping to
|
|
||||||
production.
|
|
||||||
|
|
||||||
Features:
|
|
||||||
- Flexbox and Grid Layout systems
|
|
||||||
- Modern theming with 9-patch support
|
|
||||||
- Animations and transitions
|
|
||||||
- Image rendering with CSS-like object-fit
|
|
||||||
- Touch events and gesture recognition
|
|
||||||
- Text input with rich editing features
|
|
||||||
- Responsive design with viewport units
|
|
||||||
- Both immediate and retained rendering modes
|
|
||||||
|
|
||||||
Going this route, you will need to link the luarocks path to your project:
|
|
||||||
(for mac/linux)
|
|
||||||
```lua
|
|
||||||
package.path = package.path .. ";/Users/<username>/.luarocks/share/lua/<version>/?.lua"
|
|
||||||
package.path = package.path .. ";/Users/<username>/.luarocks/share/lua/<version>/?/init.lua"
|
|
||||||
package.cpath = package.cpath .. ";/Users/<username>/.luarocks/lib/lua/<version>/?.so"
|
|
||||||
```
|
|
||||||
]],
|
|
||||||
homepage = "https://mikefreno.github.io/FlexLove/",
|
|
||||||
license = "MIT",
|
|
||||||
maintainer = "Mike Freno",
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies = {
|
|
||||||
"lua >= 5.1",
|
|
||||||
"luautf8 >= 0.1.3",
|
|
||||||
}
|
|
||||||
|
|
||||||
build = {
|
|
||||||
type = "builtin",
|
|
||||||
modules = {
|
|
||||||
["FlexLove"] = "FlexLove.lua",
|
|
||||||
["FlexLove.modules.Animation"] = "modules/Animation.lua",
|
|
||||||
["FlexLove.modules.Blur"] = "modules/Blur.lua",
|
|
||||||
["FlexLove.modules.Calc"] = "modules/Calc.lua",
|
|
||||||
["FlexLove.modules.Color"] = "modules/Color.lua",
|
|
||||||
["FlexLove.modules.Context"] = "modules/Context.lua",
|
|
||||||
["FlexLove.modules.Element"] = "modules/Element.lua",
|
|
||||||
["FlexLove.modules.ErrorHandler"] = "modules/ErrorHandler.lua",
|
|
||||||
["FlexLove.modules.EventHandler"] = "modules/EventHandler.lua",
|
|
||||||
["FlexLove.modules.FFI"] = "modules/FFI.lua",
|
|
||||||
["FlexLove.modules.GestureRecognizer"] = "modules/GestureRecognizer.lua",
|
|
||||||
["FlexLove.modules.Grid"] = "modules/Grid.lua",
|
|
||||||
["FlexLove.modules.ImageCache"] = "modules/ImageCache.lua",
|
|
||||||
["FlexLove.modules.ImageRenderer"] = "modules/ImageRenderer.lua",
|
|
||||||
["FlexLove.modules.ImageScaler"] = "modules/ImageScaler.lua",
|
|
||||||
["FlexLove.modules.InputEvent"] = "modules/InputEvent.lua",
|
|
||||||
["FlexLove.modules.LayoutEngine"] = "modules/LayoutEngine.lua",
|
|
||||||
["FlexLove.modules.MemoryScanner"] = "modules/MemoryScanner.lua",
|
|
||||||
["FlexLove.modules.ModuleLoader"] = "modules/ModuleLoader.lua",
|
|
||||||
["FlexLove.modules.NinePatch"] = "modules/NinePatch.lua",
|
|
||||||
["FlexLove.modules.Performance"] = "modules/Performance.lua",
|
|
||||||
["FlexLove.modules.Renderer"] = "modules/Renderer.lua",
|
|
||||||
["FlexLove.modules.RoundedRect"] = "modules/RoundedRect.lua",
|
|
||||||
["FlexLove.modules.ScrollManager"] = "modules/ScrollManager.lua",
|
|
||||||
["FlexLove.modules.StateManager"] = "modules/StateManager.lua",
|
|
||||||
["FlexLove.modules.TextEditor"] = "modules/TextEditor.lua",
|
|
||||||
["FlexLove.modules.Theme"] = "modules/Theme.lua",
|
|
||||||
["FlexLove.modules.types"] = "modules/types.lua",
|
|
||||||
["FlexLove.modules.Units"] = "modules/Units.lua",
|
|
||||||
["FlexLove.modules.UTF8"] = "modules/UTF8.lua",
|
|
||||||
["FlexLove.modules.utils"] = "modules/utils.lua",
|
|
||||||
},
|
|
||||||
--copy_directories = {
|
|
||||||
--"docs",
|
|
||||||
--"examples",
|
|
||||||
--},
|
|
||||||
}
|
|
||||||
@@ -158,10 +158,8 @@ local function buildMenu()
|
|||||||
alignItems = "center",
|
alignItems = "center",
|
||||||
height = "100%",
|
height = "100%",
|
||||||
width = "100%",
|
width = "100%",
|
||||||
gap = 30,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Subtitle
|
|
||||||
FlexLove.new({
|
FlexLove.new({
|
||||||
parent = container,
|
parent = container,
|
||||||
text = "Select a profile to run:",
|
text = "Select a profile to run:",
|
||||||
@@ -169,17 +167,35 @@ local function buildMenu()
|
|||||||
textColor = FlexLove.Color.new(0.8, 0.8, 0.8, 1),
|
textColor = FlexLove.Color.new(0.8, 0.8, 0.8, 1),
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Profile list
|
local centerContainer = FlexLove.new({
|
||||||
local profileList = FlexLove.new({
|
|
||||||
parent = container,
|
parent = container,
|
||||||
width = "80%",
|
height = "100%",
|
||||||
height = "80%",
|
width = "100%",
|
||||||
|
positioning = "flex",
|
||||||
|
flexDirection = "horizontal",
|
||||||
|
justifyContent = "space-evenly",
|
||||||
|
alignItems = "flex-start",
|
||||||
|
})
|
||||||
|
|
||||||
|
FlexLove.new({
|
||||||
|
parent = centerContainer,
|
||||||
|
text = "Use arrow keys to select, ENTER to run, ESC to quit",
|
||||||
|
textSize = "lg",
|
||||||
|
textColor = FlexLove.Color.new(0.5, 0.5, 0.5, 1),
|
||||||
|
textWrap = "word",
|
||||||
|
width = "10%",
|
||||||
|
})
|
||||||
|
|
||||||
|
local profileList = FlexLove.new({
|
||||||
|
parent = centerContainer,
|
||||||
|
width = 500,
|
||||||
|
height = "100%",
|
||||||
positioning = "flex",
|
positioning = "flex",
|
||||||
flexDirection = "vertical",
|
flexDirection = "vertical",
|
||||||
gap = 10,
|
gap = 10,
|
||||||
padding = { vertical = 20, horizontal = 20 },
|
padding = { vertical = 20, horizontal = 20 },
|
||||||
overflowY = "scroll",
|
overflowY = "scroll",
|
||||||
--mode = "retained",
|
flexShrink = 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
for i, profile in ipairs(state.profiles) do
|
for i, profile in ipairs(state.profiles) do
|
||||||
@@ -187,7 +203,8 @@ local function buildMenu()
|
|||||||
local isHovered = i == state.hoveredIndex
|
local isHovered = i == state.hoveredIndex
|
||||||
local button = FlexLove.new({
|
local button = FlexLove.new({
|
||||||
parent = profileList,
|
parent = profileList,
|
||||||
width = "50%",
|
width = "90%",
|
||||||
|
margin = { left = "5%" },
|
||||||
height = 50,
|
height = 50,
|
||||||
backgroundColor = isSelected and FlexLove.Color.new(0.2, 0.4, 0.8, 1)
|
backgroundColor = isSelected and FlexLove.Color.new(0.2, 0.4, 0.8, 1)
|
||||||
or isHovered and FlexLove.Color.new(0.2, 0.2, 0.35, 1)
|
or isHovered and FlexLove.Color.new(0.2, 0.2, 0.35, 1)
|
||||||
@@ -196,7 +213,6 @@ local function buildMenu()
|
|||||||
positioning = "flex",
|
positioning = "flex",
|
||||||
justifyContent = "center",
|
justifyContent = "center",
|
||||||
alignItems = "center",
|
alignItems = "center",
|
||||||
alignSelf = "center",
|
|
||||||
z = 100,
|
z = 100,
|
||||||
padding = { horizontal = 15, vertical = 15 },
|
padding = { horizontal = 15, vertical = 15 },
|
||||||
onEvent = function(_, event)
|
onEvent = function(_, event)
|
||||||
@@ -220,17 +236,11 @@ local function buildMenu()
|
|||||||
textColor = isSelected and FlexLove.Color.new(1, 1, 1, 1) or FlexLove.Color.new(0.8, 0.8, 0.8, 1),
|
textColor = isSelected and FlexLove.Color.new(1, 1, 1, 1) or FlexLove.Color.new(0.8, 0.8, 0.8, 1),
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Instructions
|
|
||||||
FlexLove.new({
|
FlexLove.new({
|
||||||
parent = container,
|
parent = centerContainer,
|
||||||
text = "Use ↑/↓ to select, ENTER to run, ESC to quit",
|
width = "10%",
|
||||||
textSize = "md",
|
|
||||||
textColor = FlexLove.Color.new(0.5, 0.5, 0.5, 1),
|
|
||||||
margin = { top = 20 },
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Error display
|
|
||||||
if state.error then
|
if state.error then
|
||||||
local errorBox = FlexLove.new({
|
local errorBox = FlexLove.new({
|
||||||
parent = container,
|
parent = container,
|
||||||
|
|||||||
Reference in New Issue
Block a user