Updated Frames (& Screens) (markdown)
@@ -2,9 +2,44 @@ Frames are like screens or screens are frames. Frames can be sub objects of scre
|
|||||||
|
|
||||||
Here are all possible functions you can use with screens and frames:
|
Here are all possible functions you can use with screens and frames:
|
||||||
|
|
||||||
# screen.new(string) -- creates a new screen object
|
# screen.new
|
||||||
# frame:addFrame(string) -- creates a new frame object
|
this function creates a new screen
|
||||||
# frame:setTitle(string) -- sets the title
|
````lua
|
||||||
|
local firstScreen = screen.new("myFirstScreen")
|
||||||
|
````
|
||||||
|
par: string identifaction id. if you create 2 frames with the same id, the second one will return nil
|
||||||
|
returns a frame object
|
||||||
|
# frame:addFrame
|
||||||
|
The same as screen, but this will have parent frames (like screens)
|
||||||
|
````lua
|
||||||
|
frame:addFrame("myFirstFrame")
|
||||||
|
````
|
||||||
|
par: string identifaction id. if you create 2 frames with the same id, the second one will return nil
|
||||||
|
returns a frame object
|
||||||
|
Example:
|
||||||
|
````lua
|
||||||
|
local aScreen = screen.new("myFirstScreen")
|
||||||
|
local aFrame = aScreen:addFrame("myFirstFrame")
|
||||||
|
````
|
||||||
|
# frame:setTitle
|
||||||
|
Changes the title from a frame or screen
|
||||||
|
````lua
|
||||||
|
frame:setTitle("My first Frame!)
|
||||||
|
````
|
||||||
|
par: string text
|
||||||
|
returns the frame object
|
||||||
|
Example:
|
||||||
|
````lua
|
||||||
|
local aScreen = screen.new("myFirstScreen")
|
||||||
|
local aFrame = aScreen:addFrame("myFirstFrame")
|
||||||
|
aFrame:setTitle("My first Frame!)
|
||||||
|
````
|
||||||
|
or:
|
||||||
|
````lua
|
||||||
|
local aScreen = screen.new("myFirstScreen")
|
||||||
|
local aFrame = aScreen:addFrame("myFirstFrame"):setTitle("My first Frame!)
|
||||||
|
````
|
||||||
|
--WIP FROM HERE
|
||||||
# frame:setTitleAlign(string) -- sets the title alignment ("left","right","center")
|
# frame:setTitleAlign(string) -- sets the title alignment ("left","right","center")
|
||||||
# frame:setPosition(int, int) -- changes the position relative to its parent frame
|
# frame:setPosition(int, int) -- changes the position relative to its parent frame
|
||||||
# frame:setBackground(int) -- changes the background color
|
# frame:setBackground(int) -- changes the background color
|
||||||
|
|||||||
Reference in New Issue
Block a user