Difference between revisions of "AeroGUI"

m (i18n)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#set:Name=AeroGUI Library}}
+
== Still under development. Coming soon. ==
{{#set:LOVE Version=0.8.0}}
 
{{#set:Description=Easy-to-use system to create basic interfaces.}}
 
 
 
= Still under development. Coming soon. =
 
 
 
 
AeroGUI is a Love2D GUI library developed by [[User:Aeromcfly]].
 
AeroGUI is a Love2D GUI library developed by [[User:Aeromcfly]].
  
Line 42: Line 37:
 
Object.AlignY = "center"
 
Object.AlignY = "center"
 
</source>
 
</source>
 +
 +
 +
 +
== Functions (love.gui) ==
 +
 +
==== love.gui.draw() ====
 +
<blockquote>
 +
Updates and draws GUI objects. Essential for GUI system to work.<br/>
 +
Returns nil
 +
=== Example ===
 +
<source lang="lua">
 +
function love.draw()
 +
  -- All code here
 +
  love.gui.draw()
 +
end
 +
</source>
 +
</blockquote>
 +
 +
==== love.gui.create(string Class [, GuiObject Screen]) ====
 +
<blockquote>
 +
Creates a new GuiObject<br/>
 +
<b>Class:</b> The object's class (e.i. "Screen")<br/>
 +
<b>Screen:</b> An existing Screen object<br/>
 +
Returns GuiObject
 +
=== Example ===
 +
<source lang="lua">
 +
local Obj = love.gui.create("Frame")
 +
</source>
 +
</blockquote>
 +
 +
==== love.gui.get(name) ====
 +
<blockquote>
 +
Returns GuiObject with named 'name' if it exists
 +
=== Example ===
 +
<source lang="lua">
 +
local Obj = love.gui.get("MyObject")
 +
if (Obj) then
 +
-- ...
 +
end
 +
</source>
 +
</blockquote>
 +
 +
==== love.gui.clear() ====
 +
<blockquote>
 +
Deletes all GuiObjects<br/>
 +
Returns nil
 +
=== Example ===
 +
<source lang="lua">
 +
love.gui.clear()
 +
</source>
 +
</blockquote>
 +
  
 
== Objects ==
 
== Objects ==
Line 127: Line 174:
 
|0
 
|0
 
|}
 
|}
 +
 +
{{#set:Name=AeroGUI Library}}
 +
{{#set:LOVE Min Version=0.8.0}}
 +
{{#set:Description=Easy-to-use system to create basic interfaces.}}
 +
{{#set:Keyword=GUI}}
 +
[[Category:Libraries]]
 +
== Other Languages ==
 +
{{i18n|AeroGUI}}

Latest revision as of 00:54, 16 December 2019

Still under development. Coming soon.

AeroGUI is a Love2D GUI library developed by User:Aeromcfly.


Enumerators

Under table GuiEnum

    GuiEnum
    • AlignX
      • Left
      • Right
      • Center
    • AlignY
      • Top
      • Bottom
      • Center

Example

Object.AlignX = GuiEnum.AlignX.Left
Object.AlignY = GuiEnum.AlignY.Center

-- Can also be written by the values of the enums directly:

Object.AlignX = "left"
Object.AlignY = "center"


Functions (love.gui)

love.gui.draw()

Updates and draws GUI objects. Essential for GUI system to work.
Returns nil

Example

function love.draw()
   -- All code here
   love.gui.draw()
end

love.gui.create(string Class [, GuiObject Screen])

Creates a new GuiObject
Class: The object's class (e.i. "Screen")
Screen: An existing Screen object
Returns GuiObject

Example

local Obj = love.gui.create("Frame")

love.gui.get(name)

Returns GuiObject with named 'name' if it exists

Example

local Obj = love.gui.get("MyObject")
if (Obj) then
-- ...
end

love.gui.clear()

Deletes all GuiObjects
Returns nil

Example

love.gui.clear()


Objects

Locked properties are read-only. Trying to set a new value to them will raise an error.

Screen

Screen objects act as rendering places for GUI objects. Screens are not actually seen. Any object whose 'Screen' property is set to a Screen object will scale itself based on the Screen's position and size.

Property Locked Type Description Default
Class TRUE string Class name Class name
Name FALSE string Object name (class)_(index)
Visible FALSE boolean Whether or not the object is drawn on screen true
Position FALSE UDim2 Position of the object drawn UDim2.new()
Size FALSE UDim2 Size of the object drawn UDim2.new(1,0,1,0)
AbsolutePosition TRUE Vector2 Actual position of object drawn Vector2.new()
AbsoluteSize TRUE Vector2 Actual size of object drawn Vector2.new()
AlignX FALSE GuiEnum AlignX Horizontal alignment of object GuiEnum.AlignX.Left
AlignY FALSE GuiEnum AlignY Vertical alignment of object GuiEnum.AlignY.Top
Screen FALSE GuiObject Screen The Screen this object renders to (Optional for Screen objects) screen (argument)
ZIndex FALSE float Draw layer of object (draw operations simply sorted by this number) 0
ZIndexLast TRUE float Used to check for changes in ZIndex 0

Other Languages