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