Updated Frames (and Screens) (markdown)

Robert Jelic
2022-03-28 20:27:07 +02:00
parent c44db67add
commit c9a96ebf26

@@ -17,7 +17,7 @@ The same as screen, but it will have a parent frame
frame:addFrame("myFirstFrame")
````
**args:** string identifaction id. if you create 2 frames with the same id, the second one will return nil<br>
**returns:** a new frame object
**returns:** a new frame object<br>
Example:
````lua
local aScreen = screen.new("myFirstScreen")
@@ -29,7 +29,7 @@ Changes the title from a frame or screen
frame:setTitle("My first Frame!")
````
**args:** string text<br>
**returns:** the frame object
**returns:** the frame object<br>
Example:
````lua
local aScreen = screen.new("myFirstScreen")
@@ -48,7 +48,7 @@ Sets the title alignment
local aScreen = screen.new("myFirstScreen"):setTitle("My first Frame!"):setTitleAlign("right")
````
**args:** string text - possible values: "left", "center", "right"<br>
**returns:** the frame object
**returns:** the frame object<br>
@@ -58,7 +58,7 @@ Changes the position relative to its parent frame
local aScreen = screen.new("myFirstScreen"):setPosition(2,3)
````
**args:** int x, int y<br>
**returns:** the frame object
**returns:** the frame object<br>
@@ -68,7 +68,7 @@ Changes the background color from the frame
local aScreen = screen.new("myFirstScreen"):setBackground(colors.lightGray)
````
**args:** int color<br>
**returns:** the frame object
**returns:** the frame object<br>
# setForeground
Changes the text color from the frame
@@ -76,7 +76,7 @@ Changes the text color from the frame
local aScreen = screen.new("myFirstScreen"):setForeground(colors.black)
````
**args:** int color<br>
**returns:** the frame object
**returns:** the frame object<br>
# setSize
Changes the frame size
@@ -84,7 +84,7 @@ Changes the frame size
local aScreen = screen.new("myFirstScreen"):setSize(15,5)
````
**args:** int width, int length<br>
**returns:** the frame object
**returns:** the frame object<br>
# showBar
shows/hides the bar on top where you will see the title if its active
@@ -119,8 +119,8 @@ shows the frame on the screen
````lua
local aScreen = screen.new("myFirstScreen"):show()
````
**args:** -
**returns:** the frame object
**args:** -<br>
**returns:** the frame object<br>
# hide
hides the frame
@@ -153,7 +153,7 @@ aScreen:addButton("myFirstButton")
local aButton = aScreen:getObject("myFirstButton")
````
**args:** the id of the created object (has to be a child from the frame<br>
**returns:** object or nil
**returns:** object or nil<br>
# removeObject
removes the object with the id
@@ -163,7 +163,7 @@ aScreen:addButton("myFirstButton")
aScreen:removeObject("myFirstButton")
````
**args:** the id of the created object (has to be a child from the frame<br>
**returns:** object or nil
**returns:** object or nil<br>
# setFocusedElement
changes the currently focused element
@@ -172,8 +172,8 @@ local aScreen = screen.new("myFirstScreen")
local aButton = aScreen:addButton("myFirstButton")
aScreen:setFocusedElement(aButton)
````
**args:** the object you want to set as focus, has to be a children
**returns:** the frame object
**args:** the object you want to set as focus, has to be a children<br>
**returns:** the frame object<br>
# removeFocusedElement
removes the focus of the currently focused element
````lua
@@ -181,8 +181,8 @@ local aScreen = screen.new("myFirstScreen")
local aButton = aScreen:addButton("myFirstButton")
aScreen:removeFocusedElement(aButton)
````
**args:** the object you want to set as focus, has to be a children
**returns:** the frame object
**args:** the object you want to set as focus, has to be a children<br>
**returns:** the frame object<br>
# getFocusedElement
gets the currently focused element