autodoc_client_functions
JO Functions > jo.gizmo.cancel()
Cancels the currently active gizmo interface <br>
JO Functions > jo.gizmo.cancel() > Syntax
jo.gizmo.cancel()
JO Functions > jo.gizmo.cancel() > Example
CreateThread(function()
local entity = 1234566
local cfg = {
enableCam = true,
maxDistance = 5.0,
maxCamDistance = 10.0,
minY = -20.0,
maxY = 20.0,
movementSpeed = 0.1
}
local function allowPlace(position)
log("Position:", position)
return true
end
local result = jo.gizmo.moveEntity(entity, cfg, allowPlace)
end)
--Cancel the gizmo after 10s
CreateThread(function()
Wait(10000)
jo.gizmo.cancel()
end)
JO Functions > jo.gizmo.moveEntity()
Setup a gizmo interface to move an entity in 3D space <br> Allows for precise positioning and rotation of entities through a visual interface <br> Uses a camera system for better manipulation when enabled <br>
JO Functions > jo.gizmo.moveEntity() > Syntax
jo.gizmo.moveEntity(entity, cfg, allowPlace)
JO Functions > jo.gizmo.moveEntity() > Parameters
entity : integer
The entity to move
cfg : table <BadgeOptional />
Configuration options to override defaults
cfg.enableCam: boolean - Enable/disable camera feature - default based on config
cfg.maxDistance: number - Max distance the entity can be moved from starting position - default based on config
cfg.maxCamDistance: number - Max distance the camera can be moved from player - default based on config
cfg.minY: number - Min Y value from starting position for camera - default based on config
cfg.maxY: number - Max Y value from starting position for camera - default based on config
cfg.movementSpeed: number - Movement speed for camera - default based on config
cfg.allowTranslateX: boolean - Allow translation on X-axis - defaulttrue
cfg.allowTranslateY: boolean - Allow translation on Y-axis - defaulttrue
cfg.allowTranslateZ: boolean - Allow translation on Z-axis - defaulttrue
cfg.allowRotateX: boolean - Allow rotation on X-axis - defaulttrue
cfg.allowRotateY: boolean - Allow rotation on Y-axis - defaulttrue
cfg.allowRotateZ: boolean - Allow rotation on Z-axis - defaulttrue
cfg.allowSnapToGround: boolean - Allow snapping to ground - defaulttrue
cfg.rotationSnap: number - Rotation snap value - default5
cfg.onMove: function - Optional function fired when the entity move with the gizmo
allowPlace : function <BadgeOptional />
Optional callback to validate placement - receives proposed position as parameter
JO Functions > jo.gizmo.moveEntity() > Return Value
Type : table|nil
Returns entity position and rotation data when completed, nil if already active
JO Functions > jo.gizmo.moveEntity() > Example
local entity = 1234566
local cfg = {
enableCam = true,
maxDistance = 5.0,
maxCamDistance = 10.0,
minY = -20.0,
maxY = 20.0,
movementSpeed = 0.1
}
local function allowPlace(position)
log("Position:", position)
return true
end
local result = jo.gizmo.moveEntity(entity, cfg, allowPlace)
log(result)
JO Functions > jo.gizmo.moveEntity() > Parameters
entity : integer
The entity to move
cfg : table <BadgeOptional />
Configuration options to override defaults
cfg.enableCam: boolean - Enable/disable camera feature - default based on config
cfg.maxDistance: number - Max distance the entity can be moved from starting position - default based on config
cfg.maxCamDistance: number - Max distance the camera can be moved from player - default based on config
cfg.minY: number - Min Y value from starting position for camera - default based on config
cfg.maxY: number - Max Y value from starting position for camera - default based on config
cfg.movementSpeed: number - Movement speed for camera - default based on config
cfg.allowTranslateX: boolean - Allow translation on X-axis - defaulttrue
cfg.allowTranslateY: boolean - Allow translation on Y-axis - defaulttrue
cfg.allowTranslateZ: boolean - Allow translation on Z-axis - defaulttrue
cfg.allowRotateX: boolean - Allow rotation on X-axis - defaulttrue
cfg.allowRotateY: boolean - Allow rotation on Y-axis - defaulttrue
cfg.allowRotateZ: boolean - Allow rotation on Z-axis - defaulttrue
cfg.allowSnapToGround: boolean - Allow snapping to ground - defaulttrue
cfg.rotationSnap: number - Rotation snap value - default5
cfg.onMove: function - Optional function fired when the entity move with the gizmo
cfg.onlyOnMove: boolean - Optional if onMove set the position or rotation will only be send to the function
allowPlace : function <BadgeOptional />
Optional callback to validate placement - receives proposed position as parameter