Updated Frames (& Screens) (markdown)

Robert Jelic
2022-03-27 19:09:07 +02:00
parent dad0fb7f40
commit 2cfc486308

@@ -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:
# screen.new(string) -- creates a new screen object
# frame:addFrame(string) -- creates a new frame object
# frame:setTitle(string) -- sets the title
# screen.new
this function creates a new screen
````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:setPosition(int, int) -- changes the position relative to its parent frame
# frame:setBackground(int) -- changes the background color