Description
This script is based on ZUI Engine by pocha.
(The prefix for the function name was modified to wuI_*)
HOW TO USE : (UI System Object visible : true, UI Objects visible : false)
///UI System Create Event
wui_create(room_width,room_height);
with(wui_add_node(o_rect)){
color=c_black;
wui_set_rect(32,32,64,64);
with(wui_add_node(o_rect)){
wui_set_rect(16,16,32,16);
color=$0fa5f5;
}
}
with(wui_add_node(o_rect)){
wui_set_rect(16,16,128,24);
wui_set_depth(1);
}
///UI System End Step Event
wui_update();
///UI System Draw Event
wui_draw();
///UI Draw Event
{ draw_code };
wui_draw_inherited(); //sub-node drawing. you can use this with surface,
I'll get some more useful explanations ASAP.
///Reference
- wui_create(width, height) : Creates the ui system. All necessary variables are defined. Return list id of node.
- wui_add_node(obj,[absolute],[precise]) : Creates a node based on 'obj'. The required variables within that instance are defined. and Return the instance id. In addition, you can set values of the '_absolute' variable and '_precise' variable.
- wui_add_layer(layer_name,[absolute],[_precise]) : Adds instances of that layer whose names begin with "WuI" as nodes.
- wui_add_layer_in_node(layer_name,toNode,[absolute],[precise]) : + Moves the parents of those nodes to 'toNode'. (Tip : Use Surface!)
- wui_del_layer(layer_name) : Removes nodes with that layer name. (Destroy X, Detach)
- wui_update() : You must run before the ui_draw function. This is related to mouse check, coordinate correction, and depth.
- wui_draw() : Must call up the Draw event on the ui system. It runs the child nodes sequentially.
- wui_draw_inherited() : (draw event in node) Performs a draw event for the child nodes.
- wui_set_depth(depth) : Sets the depth for that node (and allows negative numbers up to - 100).
- wui_set_position(x,y) : Sets the coordinates of that node.
- wui_set_size(width,height) : Sets the size of that node.
- wui_set_rect(x,y,width,height) : Sets the coordinates and size of that node.
- wui_set_collision(absolute,precise) : Sets whether to use absolute coordinates and precise collision(mouse).
- wui_set_visible(visible) : Sets whether it draw itself. (+child nodes. It also applies to mouse collisions.)
- wui_set_visible_layer(layer_name, visible) : Sets whether nodes with that layer name are drawn.
- wui_destroy_hierarchy() : Removes its child nodes.
- wui_destroy_node(id) : Removes the child node.
- wui_destroy_self() : Removes itself from the parent node.
- wui_get_node(layer_name,object_index,[index]) :Gets the instance id of the node with the object name and layer name. Please use the third argument for multiple. (index : 0~ / default 0)
- wui_get_all(layer_name) : Returns an array of all the nodes in the layer name.
- wui_callback() : Calls back to system instance. (Refer to the description of the callback variable.)
- wui_callback_func(function,[arg0]) : Runs the function with callback.
- wui_if_mousechk() : Returns whether the mouse is on its node.
- wui_set_origin(x,y) : Sets the origin for that node.
- wui_set_scale(xscale,yscale) : Sets the scale value of the node.
///Variables
- system : id of ui system
- parent : id of the parent node
- list : list id to store child nodes, or not -1
- width, height : Calculated horizontal, vertical size
- scalex, scaley : Calculated scale value
- _x, _y, _width, _height : use wui_set_rect() function! - Coordinate, Size
- _absolute : if the coordinates are absolute, 0 if specified relative to the parent node
- _precise : 1 if checked according to sprite mask, 0 if checked in rectangle(x, y, _width, _height)
- _depth : Set depth, never modify it directly, use the wui_set_depth function.
- _surfp : Used to create the Surface UI, where the surface node stores its id in '_surfp' to its child nodes. This ensures normal mouse coordinate calibration within the script.
- _visible : Whether to draw itself
- _originx, _originy : Origin
(Variables in UI System only)
- depthlist
- depthptr
- wui_layer : ds map with layers analyzed
- mousechk[] : the instance id of the node mousing. (Top node)
- callback : The id of the node that was callback., Can be received when user event 0 is executed.
< Warning of using Surface :
In the example of GM2, a simple comment is written in the Surface, but due to the problem of the sequence of events >
for(var i=0;i<ds_list_size(list);i++){
list[|i]._absolute=1;
list[|i]._surfp=id;
}
Please process these coordinate processing sensitive parts in Step Event or End Step Event! <Not Begin Step Event>
End User Licence Agreement (EULA).
Age Rating: None
Version
GMS2 - Version 1.6.0. Published April 10, 2019
Package contents
Loading, please wait
What is the issue?
Loading, please wait