Compare commits
8 Commits
f5608980e3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d8f67ebd27 | |||
|
|
99f467fa69 | ||
| 141a22cd9c | |||
| eb3afc11ac | |||
| d72f442de7 | |||
| 3713f45a76 | |||
| c4fc62af20 | |||
|
|
71f7776f78 |
1
.gitignore
vendored
@@ -1,5 +1,4 @@
|
||||
OverlayStats.lua
|
||||
themes/metal/
|
||||
themes/space/
|
||||
.DS_STORE
|
||||
tasks
|
||||
|
||||
@@ -63,7 +63,7 @@ local enums = utils.enums
|
||||
|
||||
---@class FlexLove
|
||||
local flexlove = Context
|
||||
flexlove._VERSION = "0.10.0"
|
||||
flexlove._VERSION = "0.10.2"
|
||||
flexlove._DESCRIPTION = "UI Library for LÖVE Framework based on flexbox"
|
||||
flexlove._URL = "https://github.com/mikefreno/FlexLove"
|
||||
flexlove._LICENSE = [[
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>FlexLöve v0.9.2 - API Reference</title>
|
||||
<title>FlexLöve v0.10.2 - API Reference</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
|
||||
<style>
|
||||
* {
|
||||
@@ -321,13 +321,15 @@
|
||||
<div class="container">
|
||||
<nav class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<h2>FlexLöve <span style="font-size: 0.6em; color: #8b949e;">v0.9.2</span></h2>
|
||||
<h2>FlexLöve <span style="font-size: 0.6em; color: #8b949e;">v0.10.2</span></h2>
|
||||
<a href="index.html">← Back to Home</a>
|
||||
|
||||
<div class="version-selector">
|
||||
<select id="version-dropdown" onchange="window.versionNavigate(this.value)">
|
||||
<option value="">📚 Switch Version</option>
|
||||
<option value="current">v0.9.2 (Latest)</option>
|
||||
<option value="current">v0.10.2 (Latest)</option>
|
||||
<option value="v0.10.0">v0.10.0</option>
|
||||
<option value="v0.9.2">v0.9.2</option>
|
||||
<option value="v0.9.0">v0.9.0</option>
|
||||
<option value="v0.8.0">v0.8.0</option>
|
||||
<option value="v0.7.3">v0.7.3</option>
|
||||
|
||||
@@ -285,7 +285,7 @@ cp FlexLove/FlexLove.lua your-project/</code></pre>
|
||||
|
||||
<div class="footer">
|
||||
<p>
|
||||
FlexLöve v0.10.0 | MIT License |
|
||||
FlexLöve v0.10.2 | MIT License |
|
||||
<a href="https://github.com/mikefreno/FlexLove" style="color: #58a6ff"
|
||||
>GitHub Repository</a
|
||||
>
|
||||
|
||||
3751
docs/versions/v0.10.0/api.html
Normal file
3750
docs/versions/v0.9.2/api.html
Normal file
@@ -64,6 +64,19 @@ function Context.clearFrameElements()
|
||||
end
|
||||
end
|
||||
|
||||
--- Calculate the depth (nesting level) of an element
|
||||
---@param elem Element
|
||||
---@return number
|
||||
local function getElementDepth(elem)
|
||||
local depth = 0
|
||||
local current = elem.parent
|
||||
while current do
|
||||
depth = depth + 1
|
||||
current = current.parent
|
||||
end
|
||||
return depth
|
||||
end
|
||||
|
||||
--- Sort elements by z-index (called after all elements are registered)
|
||||
function Context.sortElementsByZIndex()
|
||||
-- Sort elements by z-index (lowest to highest)
|
||||
@@ -80,7 +93,13 @@ function Context.sortElementsByZIndex()
|
||||
return z
|
||||
end
|
||||
|
||||
return getEffectiveZIndex(a) < getEffectiveZIndex(b)
|
||||
local za = getEffectiveZIndex(a)
|
||||
local zb = getEffectiveZIndex(b)
|
||||
if za ~= zb then
|
||||
return za < zb
|
||||
end
|
||||
-- Tiebreaker: deeper elements (children) sort higher
|
||||
return getElementDepth(a) < getElementDepth(b)
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -153,6 +172,7 @@ function Context.getTopElementAt(x, y)
|
||||
return nil
|
||||
end
|
||||
|
||||
local fallback = nil
|
||||
for i = #Context._zIndexOrderedElements, 1, -1 do
|
||||
local element = Context._zIndexOrderedElements[i]
|
||||
|
||||
@@ -161,11 +181,15 @@ function Context.getTopElementAt(x, y)
|
||||
if interactive then
|
||||
return interactive
|
||||
end
|
||||
return element
|
||||
-- Non-interactive element hit: remember as fallback but keep looking
|
||||
-- for interactive children/siblings at same or lower z-index
|
||||
if not fallback then
|
||||
fallback = element
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
return fallback
|
||||
end
|
||||
|
||||
--- Set the focused element (centralizes focus management)
|
||||
|
||||
@@ -2040,9 +2040,16 @@ function Element.new(props)
|
||||
self._dirty = false -- Element properties have changed, needs layout
|
||||
self._childrenDirty = false -- Children have changed, needs layout
|
||||
|
||||
-- Debug draw: assign a stable random color for element boundary visualization
|
||||
-- Uses a vibrant HSL-based color to ensure good visibility against any background
|
||||
local hue = math.random() * 360
|
||||
-- Debug draw: assign a deterministic color for element boundary visualization
|
||||
-- Uses a hash of the element ID to produce a stable hue, so colors don't flash each frame
|
||||
local function hashStringToHue(str)
|
||||
local hash = 5381
|
||||
for i = 1, #str do
|
||||
hash = ((hash * 33) + string.byte(str, i)) % 360
|
||||
end
|
||||
return hash
|
||||
end
|
||||
local hue = hashStringToHue(self.id or tostring(self))
|
||||
local function hslToRgb(h)
|
||||
local s, l = 0.9, 0.55
|
||||
local c = (1 - math.abs(2 * l - 1)) * s
|
||||
|
||||
BIN
themes/metal/Bar/Bar01a.9.png
Normal file
|
After Width: | Height: | Size: 161 B |
BIN
themes/metal/Bar/Bar02a.9.png
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
themes/metal/Bar/Bar03a.9.png
Normal file
|
After Width: | Height: | Size: 161 B |
BIN
themes/metal/Bar/Bar04a.9.png
Normal file
|
After Width: | Height: | Size: 173 B |
BIN
themes/metal/BarDropdown/BarDropdown01a.9.png
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
themes/metal/BarKnob/BarKnob01a.9.png
Normal file
|
After Width: | Height: | Size: 103 B |
BIN
themes/metal/BarKnob/BarKnob01a.png
Normal file
|
After Width: | Height: | Size: 129 B |
BIN
themes/metal/BarKnob/BarKnob02a.9.png
Normal file
|
After Width: | Height: | Size: 117 B |
BIN
themes/metal/BarKnob/BarKnob02a.png
Normal file
|
After Width: | Height: | Size: 121 B |
BIN
themes/metal/BarKnob/BarKnob03a.9.png
Normal file
|
After Width: | Height: | Size: 99 B |
BIN
themes/metal/BarKnob/BarKnob03a.png
Normal file
|
After Width: | Height: | Size: 110 B |
BIN
themes/metal/BarKnob/BarKnob04a.9.png
Normal file
|
After Width: | Height: | Size: 120 B |
BIN
themes/metal/BarKnob/BarKnob04a.png
Normal file
|
After Width: | Height: | Size: 138 B |
BIN
themes/metal/BarKnobDropdown/BarKnobDropdown01a.9.png
Normal file
|
After Width: | Height: | Size: 111 B |
BIN
themes/metal/BarKnobToggle/BarKnobToggle01a.9.png
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
themes/metal/BarToggle/BarToggle01a.9.png
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
themes/metal/Button/Button01a_1.9.png
Normal file
|
After Width: | Height: | Size: 258 B |
BIN
themes/metal/Button/Button01a_2.9.png
Normal file
|
After Width: | Height: | Size: 249 B |
BIN
themes/metal/Button/Button01a_3.9.png
Normal file
|
After Width: | Height: | Size: 258 B |
BIN
themes/metal/Button/Button01a_4.9.png
Normal file
|
After Width: | Height: | Size: 251 B |
BIN
themes/metal/Button/Button02a_1.9.png
Normal file
|
After Width: | Height: | Size: 266 B |
BIN
themes/metal/Button/Button02a_2.9.png
Normal file
|
After Width: | Height: | Size: 262 B |
BIN
themes/metal/Button/Button02a_3.9.png
Normal file
|
After Width: | Height: | Size: 264 B |
BIN
themes/metal/Button/Button02a_4.9.png
Normal file
|
After Width: | Height: | Size: 265 B |
BIN
themes/metal/Cursor/Cursor01a.png
Normal file
|
After Width: | Height: | Size: 180 B |
BIN
themes/metal/Cursor/Cursor01b.png
Normal file
|
After Width: | Height: | Size: 151 B |
BIN
themes/metal/Cursor/Cursor02a.png
Normal file
|
After Width: | Height: | Size: 206 B |
BIN
themes/metal/Cursor/Cursor02b.png
Normal file
|
After Width: | Height: | Size: 151 B |
BIN
themes/metal/Cursor/Cursor03a.png
Normal file
|
After Width: | Height: | Size: 180 B |
BIN
themes/metal/Cursor/Cursor03b.png
Normal file
|
After Width: | Height: | Size: 143 B |
BIN
themes/metal/Filler/FillerBlue01a.png
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
themes/metal/Filler/FillerCyan01a.png
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
themes/metal/Filler/FillerGreen01a.png
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
themes/metal/Filler/FillerGrey01a.png
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
themes/metal/Filler/FillerOrange01a.png
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
themes/metal/Filler/FillerRed01a.png
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
themes/metal/Filler/FillerWhite01a.png
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
themes/metal/Filler/FillerYellow01a.png
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
themes/metal/Frame/Frame01a.9.png
Normal file
|
After Width: | Height: | Size: 525 B |
BIN
themes/metal/Frame/Frame01b.9.png
Normal file
|
After Width: | Height: | Size: 368 B |
BIN
themes/metal/Frame/Frame02a.9.png
Normal file
|
After Width: | Height: | Size: 331 B |
BIN
themes/metal/Frame/Frame02b.9.png
Normal file
|
After Width: | Height: | Size: 256 B |
BIN
themes/metal/Frame/Frame03a.9.png
Normal file
|
After Width: | Height: | Size: 378 B |
BIN
themes/metal/Frame/Frame03b.9.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
themes/metal/Guide.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
themes/metal/IconConfirm/IconConfirm01a.png
Normal file
|
After Width: | Height: | Size: 96 B |
BIN
themes/metal/IconConfirm/IconConfirm02a.png
Normal file
|
After Width: | Height: | Size: 127 B |
BIN
themes/metal/IconConfirm/IconConfirm03a.png
Normal file
|
After Width: | Height: | Size: 119 B |
38
themes/metal/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
This image pack is not fully converted to 9 patch, it is being done as I have a need for.
|
||||
- [x] Bar
|
||||
- [x] BarDropdown
|
||||
- [x] BarKnob
|
||||
- [x] BarKnobDropdown
|
||||
- [x] BarToggle
|
||||
- [x] Button
|
||||
- [ ] Cursor
|
||||
- [ ] Filler
|
||||
- [x] Frame
|
||||
- [ ] IconConfirm
|
||||
- [x] Select
|
||||
- [ ] Slot
|
||||
- [x] TextField
|
||||
- [ ] Toggle
|
||||
|
||||
You can compare the BarKnob's for a before and after for the 9 patch additions
|
||||
|
||||
This theme is a part of the [Complete UI Essential Pack](https://crusenho.itch.io/complete-ui-essential-pack) by [Crusenho](https://crusenho.itch.io/)
|
||||
This theme is governed by the following license:
|
||||
|
||||
Attribution 4.0 International (CC BY 4.0)
|
||||
|
||||
You are free to:
|
||||
|
||||
Share — copy and redistribute the material in any medium or format for any purpose, even commercially.
|
||||
|
||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||
|
||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
||||
|
||||
Under the following terms:
|
||||
|
||||
Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
|
||||
|
||||
No additional restrictions - You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
||||
|
||||
License Link: <https://creativecommons.org/licenses/by/4.0/>
|
||||
BIN
themes/metal/Select/Select01a.9.png
Normal file
|
After Width: | Height: | Size: 281 B |
BIN
themes/metal/Slot/Slot01a.png
Normal file
|
After Width: | Height: | Size: 295 B |
BIN
themes/metal/Slot/Slot01b.png
Normal file
|
After Width: | Height: | Size: 281 B |
BIN
themes/metal/Slot/Slot01c.png
Normal file
|
After Width: | Height: | Size: 297 B |
BIN
themes/metal/Slot/Slot02a.png
Normal file
|
After Width: | Height: | Size: 315 B |
BIN
themes/metal/Slot/Slot02b.png
Normal file
|
After Width: | Height: | Size: 309 B |
BIN
themes/metal/Slot/Slot02c.png
Normal file
|
After Width: | Height: | Size: 315 B |
BIN
themes/metal/TextField/Textfield01a.9.png
Normal file
|
After Width: | Height: | Size: 299 B |
BIN
themes/metal/TextField/Textfield01b.9.png
Normal file
|
After Width: | Height: | Size: 274 B |
BIN
themes/metal/Toggle/Toggle01a.9.png
Normal file
|
After Width: | Height: | Size: 199 B |
BIN
themes/metal/Toggle/Toggle01a.png
Normal file
|
After Width: | Height: | Size: 281 B |
BIN
themes/metal/Toggle/Toggle01b.png
Normal file
|
After Width: | Height: | Size: 238 B |
BIN
themes/metal/Toggle/Toggle02a.png
Normal file
|
After Width: | Height: | Size: 304 B |
BIN
themes/metal/Toggle/Toggle02b.png
Normal file
|
After Width: | Height: | Size: 255 B |
BIN
themes/metal/Toggle/Toggle03a_1.png
Normal file
|
After Width: | Height: | Size: 219 B |
BIN
themes/metal/Toggle/Toggle03a_2.png
Normal file
|
After Width: | Height: | Size: 216 B |
BIN
themes/metal/Toggle/Toggle03a_3.png
Normal file
|
After Width: | Height: | Size: 216 B |
BIN
themes/metal/Toggle/Toggle03a_4.png
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
themes/metal/Toggle/Toggle03b_1.png
Normal file
|
After Width: | Height: | Size: 204 B |
BIN
themes/metal/Toggle/Toggle03b_2.png
Normal file
|
After Width: | Height: | Size: 200 B |
BIN
themes/metal/Toggle/Toggle03b_3.png
Normal file
|
After Width: | Height: | Size: 200 B |
BIN
themes/metal/Toggle/Toggle03b_4.png
Normal file
|
After Width: | Height: | Size: 227 B |
BIN
themes/metal/Toggle/Toggle04a_1.png
Normal file
|
After Width: | Height: | Size: 255 B |
BIN
themes/metal/Toggle/Toggle04a_2.png
Normal file
|
After Width: | Height: | Size: 261 B |
BIN
themes/metal/Toggle/Toggle04a_3.png
Normal file
|
After Width: | Height: | Size: 261 B |
BIN
themes/metal/Toggle/Toggle04a_4.png
Normal file
|
After Width: | Height: | Size: 279 B |
BIN
themes/metal/Toggle/Toggle04b_1.png
Normal file
|
After Width: | Height: | Size: 231 B |
BIN
themes/metal/Toggle/Toggle04b_2.png
Normal file
|
After Width: | Height: | Size: 217 B |
BIN
themes/metal/Toggle/Toggle04b_3.png
Normal file
|
After Width: | Height: | Size: 217 B |
BIN
themes/metal/Toggle/Toggle04b_4.png
Normal file
|
After Width: | Height: | Size: 253 B |
BIN
themes/metal/Toggle/Toggle05a.png
Normal file
|
After Width: | Height: | Size: 297 B |
BIN
themes/metal/Toggle/Toggle05b.png
Normal file
|
After Width: | Height: | Size: 251 B |
BIN
themes/metal/Toggle/Toggle06a.png
Normal file
|
After Width: | Height: | Size: 197 B |
BIN
themes/metal/Toggle/Toggle06b.png
Normal file
|
After Width: | Height: | Size: 210 B |
BIN
themes/metal/Toggle/Toggle07a_1.png
Normal file
|
After Width: | Height: | Size: 200 B |
BIN
themes/metal/Toggle/Toggle07a_2.png
Normal file
|
After Width: | Height: | Size: 194 B |
BIN
themes/metal/Toggle/Toggle07a_3.png
Normal file
|
After Width: | Height: | Size: 194 B |
BIN
themes/metal/Toggle/Toggle07a_4.png
Normal file
|
After Width: | Height: | Size: 222 B |
BIN
themes/metal/Toggle/Toggle08a_1.png
Normal file
|
After Width: | Height: | Size: 223 B |
BIN
themes/metal/Toggle/Toggle08a_2.png
Normal file
|
After Width: | Height: | Size: 226 B |
BIN
themes/metal/Toggle/Toggle08a_3.png
Normal file
|
After Width: | Height: | Size: 226 B |
BIN
themes/metal/Toggle/Toggle08a_4.png
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
themes/metal/Toggle/ToggleBar01a.png
Normal file
|
After Width: | Height: | Size: 158 B |