A GAMEMAKER GUI
- button
- drag
- scale
- scrollbar
- checkbox
- grid
- goods
- input
- selector
- slider
- tab
- tree
- windown
- animation
o_gui_impl
place in instances layero_gui_impl
adjust create order to topo_gui_test
create a object and place in instance layer
node = sc_gui_root({ x: x, y: 200}, function() {
sc_gui_text({str:"hello world"});
});
sc_gui_node_event_delete_by_obj(node);
Note: When node affects other node, then need use the method.
See GUI/core/sc_curd/sc_gui_update sc_gui_node_event_update_by_args
or sc_gui_node_event_update_by_uri
// update node width
sc_gui_node_event_update_by_args({w : _width});
// sync src node text_str(attr) to dst node str(attr)
// src: self->decorate->(cid == text) attr: text_str
// dst: self->parent->decorate->(cid == text) attr: str
sc_gui_node_event_update_by_uri(
"/decorate/cid/" + string(GUI_CLASS.TEXT), "text_str",
"/parent/decorate/cid/" + string(GUI_CLASS.TEXT), "str"
);
- defined a component node {name}
- defined a GUI_CLASS.{TYPE}
- defined function
sc_gui_{name}_construct
- setting
sc_gui_global_set_class_construct
- setting
- defined function
sc_gui_{name}_config_construct
- setting
sc_gui_config_attr_alias_set
- setting
sc_gui_config_attr_value_set
- setting
sc_gui_config_attr_parse_set
- setting
- defined
sc_gui_{name}
- replace {name},{TYPE} to specific name and type.
- reference o_example
function sc_gui_{name}_construct()
{
gml_pragma("global", "sc_gui_{name}_construct()");
var _classid = GUI_CLASS.{TYPE};
sc_gui_global_set_class_construct(
_classid, "{name}",
sc_gui_{name}_config_construct,
sc_gui_{name}
);
}
function sc_gui_{name}_config_construct()
{
var _class = {cid : GUI_CLASS.{TYPE}, inherit : GUI_CLASS.DEFAULT };
// For parse
sc_gui_config_attr_alias_set(_class, ["debug_one", "debug_aa"], "debug");
// For default value
sc_gui_config_attr_value_set(_class, {
debug : "",
func_on_press : function () { show_debug_message(debug); }
});
// For parse function
sc_gui_config_attr_parse_set(_class, "debug", function(__attr, __name, __realname, __self) {
var _val = variable_struct_get(__attr, __name);
debug = string(_val);
});
}
function sc_gui_{name}(__attr = undefined, __func_attach = undefined, __func_agrs = undefined)
{
gml_pragma("forceinline");
return sc_gui_node(__attr, __func_attach, __func_agrs, GUI_CLASS.{TYPE});
}
// In the object instance (create event)
function object_event_create() {
// in create
node = sc_gui_root({x: 200, y: 200}, function() {
sc_gui_example({w: 64, h: 64, debug_one: "hello world"});
});
}
// In the object instance (destroy event)
function object_event_destroy() {
sc_gui_node_event_delete_by_obj(node);
}
See o_node_direct_flex
- SELF-DEFINED(Not Layout)
- FLEX (default)
- parent node constraint child node position(row rrow col rcol)
- GRID