-
Notifications
You must be signed in to change notification settings - Fork 185
Launcher documentation WIP
In contrast to the in-game GUI, the Launcher only displays one Screen at a time
Each Screen is composed of a background and one or more Widgets:
You can use the following method to switch the active Screen:
void Launcher_SetScreen(struct LScreen* screen);
A Launcher Screen (shorted to LScreen
) consists of the following members:
TODO: Talk about LScreen_Reset somewhere
Called the first time this launcher screen is made active
At a minimum, the widgets
and numWidgets
members must be initialised here
Points to an array containing pointers to the widgets in the screen
Number of widgets in the screen
static struct LWidget* simpleScreen_widgets[] = {
(struct LWidget*)&SimpleScreen.iptField,
(struct LWidget*)&SimpleScreen.btnBack
};
void SimpleScreen_Init(struct LScreen* s) {
s->widgets = simpleScreen_widgets;
s->numWidgets = Array_Elems(simpleScreen_widgets);
...
}
Optional. Called every time this screen appears. (i.e. switching to this screen)
Optional. Called every time this screen disappears. (i.e. switching to another screen)
Optional. Can be used to customise widget layout, but usually it's unnecessary to override the default method
Optional. Can be used to implement functionality that required periodic checking
Optional. Can be used to set the widget automatically clicked on when Enter
is pressed and no other interactable widget is hovered over.
TODO: this is kinda required usually... ?
How a launcher screen works
Init Showing Background drawing
TODO
TODO mention interactable widgets
TODO. talk about anchoring and offsets. maybe move to screen?
example image of all the different anchors/offsets
TODO
TODO mention how struct declarion works. maybe should be in earlier section?
Example usage:
void SimpleScreen_SetActive(void) {
struct SimpleScreen* s = &SimpleScreen;
LScreen_Reset((struct LScreen*)s);
s->Init = SimpleScreen_Init;
s->title = "Title text";
Launcher_SetScreen((struct LScreen*)s);
}
- Frequently Asked Questions
- Setting up a MC Classic Server