User Tools

Site Tools


script:ui_event:setsize

setSize

From Customui Class

  Customui:setSize(playerid, uiid, elementid, width, height)

API Description Sets the dimensions of a UI component.

Parameters Types Info
playerid number Player ID
uiid string Custom UI ID
elementid string Target component ID
width number New width in pixels
height number New height in pixels
Return Value Type
ErrorCode.OK (0) number

Examples

setSize_Example.lua
-- Triggered when player clicks a block
local function clickblock(event)
    local playerid = event.eventobjid  -- Clicking player's ID
    local uiid = "6986982063319417057"  -- Replace with your UI ID
    local elementid = "6986982063319417057_3"  -- Replace with component ID
    local width, height = 500, 200  -- New dimensions
 
    -- Resize the specified component
    Customui:setSize(playerid, uiid, elementid, width, height)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)

Function Details

Parameter Breakdown

  • `playerid`: Identifies which player's UI to modify
  • `uiid`: The container UI containing the target element
  • `elementid`: Specific component to resize
  • `width`: New horizontal size (integer)
  • `height`: New vertical size (integer)

Usage Notes

  • All ID values must match existing UI elements
  • Dimensions use pixel units
  • Changes apply only to the specified player's UI instance
  • Component must support resizing
script/ui_event/setsize.txt · Last modified: 2025/05/23 04:14 by hhuxx