Difference between revisions of "UI"
(6 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
'''Available since:''' Gideros 2023.1<br/> | '''Available since:''' Gideros 2023.1<br/> | ||
+ | === Description === | ||
+ | A UI Library for Gideros made of a plethora of widgets. | ||
+ | |||
+ | '''UI.Builder''' allows for building complex UI layouts. | ||
In order to use Gideros UI Library, you have to link or include the two following folders to your project: | In order to use Gideros UI Library, you have to link or include the two following folders to your project: | ||
Line 8: | Line 12: | ||
* '''''Library/luashaders''''' | * '''''Library/luashaders''''' | ||
The folders are available in your '''Gideros installation folder''' (UI Library depends on luashaders) | The folders are available in your '''Gideros installation folder''' (UI Library depends on luashaders) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Example === | === Example === | ||
Line 19: | Line 18: | ||
UI=UI or {} | UI=UI or {} | ||
+ | local fontfile = "fonts/OpenSans-Regular.ttf" | ||
local fontfilebold = "fonts/OpenSans-Bold.ttf" | local fontfilebold = "fonts/OpenSans-Bold.ttf" | ||
UI.Default = { | UI.Default = { | ||
− | TTF=fontfilebold, | + | TTF=fontfile, |
+ | Fonts={ | ||
+ | ["font"]={ ttf=fontfile, size=0.8 }, | ||
+ | ["font.small"]={ ttf=fontfile, size=0.5 }, | ||
+ | ["font.bold"]={ ttf=fontfilebold }, | ||
+ | } | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 67: | Line 72: | ||
[[UI.Spinner]] ''creates a Spinner widget''<br/> | [[UI.Spinner]] ''creates a Spinner widget''<br/> | ||
[[UI.Splitpane]] ''creates a Splitpane widget''<br/> | [[UI.Splitpane]] ''creates a Splitpane widget''<br/> | ||
− | UI.TabbedPane | + | [[UI.TabbedPane]] ''creates a TabbedPane widget''<br/> |
[[UI.Table]] ''creates a Table widget''<br/> | [[UI.Table]] ''creates a Table widget''<br/> | ||
[[UI.TextField]] ''creates TextField widgets''<br/> | [[UI.TextField]] ''creates TextField widgets''<br/> | ||
+ | [[UI.TimePicker]] ''creates a TimePicker widget''<br/> | ||
+ | [[UI.Toolbox]] ''creates a Toolbox widget''<br/> | ||
+ | [[UI.Tree]] ''creates a Tree widget''<br/> | ||
+ | [[UI.Viewport]] ''creates a Viewport widget''<br/> | ||
+ | [[UI.WeekSchedule]] ''creates a WeekSchedule widget''<br/> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| |
Latest revision as of 20:39, 17 October 2023
Supported platforms:
Available since: Gideros 2023.1
Description
A UI Library for Gideros made of a plethora of widgets.
UI.Builder allows for building complex UI layouts.
In order to use Gideros UI Library, you have to link or include the two following folders to your project: * Library/ui * Library/luashaders The folders are available in your Gideros installation folder (UI Library depends on luashaders)
Example
In init.lua
UI=UI or {}
local fontfile = "fonts/OpenSans-Regular.ttf"
local fontfilebold = "fonts/OpenSans-Bold.ttf"
UI.Default = {
TTF=fontfile,
Fonts={
["font"]={ ttf=fontfile, size=0.8 },
["font.small"]={ ttf=fontfile, size=0.5 },
["font.bold"]={ ttf=fontfilebold },
}
}
In your game
--UI.Style:setDefault(UI.Theme.PointCore_Base)
--UI.Style:setDefault(UI.Theme.PointCore_Red)
UI.Style:setDefault(UI.Theme.PointCore_Pink)
-- a Button
local button=UI.Button.new()
button:setDimensions(64, 48)
button:setPosition(50,50)
button:setText("Button")
function button:onWidgetAction()
print("Hello Gideros UI")
end
stage:addChild(button)
Widgets
UI.Accordion creates a UI accordion |