GuiAction_SetTag

Category: GUI
Since engine version: 7.0 OC

Description

Action for a GUI window event such as OnClick.

Syntax

array GuiAction_SetTag(string tag, int subwindow_id, object target);

Parameters

tag:
The new tag that will be set.
subwindow_id:
ID of the subwindow of which the tag will be changed. If 0, the window containing this action will be affected.
target:
Target of the subwindow of which the tag will be changed.

Remarks

Changing the tag of a window is not synchronized over network. This means that other players will not see when one player for example hovers over a menu window; if you need the tag to be set for all players, use GuiAction_Call() with GuiUpdateTag().
See the GUI documentation for further explanations.

Example

var menu =
{
	BackgroundColor = 
	{
		Std = RGB(255, 0, 0),
		Hover = RGB(0, 255, 0)
	},
	OnMouseIn = GuiAction_SetTag("Hover"),
	OnMouseOut = GuiAction_SetTag("Std")
};
var menuID = GuiOpen(menu);
Defines a new GUI window that changes color when you hover over it.
See also: GUI Documentation, GuiAction_Call, GuiClose, GuiOpen, GuiUpdate, GuiUpdateTag
Zapper, 2014-10