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) : Create the ui system. All necessary variables are defined. Return list id of node.
  • wui_add_node(obj,[_absolute],[_precise]) : Create 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]) : Add instances of that layer whose names begin with "WuI_" as nodes.
  • wui_add_layer_in_node(layer_name,toNode,[_absolute],[_precise]) : + Move the parents of those nodes to 'toNode'. (Tip : Use Surface!)
  • wui_del_layer(layer_name) : Remove 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_collision(absolute,precise) : Set 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_set_depth(depth) : Sets the depth for that node (and allows negative numbers up to - 100).
  • wui_set_rect(x,y,width,height) : Set the coordinates and size of that node.
  • wui_set_rect_center(x,y,width,height) : Sets the coordinates and size of that node, which is calibrated to the center relative to x and y.
  • wui_destroy_hierarchy() : Remove its child nodes.
  • wui_destroy_node(id) : Remove the child node.
  • wui_destroy_self() : Remove 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() : Call back to system instance. (Refer to the description of the callback variable.)
  • wui_callback_func(function,[arg0]) : Runs the function with callback.

///Variables

  • system : id of ui system
  • parent : id of the parent node
  • list : list id to store child nodes, or not -1
  • _x, _y, _width, _height : use wui_set_rect() function! - Coordinate, Size
  • _absolute : 1 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 wuiset_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

(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!

End User Licence Agreement (EULA).

Version 1.4.0. Published June 9, 2018

Age Rating: 4+

Average Rating

This asset hasn't received enough reviews yet.

Your review

You can only review assets you've bought.

No reviews yet

No reviews have been left for this asset - be the first!

Package contents

Loading, please wait

What is the issue?

Back to Top