User Tools

Site Tools


script:ui_event:setposition

setPosition

  • Parameters & Types:
    • playerid: number player ID
    • uiid: string the UIID of the custom UI
    • elementid: the UIID of the string element
    • x, y: number coordinates
  • Return value and type:
    • ErrorCode. OK
  • The main purpose of this method is to set the component position
  • Specific use cases are as follows:
--This function is executed when the player clicks on the block
local function clickblock(event)
    local playerid=event.eventobjid--Click on the player's mini number of the block
    local uiid="6997615793455979871"--Interface ID
	local elementid="6997615793455979871_1"--Component ID
	local x,y=100,100-- coordinates to be set to
    --Set the component position
    Customui:setPosition(playerid, uiid, elementid, x, y)
end
ScriptSupportEvent:registerEvent([=[Player.ClickBlock]=], clickblock)
script/ui_event/setposition.txt · Last modified: 2024/06/11 09:48 by don