altZanyLvl 1
- Windows
Erm.. How do you use pages in FGUI?
Erm.. How do you use pages in FGUI?
There are a few functions:
Creates a new page
page: createPage(<string: name>, <function: before>, <function: after>, <function: onopen>, <function: onclose>);
name: name of page
before: function called when page is active before the elements are drawn
after: function called when page is active after the elements are drawn
onopen: function called when page set as active page
onclose: function called when page unset as active page
returns a page object
Sets the current page:
void: setPage(<string: name>);
name: sets the active page to the this page
And a couple global variables:
<object: pageMap>
an object which contains every current page
<page: activePage>
the current page
When no page is specified, it is presumed to be "default"
To add an element to a page:
element: createElement(<number: x>, <number: y>, <number: w>, <number: h>, <string|void: page>);
x: x position of element
y: y position of element
w: width of element
h: height of element
page: add element to this page (defaults to "default")
returns an element object
pages also contain methods:
void: page.addElement(<element: elem>)
which adds an element to the page
void: page.removeElement(<element: elem>)
which removes an element from the page
elements contain methods:
void: elem.addToPage(<string: page>)
which adds an element to the page
void: elem.removeFromPage(<string: page>)
which removes an element from the page
I guess that I should also mention that my program implements a few new classes:
page: a page object, contains its callbacks
element: an element object, has too many properties to count
style: a style object, contains information about the style of the element
I'm too lazy to come up with proper documentation for FGUI, but if you have any further questions ask away
altZany best answer?
(i want siri badge)