Filling tab item

The tab content is a surface, we can perform various actions with surface functions. To obtain a surface on the item tab, we can use the following function.

ui_tab_get_surface (control, index);

Return: Surface id

Argument control is the handle of ui_tab_create(...); function. While the index is an index tab you want to select.

tabMenu = ui_tab_create (16, 64, 320, 32, 256);

ui_item_add (tabMenu, "Armor");
ui_item_add (tabMenu, "Weapon");
ui_item_add (tabMenu, "Item");

var surface0 = ui_tab_get_surface (tabMenu, 0);
var surface1 = ui_tab_get_surface (tabMenu, 1);
var surface2 = ui_tab_get_surface (tabMenu, 2);

surface_set_target (surface0);
// Draw tab element here for Armor
surface_reset_target ();

surface_set_target (surface0);
// Draw tab element here for Weapon
surface_reset_target ();

surface_set_target (Item);
// Draw tab element here for Armor
surface_reset_target ();

Setting up and organizing surface on each item tabMenu tab to be filled.

You can also use the handle and calling the property "ui_tab_surface" as follows.

tabMenu = ui_tab_create (16, 64, 320, 32, 256);

tab0 = ui_item_add (tabMenu, "Armor");
tab1 = ui_item_add (tabMenu, "Weapon");
tab2 = ui_item_add (tabMenu, "Item");

var surface0 = tab0 [? "Ui_tab_surface"];
var surface1 = tab1 [? "Ui_tab_surface"];
var surface2 = tab2 [? "Ui_tab_surface"];

surface_set_target (surface0);
// Draw tab element here for Armor
surface_reset_target ();

surface_set_target (surface0);
// Draw tab element here for Weapon
surface_reset_target ();

surface_set_target (Item);
// Draw tab element here for Armor
surface_reset_target ();

Setting up and organizing surface on each item tabMenu tab to be filled.

ATTENTION!
Controls tab is not recommended to draw other controls such as button, textbox and so forth because it will cause an error in the checking function of position.

results matching ""

    No results matching ""