Skip to content

Class: CUITabButton

UI binding for CUITabButton.

Source

C++ class CUITabButton : CUIButton

Custom Constructor

CUITabButton

Extends

Constructors

Constructor

ts
new CUITabButton(): CUITabButton;

Create an empty UI window.

Returns

CUITabButton

Inherited from

CUIButton.constructor

Methods

AttachChild()

ts
AttachChild(child: CUIWindow): void;

Attach a child window.

Parameters

ParameterTypeDescription
childCUIWindowChild window.

Returns

void

Remarks

The Lua binding adopts child; after attachment, treat the parent as owning its lifetime.

Inherited from

CUIButton.AttachChild


DetachChild()

ts
DetachChild(child: CUIWindow): void;

Detach a child window.

Parameters

ParameterTypeDescription
childCUIWindowChild window.

Returns

void

Remarks

Detaching removes the parent relation. It does not reinitialize the window or attach it elsewhere.

Inherited from

CUIButton.DetachChild


Enable()

ts
Enable(is_enabled: boolean): void;

Enable or disable interaction.

Parameters

ParameterTypeDescription
is_enabledbooleanWhether the window should be enabled.

Returns

void

Remarks

Enabled state and visibility are separate. Hidden controls can still be enabled.

Inherited from

CUIButton.Enable


FocusReceiveTime()

ts
FocusReceiveTime(): number;

Returns

number

Level time when this window received focus.

Inherited from

CUIButton.FocusReceiveTime


GetAbsoluteRect()

ts
GetAbsoluteRect(): Frect;

Returns

Frect

Window rectangle in screen coordinates.

Inherited from

CUIButton.GetAbsoluteRect


GetColor()

ts
GetColor(): number;

Returns

number

Texture color.

Inherited from

CUIButton.GetColor


GetFont()

ts
GetFont(): CGameFont;

Get the font assigned to this window.

Returns

CGameFont

Font assigned to this window.

Remarks

Text controls need a font assigned before drawing custom text reliably.

Inherited from

CUIButton.GetFont


GetHeading()

ts
GetHeading(): number;

Returns

number

Heading angle.

Inherited from

CUIButton.GetHeading


GetHeight()

ts
GetHeight(): number;

Returns

number

Window height.

Inherited from

CUIButton.GetHeight


GetMouseX()

ts
GetMouseX(): number;

Get cursor X coordinate stored on this window.

Returns

number

Current cursor X coordinate.

Since

OpenXRay 2026-01-01, e3b0e3c5, PR #2028

Source

src/xrUICore/ui_export_script.cpp, CUIWindow.GetMouseX binding.

Inherited from

CUIButton.GetMouseX


GetMouseY()

ts
GetMouseY(): number;

Get cursor Y coordinate stored on this window.

Returns

number

Current cursor Y coordinate.

Since

OpenXRay 2026-01-01, e3b0e3c5, PR #2028

Source

src/xrUICore/ui_export_script.cpp, CUIWindow.GetMouseY binding.

Inherited from

CUIButton.GetMouseY


GetOriginalRect()

ts
GetOriginalRect(): Frect;

Returns

Frect

Original texture rectangle.

Inherited from

CUIButton.GetOriginalRect


GetStretchTexture()

ts
GetStretchTexture(): boolean;

Returns

boolean

Whether texture stretching is enabled.

Inherited from

CUIButton.GetStretchTexture


GetText()

ts
GetText(): string;

Returns

string

Current text.

Inherited from

CUIButton.GetText


GetTextAlign()

ts
GetTextAlign(): number;

Returns

number

Text alignment id.

Inherited from

CUIButton.GetTextAlign


GetTextureColor()

ts
GetTextureColor(): number;

Returns

number

Texture color.

Inherited from

CUIButton.GetTextureColor


GetTextureRect()

ts
GetTextureRect(): Frect;

Returns

Frect

Texture rectangle.

Inherited from

CUIButton.GetTextureRect


GetTextX()

ts
GetTextX(): number;

Returns

number

Text X offset.

Inherited from

CUIButton.GetTextX


GetTextY()

ts
GetTextY(): number;

Returns

number

Text Y offset.

Inherited from

CUIButton.GetTextY


GetWidth()

ts
GetWidth(): number;

Returns

number

Window width.

Inherited from

CUIButton.GetWidth


GetWndPos()

ts
GetWndPos(): vector2;

Returns

vector2

Window position relative to its parent.

Inherited from

CUIButton.GetWndPos


Init()

Call Signature

ts
Init(frect: Frect): void;

Initialize window rectangle.

Parameters
ParameterTypeDescription
frectFrectWindow rectangle.
Returns

void

Inherited from

CUIButton.Init

Call Signature

ts
Init(
   x1: number, 
   y1: number, 
   x2: number, 
   y2: number): void;

Initialize window rectangle.

Parameters
ParameterTypeDescription
x1numberX position.
y1numberY position.
x2numberWidth.
y2numberHeight.
Returns

void

Remarks

Coordinates are relative to the parent; x2 and y2 are size, not bottom-right coordinates.

Inherited from

CUIButton.Init


InitTexture()

ts
InitTexture(texture: string): void;

Assign texture by atlas id.

Parameters

ParameterTypeDescription
texturestringTexture id.

Returns

void

Inherited from

CUIButton.InitTexture


InitTextureEx()

ts
InitTextureEx(first: string, second: string): void;

Assign texture and shader by name.

Parameters

ParameterTypeDescription
firststringTexture id.
secondstringShader id.

Returns

void

Inherited from

CUIButton.InitTextureEx


IsAutoDelete()

ts
IsAutoDelete(): boolean;

Returns

boolean

Whether the engine owns and deletes this window with its parent.

Inherited from

CUIButton.IsAutoDelete


IsCursorOverWindow()

ts
IsCursorOverWindow(): boolean;

Returns

boolean

Whether the UI cursor is currently over this window.

Inherited from

CUIButton.IsCursorOverWindow


IsEnabled()

ts
IsEnabled(): boolean;

Returns

boolean

Whether the window accepts interaction.

Inherited from

CUIButton.IsEnabled


IsShown()

ts
IsShown(): boolean;

Returns

boolean

Whether the window is visible.

Inherited from

CUIButton.IsShown


ResetPPMode()

ts
ResetPPMode(): void;

Disable post-process mode for this window.

Returns

void

Remarks

Pair with CUIWindow.SetPPMode when a window no longer needs post-process rendering.

Inherited from

CUIButton.ResetPPMode


SetAutoDelete()

ts
SetAutoDelete(auto_delete: boolean): void;

Set whether the parent owns this child window.

Parameters

ParameterTypeDescription
auto_deletebooleanWhether the engine should delete the child automatically.

Returns

void

Remarks

Use this for script-created windows that are attached to a parent and should be cleaned up with the UI tree.

Inherited from

CUIButton.SetAutoDelete


SetColor()

ts
SetColor(color: number): void;

Set texture color.

Parameters

ParameterTypeDescription
colornumberARGB color.

Returns

void

Inherited from

CUIButton.SetColor


SetElipsis()

ts
SetElipsis(a: number, b: number): void;

Configure text ellipsis.

Parameters

ParameterTypeDescription
anumberEllipsis mode.
bnumberIndent.

Returns

void

Inherited from

CUIButton.SetElipsis


SetFont()

ts
SetFont(font: CGameFont): void;

Set the font used by this window.

Parameters

ParameterTypeDescription
fontCGameFontFont object.

Returns

void

Inherited from

CUIButton.SetFont


SetHeading()

ts
SetHeading(number: number): void;

Set heading angle.

Parameters

ParameterTypeDescription
numbernumberHeading angle.

Returns

void

Inherited from

CUIButton.SetHeading


SetHeight()

ts
SetHeight(height: number): void;

Set window height.

Parameters

ParameterTypeDescription
heightnumberNew height.

Returns

void

Inherited from

CUIButton.SetHeight


SetOriginalRect()

ts
SetOriginalRect(frect: Frect): void;

Set original texture rectangle.

Parameters

ParameterTypeDescription
frectFrectOriginal rectangle.

Returns

void

Inherited from

CUIButton.SetOriginalRect


SetPPMode()

ts
SetPPMode(): void;

Enable post-process mode for this window.

Returns

void

Remarks

Use for windows meant to be drawn through the post-process UI path, and reset it when the window returns to normal UI rendering.

Inherited from

CUIButton.SetPPMode


SetStretchTexture()

ts
SetStretchTexture(stretch: boolean): void;

Enable or disable texture stretching.

Parameters

ParameterTypeDescription
stretchbooleanWhether texture should stretch to the window rect.

Returns

void

Inherited from

CUIButton.SetStretchTexture


SetText()

ts
SetText(text: string): void;

Set raw text.

Parameters

ParameterTypeDescription
textstringText value.

Returns

void

Inherited from

CUIButton.SetText


SetTextAlign()

ts
SetTextAlign(align: number): void;

Set text alignment.

Parameters

ParameterTypeDescription
alignnumberAlignment id.

Returns

void

Inherited from

CUIButton.SetTextAlign


SetTextColor()

ts
SetTextColor(
   a: number, 
   r: number, 
   g: number, 
   b: number): void;

Set text color from color channels.

Parameters

ParameterTypeDescription
anumberAlpha channel.
rnumberRed channel.
gnumberGreen channel.
bnumberBlue channel.

Returns

void

Inherited from

CUIButton.SetTextColor


SetTextST()

ts
SetTextST(string: string): void;

Set translated string-table text.

Parameters

ParameterTypeDescription
stringstringString table id.

Returns

void

Inherited from

CUIButton.SetTextST


SetTextureColor()

ts
SetTextureColor(color: number): void;

Set texture color.

Parameters

ParameterTypeDescription
colornumberARGB color.

Returns

void

Inherited from

CUIButton.SetTextureColor


SetTextureOffset()

ts
SetTextureOffset(x: number, y: number): void;

Set texture drawing offset.

Parameters

ParameterTypeDescription
xnumberX offset.
ynumberY offset.

Returns

void

Inherited from

CUIButton.SetTextureOffset


SetTextureRect()

ts
SetTextureRect(frect: Frect): void;

Set source texture rectangle.

Parameters

ParameterTypeDescription
frectFrectTexture rectangle.

Returns

void

Inherited from

CUIButton.SetTextureRect


SetTextX()

ts
SetTextX(x: number): void;

Set text X offset.

Parameters

ParameterTypeDescription
xnumberX offset.

Returns

void

Inherited from

CUIButton.SetTextX


SetTextY()

ts
SetTextY(x: number): void;

Set text Y offset.

Parameters

ParameterTypeDescription
xnumberY offset.

Returns

void

Inherited from

CUIButton.SetTextY


SetWidth()

ts
SetWidth(width: number): void;

Set window width.

Parameters

ParameterTypeDescription
widthnumberNew width.

Returns

void

Inherited from

CUIButton.SetWidth


SetWindowName()

ts
SetWindowName(name: string): void;

Set debug/window name.

Parameters

ParameterTypeDescription
namestringWindow name.

Returns

void

Inherited from

CUIButton.SetWindowName


SetWndPos()

Call Signature

ts
SetWndPos(vector2: vector2): void;

Set window position.

Parameters
ParameterTypeDescription
vector2vector2New position.
Returns

void

Inherited from

CUIButton.SetWndPos

Call Signature

ts
SetWndPos(x1: number, y1: number): void;

Set window position.

Parameters
ParameterTypeDescription
x1numberX position.
y1numberY position.
Returns

void

Inherited from

CUIButton.SetWndPos


SetWndRect()

Call Signature

ts
SetWndRect(rect: Frect): void;

Set window rectangle.

Parameters
ParameterTypeDescription
rectFrectNew rectangle.
Returns

void

Inherited from

CUIButton.SetWndRect

Call Signature

ts
SetWndRect(
   x1: number, 
   y1: number, 
   x2: number, 
   y2: number): void;

Set window rectangle.

Parameters
ParameterTypeDescription
x1numberX position.
y1numberY position.
x2numberWidth.
y2numberHeight.
Returns

void

Remarks

Coordinates are relative to the parent; x2 and y2 are size, not bottom-right coordinates.

Inherited from

CUIButton.SetWndRect


SetWndSize()

Call Signature

ts
SetWndSize(vector2: vector2): void;

Set window size.

Parameters
ParameterTypeDescription
vector2vector2New size.
Returns

void

Inherited from

CUIButton.SetWndSize

Call Signature

ts
SetWndSize(width: number, height: number): void;

Set window size.

Parameters
ParameterTypeDescription
widthnumberNew width.
heightnumberNew height.
Returns

void

Inherited from

CUIButton.SetWndSize


Show()

ts
Show(show: boolean): void;

Show or hide the window.

Parameters

ParameterTypeDescription
showbooleanWhether the window should be visible.

Returns

void

Remarks

Visibility does not attach, detach, enable, or disable the window.

Inherited from

CUIButton.Show


TextControl()

ts
TextControl(): CUILines;

Returns

CUILines

Text line controller.

Inherited from

CUIButton.TextControl


WindowName()

ts
WindowName(): string;

Returns

string

Window name.

Inherited from

CUIButton.WindowName

Properties

__name

ts
readonly __name: string;

LuaBind instance constructor name.

Inherited from

CUIButton.__name


__name

ts
readonly static __name: string;

LuaBind class constructor name.

Inherited from

CUIButton.__name