Template:Scripting/Squirrel/Functions/Client GUITypes

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

GUIElement

There aren't actually any instances of GUIElement, but it is the base class for all other GUI element classes. This means that all properties and functions it has also work on other GUI elements. GUI element flags are used in several places, the available flag constants are:

  • GUI_FLAG_NONE
  • GUI_FLAG_VISIBLE
  • GUI_FLAG_DISABLED
  • GUI_FLAG_BACKGROUND
  • GUI_FLAG_BORDER
  • GUI_FLAG_SHADOW
  • GUI_FLAG_DRAGGABLE
  • GUI_FLAG_CLIP
  • GUI_FLAG_WRAP
  • GUI_FLAG_AUTO_RESIZE
  • GUI_FLAG_INHERIT_ALPHA
  • GUI_FLAG_ANIMATION
  • GUI_FLAG_TABSTOP
  • GUI_FLAG_MOUSECTRL
  • GUI_FLAG_KBCTRL
  • GUI_FLAG_SCROLLABLE
  • GUI_FLAG_TEXT_SHADOW
  • GUI_FLAG_TEXT_TAGS
  • GUI_FLAG_DEPTH_TEST
  • GUI_FLAG_3D_ENTITY
  • GUI_FLAG_CACHE_TEXTURE
  • GUI_FLAG_CHECKBOX_CHECKED
  • GUI_FLAG_EDITBOX_MASKINPUT
  • GUI_FLAG_LISTBOX_MULTISELECT
  • GUI_FLAG_LISTBOX_SORTING
  • GUI_FLAG_MEMOBOX_TOPBOTTOM
  • GUI_FLAG_SCROLLBAR_HORIZ
  • GUI_FLAG_WINDOW_TITLEBAR
  • GUI_FLAG_WINDOW_CLOSEBTN
  • GUI_FLAG_WINDOW_RESIZABLE


Function AddChild(element)

Parameter types: GUIElement. Return type: void.

Makes the specified element a child of this element.


Function IsChildOf(element)

Parameter types: GUIElement. Return type: bool.

Returns true if this element is the child of the specified element.


Function Detach()

Return type: void.

Detaches this element from its parent.


Function MoveForward()

Return type: void.

Moves the siblign element right in front of this one behind it.


Function MoveBackward()

Return type: void.

Moves the sibling element right behind this element to the front of it.


Function SendToTop()

Return type: void.

Moves this element on top of all other sibling elements.


Function SendToBottom()

Return type: void.

Moves this element to the bottom of all other sibling elements.


Property Position (bound)

Type: VectorScreen


Property Size (bound)

Type: VectorScreen


Property Position3D / Pos3D (bound)

Type: Vector


Property Rotation3D (bound)

Type: Vector


Property Size3D (bound)

Type: Vector


Function Set3DTransform(position, rotation, size)

Parameter types: Vector, Vector, Vector. Return type: void.

Sets the 3D transformation of this element.


Property Colour / Color (bound)

Type: Colour


Property TextColour / TextColor (bound)

Type: Colour


Property Alpha

Type: int


Property Text

Type: string


Property TextSize (read-only)

Type: VectorScreen

Size on the screen of the text in this element.


Property TextAlignment

Type: int

Sets the alignment of text. Available constants are:

  • GUI_ALIGN_LEFT
  • GUI_ALIGN_RIGHT
  • GUI_ALIGN_TOP
  • GUI_ALIGN_BOTTOM
  • GUI_ALIGN_CENTERV
  • GUI_ALIGN_CENTERH
  • GUI_ALIGN_CENTER


Property FontName

Type: string


Property FontSize

Type: int


Property FontFlags

Type: int

Available flag constants are:

  • GUI_FFLAG_NONE
  • GUI_FFLAG_BOLD
  • GUI_FFLAG_ITALIC
  • GUI_FFLAG_ULINE
  • GUI_FFLAG_STRIKE
  • GUI_FFLAG_NOAA
  • GUI_FFLAG_OUTLINE


Property TextPaddingTop

Type: int


Property TextPaddingBottom

Type: int


Property TextPaddingLeft

Type: int


Property TextPaddingRight

Type: int


Property Flags

Type: int


Function AddFlags(flags)

Parameter types: int. Return type: void.


Function RemoveFlags(flags)

Parameter types: int. Return type: void.

GUIButton

Constructor GUIButton()


Constructor GUIButton(position, size, colour)

Parameter types: VectorScreen, VectorScreen, Colour


Constructor GUIButton(position, size, colour, text)

Parameter types: VectorScreen, VectorScreen, Colour, string


Constructor GUIButton(position, size, colour, text, flags)

Parameter types: VectorScreen, VectorScreen, Colour, string, int

GUICanvas

Constructor GUICanvas()

GUICheckbox

Constructor GUICheckbox()


Constructor GUICheckbox(position, colour)

Parameter types: VectorScreen, Colour


Constructor GUICheckbox(position, colour, flags)

Parameter types: VectorScreen, Colour, int

GUIEditbox

Constructor GUIEditbox(position, size, colour)

Parameter types: VectorScreen, VectorScreen, Colour


Constructor GUIEditbox(position, size, colour, text)

Parameter types: VectorScreen, VectorScreen, Colour, string


Constructor GUIEditbox(position, size, colour, text, flags)

Parameter types: VectorScreen, VectorScreen, Colour, string, int


Property HasTextSelected (read-only)

Type: bool


Property TextSelection (read-only)

Type: string


Function SelectText(startIndex, endIndex)

Parameter types: int, int. Return type: void.


Property CursorPos

Type: int

GUILabel

Constructor GUILabel()


Constructor GUILabel(position, colour)

Parameter types: VectorScreen, Colour


Constructor GUILabel(position, colour, text)

Parameter types: VectorScreen, Colour, string


Constructor GUILabel(position, colour, text, flags)

Parameter types: VectorScreen, Colour, string, int

GUIListbox

Constructor GUIListbox()


Constructor GUIListbox(position, size)

Parameter types: VectorScreen, VectorScreen


Constructor GUIListbox(position, size, colour, selectedColour)

Parameter types: VectorScreen, VectorScreen, Colour, Colour


Constructor GUIListbox(position, size, colour, selectedColour, flags)

Parameter types: VectorScreen, VectorScreen, Colour, Colour, int


Property Items (read-only)

Type: array


Function AddItem(item)

Parameter types: string. Return type: void.


Function RemoveItem(item)

Parameter types: string. Return type: void.


Function Clean()

Return type: void.

Removes all items.


Property ItemCount (read-only)

Type: int


Property SelectedCount (read-only)

Type: int


Property SelectedColour (bound)

Type: Colour

Background colour of selected items.

GUIMemobox

Constructor GUIMemobox()


Constructor GUIMemobox(position, size, colour)

Parameter types: VectorScreen, VectorScreen, Colour


Constructor GUIMemobox(position, size, colour, flags)

Parameter types: VectorScreen, VectorScreen, Colour, int


Function AddLine(line)

Parameter types: string. Return type: void.


Function AddLine(line, colour)

Parameter types: string, Colour. Return type: void.


Function Clear()

Return type: void.


Property DisplayPos

Type: float


Property LineHeight

Type: int


Property LineCount (read-only)

Type: int


Property HistorySize

Type: int

GUIProgressBar

Constructor GUIProgressBar()


Constructor GUIProgressBar(position, size, colour)

Parameter types: VectorScreen, VectorScreen, Colour


Constructor GUIProgressBar(position, size, colour, selectedColour)

Parameter types: VectorScreen, VectorScreen, Colour, Colour


Constructor GUIProgressBar(position, size, colour, selectedColour, flags)

Parameter types: VectorScreen, VectorScreen, Colour, Colour, int


Constructor GUIProgressBar(position, size, colour, selectedColour, flags, endValue)

Parameter types: VectorScreen, VectorScreen, Colour, Colour, int, float


Property Value

Type: float


Property MaxValue

Type: float


Property BackgroundShade

Type: float


Property Thickness

Type: int


Property StartColour (bound)

Type: Colour


Property EndColour (bound)

Type: Colour

GUIScrollbar

Constructor GUIScrollbar()


Constructor GUIScrollbar(position, size)

Parameter types: VectorScreen, VectorScreen


Constructor GUIScrollbar(position, size, colour)

Parameter types: VectorScreen, VectorScreen, Colour


Constructor GUIScrollbar(position, size, colour, flags)

Parameter types: VectorScreen, VectorScreen, Colour, int


Function SetParams(contentSize, stepSize, barPosition, barSize)

Parameter types: float, float, float, float. Return type: void.


Property ContentSize

Type: float


Property StepSize

Type: float


Property BarSize

Type: float


Property BarPosition

Type: float


Property BackgroundShade / BGShade

Type: float

GUISprite

Constructor GUISprite()


Constructor GUISprite(fileName, position)

Parameter types: string, VectorScreen


Constructor GUISprite(fileName, position, colour)

Parameter types: string, VectorScreen, Colour


Constructor GUISprite(fileName, position, colour, flags)

Parameter types: string, VectorScreen, Colour, int


Property TextureSize

Type: VectorScreen


Property TopLeftUV

Type: Vector


Property BottomRightUV

Type: Vector


Function SetTexture(fileName)

Parameter types: string. Return type: void.


Function Resize()

Return type: void.

GUIWindow

Constructor GUIWindow()


Constructor GUIWindow(position, size, colour)

Parameter types: VectorScreen, VectorScreen, Colour


Constructor GUIWindow(position, size, colour, text)

Parameter types: VectorScreen, VectorScreen, Colour, string


Constructor GUIWindow(position, size, colour, text, flags)

Parameter types: VectorScreen, VectorScreen, Colour, string, int


Property DragOffset (read-only)

Type: VectorScreen


Property TitleColour (bound)

Type: Colour