Files

4655 lines
118 KiB
Markdown

<!-- Source: https://wiki.transportfever3.com/script-doc/api/gui.html (fetched 2026-10-04) -->
[index](../index.html) / [api](../api.html) / gui
---
# Module api.gui[🔗](#api.gui)
Contains all GUI functionality apart from react.
```
[Expand All] [Collapse All]
global record Gui fireReactEvent: function(name : string, param : any)
fireGuiScriptEvent: function(id : string, name : string, param : any): any
record HighlightStyle Square: HighlightStyle
Circle: HighlightStyle
end
record SpawnHudImageParams iconPath: FilePath
color: Vec4f
entity: Engine.Entity
position: Vec3f
end
spawnEphemeralHudImage: function(iconPath : FilePath, entity : Engine.Entity, color : Vec4f, position : Vec3f, overrideDuration : number, fadeIn : boolean, fadeOut : boolean, rev0 : integer)
spawnEphemeralHudImageOnPath: function(iconPath : FilePath, pos0 : Vec3f, pos1 : Vec3f, pos0 : Vec3f, pos1 : Vec3f, speed : number, scale : number, maxDistance : number)
closeAllWindows: function()
record SelectionDetails new: function(): SelectionDetails
record Type None: Type
Line: Type
Station: Type
Signal: Type
Stop: Type
Waypoint: Type
TransportNetworkEdge: Type
World: Type
Marker: Type
Town: Type
end
interface DataType kind: Type
end
record Line line: Engine.Entity
stop: integer
waypoint: integer
end
record Station new: function(): Station
stationGroup: Engine.Entity
flatStationTerminalIndex: integer
stationTerminal: StationTerminal
end
record Signal signalList: Engine.Entity
signalIndex: integer
end
record Stop new: function(): Stop
station: SelectionDetails.Station
line: Engine.Entity
stopIndex: integer
end
record Waypoint line: Engine.Entity
stopIndex: integer
waypointIndex: integer
tag: integer
end
record TransportNetworkEdge new: function(): TransportNetworkEdge
snap: EdgePos
end
record World new: function(): World
pos: Vec3f
water: boolean
end
record Marker new: function(): Marker
marker: string
fireSelectEntity: boolean
pos: Vec3f
entity: Engine.Entity
end
record Town new: function(): Town
townEntity: Engine.Entity
districtType: LandUseType
districtCenter: Vec3f
end
data: DataType
end
record WorldEvent pos: {number, number, number}
water: boolean
end
record Mouse record Event record Type Pressed: Type
Released: Type
Clicked: Type
Entered: Type
Exited: Type
Moved: Type
Wheel: Type
DoubleClicked: Type
PressedOutside: Type
end
type: Type
button: integer
x: integer
y: integer
xrel: integer
yrel: integer
handled: boolean
end
getTerrainPosition: function(): Vec3f
hasTerrainPosition: function(): boolean
end
record Key record State Up: State
Pressed: State
end
record InputEvent dir: State
repeated: boolean
isGamepadEvent: function(InputEvent): boolean
isKeyboardEvent: function(InputEvent): boolean
getKey: function(InputEvent): integer
getKeyMod: function(InputEvent): integer
end
record Event data: InputEvent
isPressed: function(Event): boolean
end
end
record DataTransferItem new: function(ResName, any): DataTransferItem
type: ResName
data: any
end
record DnD record Event record Type Drop: Type
DragStarted: Type
DragEntered: Type
DragExited: Type
end
type: Type
end
setCursor: function(cursor : integer)
addTransferData: function(dragStartEvent : Event, item : DataTransferItem)
getAllTransferData: function(): {DataTransferItem}
end
record InputAction record InputActionState Disabled: InputActionState
Inactive: InputActionState
Enabled: InputActionState
end
record InvokeData record Status Triggered: Status
Repeat: Status
PressedStep: Status
EndReleased: Status
EndAborted: Status
end
status: Status
end
modifierOnlyActionIsActive: function(inputActionId : string): boolean
hasConflicts: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): string
findDuplicatesOf: function(inputActionId : string): {string}
getFixedKeyCmdDefs: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): {string : {KeyComboDef}}
end
record ById setVisibilityByClass: function(idOrTag : string, visible : boolean, idOnly : boolean)
setEnabled: function(idOrTag : string, enabled : boolean, idOnly : boolean)
setHighlighted: function(idOrTag : string, highlighted : boolean, style : HighlightStyle, color : Vec3f, idOnly : boolean)
isVisible: function(id : string): boolean
isVisibleRecursive: function(id : string): boolean
setVisible: function(id : string, visible : boolean)
resetMovedWindowPosition: function(id : string)
getSize: function(id : string): Vec2f
end
record Camera setManualCamera: function(center : Vec2f, distance : number)
getCameraData: function(): Vec5f
setCameraData: function(Vec5f : Vec5f)
getHeightAboveTerrain: function(): number
focusEntity: function(entity : Engine.Entity)
focusPosition: function(position : Vec3f, distance : number)
takeScreenshot: function(scale : integer)
getFollowEntity: function(): {Engine.Entity, Engine.Revision}
followEntity: function(entity : Engine.Entity, jump : boolean)
enterFollowCameraCockpit: function(entity : Engine.Entity)
leaveFollowCameraCockpit: function()
isFreeCameraMouseAttached: function(): boolean
toggleFreeCameraMouseAttachment: function()
toggleFreeCamera: function()
world2Screen: function(Vec3f): Vec2i
screen2World: function(Vec3f): Vec3f
getEye: function(): Vec3f
getCenter: function(): Vec3f
getNearFar: function(): Vec2f
getSize: function(): Vec2i
traceToTerrain: function(worldPos : Vec3f, farPos : Vec3f, zOffset : number, numSteps : integer): Vec3f | nil
end
record Sound letVehicleHorn: function(vehicleEntity : Engine.Entity)
playRandomSoundEffect: function(paths : {FilePath})
end
record MusicPlayer goBack: function()
goForward: function()
togglePause: function()
getTitle: function(): string
getArtist: function(): string
hasPlaylist: function(): boolean
getPlaylistIndex: function(): integer
setTrackListFromPlayList: function(playlist : string, startPaused : boolean, offset : number)
setPlaylist: function(playlist : string)
getPlaylist: function(): string
isPlaying: function(): boolean
playTrack: function(trackName : string, offset : number)
playTrackFile: function(filePath : string, offset : number)
getTrackLength: function(): number
getTrackElapsedTime: function(): number
getGain: function(): number
setGain: function(gain : number)
setTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean)
addTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean)
setContextTag: function(contextTag : string)
end
record VoiceOverManager stop: function()
play: function(voiceOverRes : string, delayInSeconds : number)
isPlaying: function(voiceOverRes : string): boolean
isPlayingAny: function(): boolean
getPlaying: function(): ResName
end
record ByEntity isLineEmptyOrVisible: function(Engine.Entity : Engine.Entity): boolean
isVisible: function(Engine.Entity : Engine.Entity): boolean
isVehicleVisible: function(Engine.Entity : Engine.Entity): boolean
end
record ContextHelper record SubjectState Visible: SubjectState
Focused: SubjectState
end
collectSubjectStates: function(idsOfInterest : {string}): {string : SubjectState}
getIdsOfActiveTool: function(): {string}
end
record Construction setAngle: function(angle : number)
modify: function(construction : Engine.Entity)
getBrushIcons: function(): {string}
provideDustWheneverPossible: function(proposal : Proposal, proposalData : ProposalData)
getRefundableEntities: function(): {{Engine.Entity, integer}, {Engine.Revision, integer}}
updateRefundableEntities: function(resultEntities : {Engine.Entity}, proposal : Proposal.StreetProposal)
end
record Mission getMission: function(): string
getCampaign: function(): string
setZone: function(key : string, polygon : {Vec2f}, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number)
setZoneCircle: function(key : string, center : Vec2f, radius : number, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number)
removeZone: function(key : string)
setMarkerAtPosition: function(key : string, pos : Vec3f, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean)
setMarkerAtEntity: function(key : string, entity : Engine.Entity, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean)
removeMarker: function(key : string)
setMovePathVisualizationAtEntity: function(key : string, entity : Engine.Entity, color : Vec3f)
removeMovePathVisualization: function(key : string)
playCutscene: function(filePath : string, resolveLanguageFolder : boolean, entityToEntityMap : {Engine.Entity : Engine.Entity})
isCutscenePlaying: function(): boolean
getCutsceneElapsedTime: function(): number
end
record Game isSavegameUIBlocked: function(): boolean
setInGameMenuPause: function(pause : boolean)
getGuiSaveData: function(modId : string): {<any type> : <any type>}
setGuiSaveData: function(modId : string, data : {<any type> : <any type>})
getEstimatedMaximumGameSpeed: function(): integer
isMapEditor: function(): boolean
getDefaultSavegameId: function(): string
setEnvironment: function(environment : ResName)
getEnvironment: function(): ResName
end
record Guide record GuidePosition Left: GuidePosition
Right: GuidePosition
Above: GuidePosition
Below: GuidePosition
end
record FreeGuidePosition High: FreeGuidePosition
Low: FreeGuidePosition
end
record GuideTarget new: function(string, GuidePosition): GuideTarget
idOrTag: string
position: GuidePosition
end
trySpawnGuideById: function({GuideTarget}, string, string): boolean
trySpawnGuideFree: function(FreeGuidePosition, string, string): boolean
completeGuideById: function({GuideTarget}): boolean
end
record Rendering setEnvironment: function(environment : Environment)
getEnvironment: function(): Environment
spawnDust: function(bbMin : Vec3f, bbMax : Vec3f, transf : Mat4f)
getFrameTime01: function(): number
end
record Map setMapSeedText: function(seed : string)
reloadMaterialIndexManagerPipeline: function()
openTerrainEditor: function()
closeTerrainEditor: function()
end
record BenchMark record SimTime frameTime: integer
gameTime: integer
end
getBeginFrameTimes: function(): {integer}
getEventTimes: function(): {integer}
getCoreStepTimes: function(): {integer}
getRenderTimes: function(): {integer}
getSwapTimes: function(): {integer}
getReplicateTimes: function(): {SimTime}
getCommandTimes: function(): {SimTime}
getGameStepTimes: function(): {SimTime}
end
record Debug selectEntity: function(entity : Engine.Entity)
end
record Achievements areStatsDisabled: function(): boolean
unlockAchievement: function(achievement : string)
isAchievementUnlockable: function(achievement : string): boolean
isAchievementUnlocked: function(achievement : string): boolean
updateStat: function(playerStat : string, value : number)
setStat: function(playerStat : string, value : number)
getStatValue: function(playerStat : string): number
setStatExtraData: function(playerStat : string, data : {<any type> : <any type>})
getStatExtraData: function(playerStat : string): {<any type> : <any type>}
setEarnedSFX: function(sfx : {FilePath})
end
record GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer}
end
record Backend record LegalDocument title: string
text: string
end
isInitialized: function(): boolean
hasLegalDocuments: function()
getLegalDocuments: function(): {PdxLegalDocumentType}
isAccountLoggedIn: function(): boolean
loginAccount: function(string, string): PdxFuture<PdxLoginResult>
logoutAccount: function(): PdxFuture<PdxResult>
getAccountInfo: function(): PdxFuture<PdxAccountInfo>
getProfile: function(boolean): PdxFuture<PdxProfileResult>
createProfile: function(string, boolean): PdxFuture<PdxResult>
renameProfile: function(string, boolean): PdxFuture<PdxResult>
getCountries: function(): {PdxCountry}
getLegalDocument: function(PdxLegalDocumentType): PdxFuture<PdxLegalDocument>
createAccount: function(string, string, string, integer, boolean): PdxFuture<PdxResult>
supportsAccountLinking: function(): boolean
getThirdPartyLinkState: function(): PdxFuture<PdxThirdPartyLinkState>
getThirdPartyAutoLoginPromptState: function(): PdxThirdPartyAutoLoginPromptState
setThirdPartyAutoLoginPromptState: function(PdxThirdPartyAutoLoginPromptState)
linkThirdPartyAccount: function(): PdxFuture<PdxResult>
unlinkThirdPartyAccount: function(): PdxFuture<PdxResult>
loginThirdPartyAccount: function(): PdxFuture<PdxLoginResult>
end
mouse: Mouse
key: Key
dnd: DnD
inputAction: InputAction
byId: ById
camera: Camera
sound: Sound
musicPlayer: MusicPlayer
backend: Backend
voiceOverManager: VoiceOverManager
byEntity: ByEntity
contextHelper: ContextHelper
construction: Construction
mission: Mission
guide: Guide
game: Game
map: Map
benchMark: BenchMark
rendering: Rendering
debug: Debug
achievements: Achievements
genericRep: GenericRep
StyleSheet: StyleSheet
NinePatch: NinePatch
end
global record NinePatch new: function(): NinePatch
fileName: string
horizontal: {integer}
vertical: {integer}
flipHorizontally: boolean
repeatHorizontally: boolean
repeatVertically: boolean
repeatFactor: number
end
global record StyleSheet new: function(): StyleSheet
backgroundColor: Vec4f
backgroundColor1: Vec4f
backgroundColor2: Vec4f
backgroundImage1: NinePatch
backgroundImage2: NinePatch
borderWidth: Vec4f
borderColor: Vec4f
color: Vec4f
size: Vec2f
padding: Vec4f
fontSize: integer
borderImage: NinePatch
anchorPoint: Vec2f
end
```
## Category: main[🔗](#category-main)
### Gui[🔗](#$api.gui~Gui)
```
[Expand All] [Collapse All]
global record Gui fireReactEvent: function(name : string, param : any)
fireGuiScriptEvent: function(id : string, name : string, param : any): any
record HighlightStyle Square: HighlightStyle
Circle: HighlightStyle
end
record SpawnHudImageParams iconPath: FilePath
color: Vec4f
entity: Engine.Entity
position: Vec3f
end
spawnEphemeralHudImage: function(iconPath : FilePath, entity : Engine.Entity, color : Vec4f, position : Vec3f, overrideDuration : number, fadeIn : boolean, fadeOut : boolean, rev0 : integer)
spawnEphemeralHudImageOnPath: function(iconPath : FilePath, pos0 : Vec3f, pos1 : Vec3f, pos0 : Vec3f, pos1 : Vec3f, speed : number, scale : number, maxDistance : number)
closeAllWindows: function()
record SelectionDetails new: function(): SelectionDetails
record Type None: Type
Line: Type
Station: Type
Signal: Type
Stop: Type
Waypoint: Type
TransportNetworkEdge: Type
World: Type
Marker: Type
Town: Type
end
interface DataType kind: Type
end
record Line line: Engine.Entity
stop: integer
waypoint: integer
end
record Station new: function(): Station
stationGroup: Engine.Entity
flatStationTerminalIndex: integer
stationTerminal: StationTerminal
end
record Signal signalList: Engine.Entity
signalIndex: integer
end
record Stop new: function(): Stop
station: SelectionDetails.Station
line: Engine.Entity
stopIndex: integer
end
record Waypoint line: Engine.Entity
stopIndex: integer
waypointIndex: integer
tag: integer
end
record TransportNetworkEdge new: function(): TransportNetworkEdge
snap: EdgePos
end
record World new: function(): World
pos: Vec3f
water: boolean
end
record Marker new: function(): Marker
marker: string
fireSelectEntity: boolean
pos: Vec3f
entity: Engine.Entity
end
record Town new: function(): Town
townEntity: Engine.Entity
districtType: LandUseType
districtCenter: Vec3f
end
data: DataType
end
record WorldEvent pos: {number, number, number}
water: boolean
end
record Mouse record Event record Type Pressed: Type
Released: Type
Clicked: Type
Entered: Type
Exited: Type
Moved: Type
Wheel: Type
DoubleClicked: Type
PressedOutside: Type
end
type: Type
button: integer
x: integer
y: integer
xrel: integer
yrel: integer
handled: boolean
end
getTerrainPosition: function(): Vec3f
hasTerrainPosition: function(): boolean
end
record Key record State Up: State
Pressed: State
end
record InputEvent dir: State
repeated: boolean
isGamepadEvent: function(InputEvent): boolean
isKeyboardEvent: function(InputEvent): boolean
getKey: function(InputEvent): integer
getKeyMod: function(InputEvent): integer
end
record Event data: InputEvent
isPressed: function(Event): boolean
end
end
record DataTransferItem new: function(ResName, any): DataTransferItem
type: ResName
data: any
end
record DnD record Event record Type Drop: Type
DragStarted: Type
DragEntered: Type
DragExited: Type
end
type: Type
end
setCursor: function(cursor : integer)
addTransferData: function(dragStartEvent : Event, item : DataTransferItem)
getAllTransferData: function(): {DataTransferItem}
end
record InputAction record InputActionState Disabled: InputActionState
Inactive: InputActionState
Enabled: InputActionState
end
record InvokeData record Status Triggered: Status
Repeat: Status
PressedStep: Status
EndReleased: Status
EndAborted: Status
end
status: Status
end
modifierOnlyActionIsActive: function(inputActionId : string): boolean
hasConflicts: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): string
findDuplicatesOf: function(inputActionId : string): {string}
getFixedKeyCmdDefs: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): {string : {KeyComboDef}}
end
record ById setVisibilityByClass: function(idOrTag : string, visible : boolean, idOnly : boolean)
setEnabled: function(idOrTag : string, enabled : boolean, idOnly : boolean)
setHighlighted: function(idOrTag : string, highlighted : boolean, style : HighlightStyle, color : Vec3f, idOnly : boolean)
isVisible: function(id : string): boolean
isVisibleRecursive: function(id : string): boolean
setVisible: function(id : string, visible : boolean)
resetMovedWindowPosition: function(id : string)
getSize: function(id : string): Vec2f
end
record Camera setManualCamera: function(center : Vec2f, distance : number)
getCameraData: function(): Vec5f
setCameraData: function(Vec5f : Vec5f)
getHeightAboveTerrain: function(): number
focusEntity: function(entity : Engine.Entity)
focusPosition: function(position : Vec3f, distance : number)
takeScreenshot: function(scale : integer)
getFollowEntity: function(): {Engine.Entity, Engine.Revision}
followEntity: function(entity : Engine.Entity, jump : boolean)
enterFollowCameraCockpit: function(entity : Engine.Entity)
leaveFollowCameraCockpit: function()
isFreeCameraMouseAttached: function(): boolean
toggleFreeCameraMouseAttachment: function()
toggleFreeCamera: function()
world2Screen: function(Vec3f): Vec2i
screen2World: function(Vec3f): Vec3f
getEye: function(): Vec3f
getCenter: function(): Vec3f
getNearFar: function(): Vec2f
getSize: function(): Vec2i
traceToTerrain: function(worldPos : Vec3f, farPos : Vec3f, zOffset : number, numSteps : integer): Vec3f | nil
end
record Sound letVehicleHorn: function(vehicleEntity : Engine.Entity)
playRandomSoundEffect: function(paths : {FilePath})
end
record MusicPlayer goBack: function()
goForward: function()
togglePause: function()
getTitle: function(): string
getArtist: function(): string
hasPlaylist: function(): boolean
getPlaylistIndex: function(): integer
setTrackListFromPlayList: function(playlist : string, startPaused : boolean, offset : number)
setPlaylist: function(playlist : string)
getPlaylist: function(): string
isPlaying: function(): boolean
playTrack: function(trackName : string, offset : number)
playTrackFile: function(filePath : string, offset : number)
getTrackLength: function(): number
getTrackElapsedTime: function(): number
getGain: function(): number
setGain: function(gain : number)
setTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean)
addTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean)
setContextTag: function(contextTag : string)
end
record VoiceOverManager stop: function()
play: function(voiceOverRes : string, delayInSeconds : number)
isPlaying: function(voiceOverRes : string): boolean
isPlayingAny: function(): boolean
getPlaying: function(): ResName
end
record ByEntity isLineEmptyOrVisible: function(Engine.Entity : Engine.Entity): boolean
isVisible: function(Engine.Entity : Engine.Entity): boolean
isVehicleVisible: function(Engine.Entity : Engine.Entity): boolean
end
record ContextHelper record SubjectState Visible: SubjectState
Focused: SubjectState
end
collectSubjectStates: function(idsOfInterest : {string}): {string : SubjectState}
getIdsOfActiveTool: function(): {string}
end
record Construction setAngle: function(angle : number)
modify: function(construction : Engine.Entity)
getBrushIcons: function(): {string}
provideDustWheneverPossible: function(proposal : Proposal, proposalData : ProposalData)
getRefundableEntities: function(): {{Engine.Entity, integer}, {Engine.Revision, integer}}
updateRefundableEntities: function(resultEntities : {Engine.Entity}, proposal : Proposal.StreetProposal)
end
record Mission getMission: function(): string
getCampaign: function(): string
setZone: function(key : string, polygon : {Vec2f}, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number)
setZoneCircle: function(key : string, center : Vec2f, radius : number, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number)
removeZone: function(key : string)
setMarkerAtPosition: function(key : string, pos : Vec3f, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean)
setMarkerAtEntity: function(key : string, entity : Engine.Entity, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean)
removeMarker: function(key : string)
setMovePathVisualizationAtEntity: function(key : string, entity : Engine.Entity, color : Vec3f)
removeMovePathVisualization: function(key : string)
playCutscene: function(filePath : string, resolveLanguageFolder : boolean, entityToEntityMap : {Engine.Entity : Engine.Entity})
isCutscenePlaying: function(): boolean
getCutsceneElapsedTime: function(): number
end
record Game isSavegameUIBlocked: function(): boolean
setInGameMenuPause: function(pause : boolean)
getGuiSaveData: function(modId : string): {<any type> : <any type>}
setGuiSaveData: function(modId : string, data : {<any type> : <any type>})
getEstimatedMaximumGameSpeed: function(): integer
isMapEditor: function(): boolean
getDefaultSavegameId: function(): string
setEnvironment: function(environment : ResName)
getEnvironment: function(): ResName
end
record Guide record GuidePosition Left: GuidePosition
Right: GuidePosition
Above: GuidePosition
Below: GuidePosition
end
record FreeGuidePosition High: FreeGuidePosition
Low: FreeGuidePosition
end
record GuideTarget new: function(string, GuidePosition): GuideTarget
idOrTag: string
position: GuidePosition
end
trySpawnGuideById: function({GuideTarget}, string, string): boolean
trySpawnGuideFree: function(FreeGuidePosition, string, string): boolean
completeGuideById: function({GuideTarget}): boolean
end
record Rendering setEnvironment: function(environment : Environment)
getEnvironment: function(): Environment
spawnDust: function(bbMin : Vec3f, bbMax : Vec3f, transf : Mat4f)
getFrameTime01: function(): number
end
record Map setMapSeedText: function(seed : string)
reloadMaterialIndexManagerPipeline: function()
openTerrainEditor: function()
closeTerrainEditor: function()
end
record BenchMark record SimTime frameTime: integer
gameTime: integer
end
getBeginFrameTimes: function(): {integer}
getEventTimes: function(): {integer}
getCoreStepTimes: function(): {integer}
getRenderTimes: function(): {integer}
getSwapTimes: function(): {integer}
getReplicateTimes: function(): {SimTime}
getCommandTimes: function(): {SimTime}
getGameStepTimes: function(): {SimTime}
end
record Debug selectEntity: function(entity : Engine.Entity)
end
record Achievements areStatsDisabled: function(): boolean
unlockAchievement: function(achievement : string)
isAchievementUnlockable: function(achievement : string): boolean
isAchievementUnlocked: function(achievement : string): boolean
updateStat: function(playerStat : string, value : number)
setStat: function(playerStat : string, value : number)
getStatValue: function(playerStat : string): number
setStatExtraData: function(playerStat : string, data : {<any type> : <any type>})
getStatExtraData: function(playerStat : string): {<any type> : <any type>}
setEarnedSFX: function(sfx : {FilePath})
end
record GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer}
end
record Backend record LegalDocument title: string
text: string
end
isInitialized: function(): boolean
hasLegalDocuments: function()
getLegalDocuments: function(): {PdxLegalDocumentType}
isAccountLoggedIn: function(): boolean
loginAccount: function(string, string): PdxFuture<PdxLoginResult>
logoutAccount: function(): PdxFuture<PdxResult>
getAccountInfo: function(): PdxFuture<PdxAccountInfo>
getProfile: function(boolean): PdxFuture<PdxProfileResult>
createProfile: function(string, boolean): PdxFuture<PdxResult>
renameProfile: function(string, boolean): PdxFuture<PdxResult>
getCountries: function(): {PdxCountry}
getLegalDocument: function(PdxLegalDocumentType): PdxFuture<PdxLegalDocument>
createAccount: function(string, string, string, integer, boolean): PdxFuture<PdxResult>
supportsAccountLinking: function(): boolean
getThirdPartyLinkState: function(): PdxFuture<PdxThirdPartyLinkState>
getThirdPartyAutoLoginPromptState: function(): PdxThirdPartyAutoLoginPromptState
setThirdPartyAutoLoginPromptState: function(PdxThirdPartyAutoLoginPromptState)
linkThirdPartyAccount: function(): PdxFuture<PdxResult>
unlinkThirdPartyAccount: function(): PdxFuture<PdxResult>
loginThirdPartyAccount: function(): PdxFuture<PdxLoginResult>
end
mouse: Mouse
key: Key
dnd: DnD
inputAction: InputAction
byId: ById
camera: Camera
sound: Sound
musicPlayer: MusicPlayer
backend: Backend
voiceOverManager: VoiceOverManager
byEntity: ByEntity
contextHelper: ContextHelper
construction: Construction
mission: Mission
guide: Guide
game: Game
map: Map
benchMark: BenchMark
rendering: Rendering
debug: Debug
achievements: Achievements
genericRep: GenericRep
StyleSheet: StyleSheet
NinePatch: NinePatch
end
```
Main GUI interface
### Gui.fireReactEvent[🔗](#$api.gui~Gui.fireReactEvent)
```
function Gui.fireReactEvent(name : string, param : any)
```
Fire a react event (same as react.fireEvent() but from outside of react)
**Parameters**
* `name` :`string` — the event name
* `param` :`any` — the event parameter
### Gui.fireGuiScriptEvent[🔗](#$api.gui~Gui.fireGuiScriptEvent)
```
function Gui.fireGuiScriptEvent(id : string, name : string, param : any): any
```
Fire a game gui script event.
This event is meant to be handled by game scripts (guiHandleEvent), not by react.onEvent().
It differs from react.fireEvent in that it allows to return a value (like an error string to prevent the operation)
**Parameters**
* `id` :`string` — the component id
* `name` :`string` — the event name
* `param` :`any` — event-specific parameters
**Returns**
1. `any` — the result from the event handler
### Gui.HighlightStyle[🔗](#$api.gui~Gui.HighlightStyle)
```
record Gui.HighlightStyle Square: HighlightStyle
Circle: HighlightStyle
end
```
### Gui.HighlightStyle.Square[🔗](#$api.gui~Gui.HighlightStyle.Square)
```
Gui.HighlightStyle.Square: HighlightStyle
```
### Gui.HighlightStyle.Circle[🔗](#$api.gui~Gui.HighlightStyle.Circle)
```
Gui.HighlightStyle.Circle: HighlightStyle
```
### Gui.SpawnHudImageParams[🔗](#$api.gui~Gui.SpawnHudImageParams)
```
record Gui.SpawnHudImageParams iconPath: FilePath
color: Vec4f
entity: Engine.Entity
position: Vec3f
end
```
### Gui.SpawnHudImageParams.iconPath[🔗](#$api.gui~Gui.SpawnHudImageParams.iconPath)
```
Gui.SpawnHudImageParams.iconPath: FilePath
```
Mandatory path to the icon
### Gui.SpawnHudImageParams.color[🔗](#$api.gui~Gui.SpawnHudImageParams.color)
```
Gui.SpawnHudImageParams.color: Vec4f
```
Optional color. If set, the icon is expected to be grayscale.
### Gui.SpawnHudImageParams.entity[🔗](#$api.gui~Gui.SpawnHudImageParams.entity)
```
Gui.SpawnHudImageParams.entity: Engine.Entity
```
Optional entity (if not used, specify position)
### Gui.SpawnHudImageParams.position[🔗](#$api.gui~Gui.SpawnHudImageParams.position)
```
Gui.SpawnHudImageParams.position: Vec3f
```
Optional position (if not used, position of the entity is used)
### Gui.spawnEphemeralHudImage[🔗](#$api.gui~Gui.spawnEphemeralHudImage)
```
function Gui.spawnEphemeralHudImage(iconPath : FilePath, entity : Engine.Entity, color : Vec4f, position : Vec3f, overrideDuration : number, fadeIn : boolean, fadeOut : boolean, rev0 : integer)
```
Spawn a short-lived floating image as a hud-icon
**Parameters**
* `iconPath` :`FilePath` — The icon to be used
* `entity` :`Engine.Entity` — Optional entity (if not used, you must specify position instead)
* `color` :`Vec4f` — Optional color (if not used, the icon is expected to have color channels)
* `position` :`Vec3f` — Optional position (if not used, position is obtained from the entity)
* `overrideDuration` :`number` — Optional duration in seconds
* `fadeIn` :`boolean` — Optional: Start invisible and fade in (default: false)
* `fadeOut` :`boolean` — Optional: Slowly fade out at the end (default: true)
* `rev0` :`integer` — Optional revision0 (if not used, defaults to api.engine.getRevision(entity).num[1])
### Gui.spawnEphemeralHudImageOnPath[🔗](#$api.gui~Gui.spawnEphemeralHudImageOnPath)
```
function Gui.spawnEphemeralHudImageOnPath(iconPath : FilePath, pos0 : Vec3f, pos1 : Vec3f, pos0 : Vec3f, pos1 : Vec3f, speed : number, scale : number, maxDistance : number)
```
Spawns a short icon that follows a path
**Parameters**
* `iconPath` :`FilePath` — The icon to be used
* `pos0` :`Vec3f` — The starting position of the icon
* `pos1` :`Vec3f` — The end position of the icon
* `pos0` :`Vec3f` — The starting tangent of the icon
* `pos1` :`Vec3f` — The end tangent of the icon
* `speed` :`number` — The speed (in m/s) of the icon
* `scale` :`number` — A scaling factor for the size of the icon
* `maxDistance` :`number` — The maximal distance at which the icon will be rendered
### Gui.closeAllWindows[🔗](#$api.gui~Gui.closeAllWindows)
```
function Gui.closeAllWindows()
```
Close all windows
### Gui.SelectionDetails[🔗](#$api.gui~Gui.SelectionDetails)
```
[Expand All] [Collapse All]
record Gui.SelectionDetails new: function(): SelectionDetails
record Type None: Type
Line: Type
Station: Type
Signal: Type
Stop: Type
Waypoint: Type
TransportNetworkEdge: Type
World: Type
Marker: Type
Town: Type
end
interface DataType kind: Type
end
record Line line: Engine.Entity
stop: integer
waypoint: integer
end
record Station new: function(): Station
stationGroup: Engine.Entity
flatStationTerminalIndex: integer
stationTerminal: StationTerminal
end
record Signal signalList: Engine.Entity
signalIndex: integer
end
record Stop new: function(): Stop
station: SelectionDetails.Station
line: Engine.Entity
stopIndex: integer
end
record Waypoint line: Engine.Entity
stopIndex: integer
waypointIndex: integer
tag: integer
end
record TransportNetworkEdge new: function(): TransportNetworkEdge
snap: EdgePos
end
record World new: function(): World
pos: Vec3f
water: boolean
end
record Marker new: function(): Marker
marker: string
fireSelectEntity: boolean
pos: Vec3f
entity: Engine.Entity
end
record Town new: function(): Town
townEntity: Engine.Entity
districtType: LandUseType
districtCenter: Vec3f
end
data: DataType
end
```
Carries details about selection event
### Gui.SelectionDetails.new()[🔗](#$api.gui~Gui.SelectionDetails.new())
```
function Gui.SelectionDetails.new()(): SelectionDetails
```
**Returns**
1. `SelectionDetails`
### Gui.SelectionDetails.new(SelectionDetails)[🔗](#$api.gui~Gui.SelectionDetails.new(SelectionDetails))
```
function Gui.SelectionDetails.new(SelectionDetails)(SelectionDetails): SelectionDetails
```
**Parameters**
* `SelectionDetails`
**Returns**
1. `SelectionDetails`
### Gui.SelectionDetails.Type[🔗](#$api.gui~Gui.SelectionDetails.Type)
```
record Gui.SelectionDetails.Type None: Type
Line: Type
Station: Type
Signal: Type
Stop: Type
Waypoint: Type
TransportNetworkEdge: Type
World: Type
Marker: Type
Town: Type
end
```
### Gui.SelectionDetails.Type.None[🔗](#$api.gui~Gui.SelectionDetails.Type.None)
```
Gui.SelectionDetails.Type.None: Type
```
### Gui.SelectionDetails.Type.Line[🔗](#$api.gui~Gui.SelectionDetails.Type.Line)
```
Gui.SelectionDetails.Type.Line: Type
```
### Gui.SelectionDetails.Type.Station[🔗](#$api.gui~Gui.SelectionDetails.Type.Station)
```
Gui.SelectionDetails.Type.Station: Type
```
### Gui.SelectionDetails.Type.Signal[🔗](#$api.gui~Gui.SelectionDetails.Type.Signal)
```
Gui.SelectionDetails.Type.Signal: Type
```
### Gui.SelectionDetails.Type.Stop[🔗](#$api.gui~Gui.SelectionDetails.Type.Stop)
```
Gui.SelectionDetails.Type.Stop: Type
```
### Gui.SelectionDetails.Type.Waypoint[🔗](#$api.gui~Gui.SelectionDetails.Type.Waypoint)
```
Gui.SelectionDetails.Type.Waypoint: Type
```
### Gui.SelectionDetails.Type.TransportNetworkEdge[🔗](#$api.gui~Gui.SelectionDetails.Type.TransportNetworkEdge)
```
Gui.SelectionDetails.Type.TransportNetworkEdge: Type
```
### Gui.SelectionDetails.Type.World[🔗](#$api.gui~Gui.SelectionDetails.Type.World)
```
Gui.SelectionDetails.Type.World: Type
```
### Gui.SelectionDetails.Type.Marker[🔗](#$api.gui~Gui.SelectionDetails.Type.Marker)
```
Gui.SelectionDetails.Type.Marker: Type
```
### Gui.SelectionDetails.Type.Town[🔗](#$api.gui~Gui.SelectionDetails.Type.Town)
```
Gui.SelectionDetails.Type.Town: Type
```
### Gui.SelectionDetails.DataType[🔗](#$api.gui~Gui.SelectionDetails.DataType)
```
interface Gui.SelectionDetails.DataType kind: Type
end
```
### Gui.SelectionDetails.DataType.kind[🔗](#$api.gui~Gui.SelectionDetails.DataType.kind)
```
Gui.SelectionDetails.DataType.kind: Type
```
### Gui.SelectionDetails.Line[🔗](#$api.gui~Gui.SelectionDetails.Line)
```
record Gui.SelectionDetails.Line line: Engine.Entity
stop: integer
waypoint: integer
end
```
Carries details about selection event for a Line.
### Gui.SelectionDetails.Line.line[🔗](#$api.gui~Gui.SelectionDetails.Line.line)
```
Gui.SelectionDetails.Line.line: Engine.Entity
```
The line entity
### Gui.SelectionDetails.Line.stop[🔗](#$api.gui~Gui.SelectionDetails.Line.stop)
```
Gui.SelectionDetails.Line.stop: integer
```
Stop index where the selected line segment starts
### Gui.SelectionDetails.Line.waypoint[🔗](#$api.gui~Gui.SelectionDetails.Line.waypoint)
```
Gui.SelectionDetails.Line.waypoint: integer
```
Waypoint index identifying the selected subsegment (-1: no waypoints, 0 = begins at stop, numWaypoints = ends at next stop)
### Gui.SelectionDetails.Station[🔗](#$api.gui~Gui.SelectionDetails.Station)
```
record Gui.SelectionDetails.Station new: function(): Station
stationGroup: Engine.Entity
flatStationTerminalIndex: integer
stationTerminal: StationTerminal
end
```
Carries details about selection event for a Station, StationGroup or Terminal
### Gui.SelectionDetails.Station.new[🔗](#$api.gui~Gui.SelectionDetails.Station.new)
```
function Gui.SelectionDetails.Station.new(): Station
```
**Returns**
1. `Station`
### Gui.SelectionDetails.Station.stationGroup[🔗](#$api.gui~Gui.SelectionDetails.Station.stationGroup)
```
Gui.SelectionDetails.Station.stationGroup: Engine.Entity
```
The station group entity
### Gui.SelectionDetails.Station.flatStationTerminalIndex[🔗](#$api.gui~Gui.SelectionDetails.Station.flatStationTerminalIndex)
```
Gui.SelectionDetails.Station.flatStationTerminalIndex: integer
```
Index in the the StationGroup's flattened list of station/terminals
### Gui.SelectionDetails.Station.stationTerminal[🔗](#$api.gui~Gui.SelectionDetails.Station.stationTerminal)
```
Gui.SelectionDetails.Station.stationTerminal: StationTerminal
```
### Gui.SelectionDetails.Signal[🔗](#$api.gui~Gui.SelectionDetails.Signal)
```
record Gui.SelectionDetails.Signal signalList: Engine.Entity
signalIndex: integer
end
```
Carries details about selection event for a Signal
### Gui.SelectionDetails.Signal.signalList[🔗](#$api.gui~Gui.SelectionDetails.Signal.signalList)
```
Gui.SelectionDetails.Signal.signalList: Engine.Entity
```
The signalList entity
### Gui.SelectionDetails.Signal.signalIndex[🔗](#$api.gui~Gui.SelectionDetails.Signal.signalIndex)
```
Gui.SelectionDetails.Signal.signalIndex: integer
```
Index of the actual signal in the the SignalList
### Gui.SelectionDetails.Stop[🔗](#$api.gui~Gui.SelectionDetails.Stop)
```
record Gui.SelectionDetails.Stop new: function(): Stop
station: SelectionDetails.Station
line: Engine.Entity
stopIndex: integer
end
```
Carries details about selection event for a Stop (terminal) inside a line
### Gui.SelectionDetails.Stop.new[🔗](#$api.gui~Gui.SelectionDetails.Stop.new)
```
function Gui.SelectionDetails.Stop.new(): Stop
```
**Returns**
1. `Stop`
### Gui.SelectionDetails.Stop.station[🔗](#$api.gui~Gui.SelectionDetails.Stop.station)
```
Gui.SelectionDetails.Stop.station: SelectionDetails.Station
```
The station / terminal
### Gui.SelectionDetails.Stop.line[🔗](#$api.gui~Gui.SelectionDetails.Stop.line)
```
Gui.SelectionDetails.Stop.line: Engine.Entity
```
The line entity
### Gui.SelectionDetails.Stop.stopIndex[🔗](#$api.gui~Gui.SelectionDetails.Stop.stopIndex)
```
Gui.SelectionDetails.Stop.stopIndex: integer
```
Index of the stop in the line
### Gui.SelectionDetails.Waypoint[🔗](#$api.gui~Gui.SelectionDetails.Waypoint)
```
record Gui.SelectionDetails.Waypoint line: Engine.Entity
stopIndex: integer
waypointIndex: integer
tag: integer
end
```
Carries details about selection event for a waypoint inside a line
### Gui.SelectionDetails.Waypoint.line[🔗](#$api.gui~Gui.SelectionDetails.Waypoint.line)
```
Gui.SelectionDetails.Waypoint.line: Engine.Entity
```
The line entity
### Gui.SelectionDetails.Waypoint.stopIndex[🔗](#$api.gui~Gui.SelectionDetails.Waypoint.stopIndex)
```
Gui.SelectionDetails.Waypoint.stopIndex: integer
```
Index of the stop in the line
### Gui.SelectionDetails.Waypoint.waypointIndex[🔗](#$api.gui~Gui.SelectionDetails.Waypoint.waypointIndex)
```
Gui.SelectionDetails.Waypoint.waypointIndex: integer
```
Index of the waypoint in the line (index in stop.waypoints)
### Gui.SelectionDetails.Waypoint.tag[🔗](#$api.gui~Gui.SelectionDetails.Waypoint.tag)
```
Gui.SelectionDetails.Waypoint.tag: integer
```
### Gui.SelectionDetails.TransportNetworkEdge[🔗](#$api.gui~Gui.SelectionDetails.TransportNetworkEdge)
```
record Gui.SelectionDetails.TransportNetworkEdge new: function(): TransportNetworkEdge
snap: EdgePos
end
```
Carries details about selection event for a Transport Network Edge
### Gui.SelectionDetails.TransportNetworkEdge.new[🔗](#$api.gui~Gui.SelectionDetails.TransportNetworkEdge.new)
```
function Gui.SelectionDetails.TransportNetworkEdge.new(): TransportNetworkEdge
```
**Returns**
1. `TransportNetworkEdge`
### Gui.SelectionDetails.TransportNetworkEdge.snap[🔗](#$api.gui~Gui.SelectionDetails.TransportNetworkEdge.snap)
```
Gui.SelectionDetails.TransportNetworkEdge.snap: EdgePos
```
### Gui.SelectionDetails.World[🔗](#$api.gui~Gui.SelectionDetails.World)
```
record Gui.SelectionDetails.World new: function(): World
pos: Vec3f
water: boolean
end
```
Carries details about the cursor location in the world.
### Gui.SelectionDetails.World.new[🔗](#$api.gui~Gui.SelectionDetails.World.new)
```
function Gui.SelectionDetails.World.new(): World
```
**Returns**
1. `World`
### Gui.SelectionDetails.World.pos[🔗](#$api.gui~Gui.SelectionDetails.World.pos)
```
Gui.SelectionDetails.World.pos: Vec3f
```
### Gui.SelectionDetails.World.water[🔗](#$api.gui~Gui.SelectionDetails.World.water)
```
Gui.SelectionDetails.World.water: boolean
```
### Gui.SelectionDetails.Marker[🔗](#$api.gui~Gui.SelectionDetails.Marker)
```
record Gui.SelectionDetails.Marker new: function(): Marker
marker: string
fireSelectEntity: boolean
pos: Vec3f
entity: Engine.Entity
end
```
Carries details about selection event for a Marker.
### Gui.SelectionDetails.Marker.new[🔗](#$api.gui~Gui.SelectionDetails.Marker.new)
```
function Gui.SelectionDetails.Marker.new(): Marker
```
**Returns**
1. `Marker`
### Gui.SelectionDetails.Marker.marker[🔗](#$api.gui~Gui.SelectionDetails.Marker.marker)
```
Gui.SelectionDetails.Marker.marker: string
```
### Gui.SelectionDetails.Marker.fireSelectEntity[🔗](#$api.gui~Gui.SelectionDetails.Marker.fireSelectEntity)
```
Gui.SelectionDetails.Marker.fireSelectEntity: boolean
```
If true, select the underlying entity of the marker (default = true)
### Gui.SelectionDetails.Marker.pos[🔗](#$api.gui~Gui.SelectionDetails.Marker.pos)
```
Gui.SelectionDetails.Marker.pos: Vec3f
```
Get the marker position (if it is a position marker)
### Gui.SelectionDetails.Marker.entity[🔗](#$api.gui~Gui.SelectionDetails.Marker.entity)
```
Gui.SelectionDetails.Marker.entity: Engine.Entity
```
Get the marked entity (if it is an entity marker)
### Gui.SelectionDetails.Town[🔗](#$api.gui~Gui.SelectionDetails.Town)
```
record Gui.SelectionDetails.Town new: function(): Town
townEntity: Engine.Entity
districtType: LandUseType
districtCenter: Vec3f
end
```
Carries details about selection event for a Town.
### Gui.SelectionDetails.Town.new[🔗](#$api.gui~Gui.SelectionDetails.Town.new)
```
function Gui.SelectionDetails.Town.new(): Town
```
**Returns**
1. `Town`
### Gui.SelectionDetails.Town.townEntity[🔗](#$api.gui~Gui.SelectionDetails.Town.townEntity)
```
Gui.SelectionDetails.Town.townEntity: Engine.Entity
```
### Gui.SelectionDetails.Town.districtType[🔗](#$api.gui~Gui.SelectionDetails.Town.districtType)
```
Gui.SelectionDetails.Town.districtType: LandUseType
```
### Gui.SelectionDetails.Town.districtCenter[🔗](#$api.gui~Gui.SelectionDetails.Town.districtCenter)
```
Gui.SelectionDetails.Town.districtCenter: Vec3f
```
### Gui.SelectionDetails.data[🔗](#$api.gui~Gui.SelectionDetails.data)
```
Gui.SelectionDetails.data: DataType
```
### Gui.WorldEvent[🔗](#$api.gui~Gui.WorldEvent)
```
record Gui.WorldEvent pos: {number, number, number}
water: boolean
end
```
### Gui.WorldEvent.pos[🔗](#$api.gui~Gui.WorldEvent.pos)
```
Gui.WorldEvent.pos: {number, number, number}
```
### Gui.WorldEvent.water[🔗](#$api.gui~Gui.WorldEvent.water)
```
Gui.WorldEvent.water: boolean
```
### Gui.Mouse[🔗](#$api.gui~Gui.Mouse)
```
[Expand All] [Collapse All]
record Gui.Mouse record Event record Type Pressed: Type
Released: Type
Clicked: Type
Entered: Type
Exited: Type
Moved: Type
Wheel: Type
DoubleClicked: Type
PressedOutside: Type
end
type: Type
button: integer
x: integer
y: integer
xrel: integer
yrel: integer
handled: boolean
end
getTerrainPosition: function(): Vec3f
hasTerrainPosition: function(): boolean
end
```
### Gui.Mouse.Event[🔗](#$api.gui~Gui.Mouse.Event)
```
[Expand All] [Collapse All]
record Gui.Mouse.Event record Type Pressed: Type
Released: Type
Clicked: Type
Entered: Type
Exited: Type
Moved: Type
Wheel: Type
DoubleClicked: Type
PressedOutside: Type
end
type: Type
button: integer
x: integer
y: integer
xrel: integer
yrel: integer
handled: boolean
end
```
Represents a mouse event
### Gui.Mouse.Event.Type[🔗](#$api.gui~Gui.Mouse.Event.Type)
```
record Gui.Mouse.Event.Type Pressed: Type
Released: Type
Clicked: Type
Entered: Type
Exited: Type
Moved: Type
Wheel: Type
DoubleClicked: Type
PressedOutside: Type
end
```
### Gui.Mouse.Event.Type.Pressed[🔗](#$api.gui~Gui.Mouse.Event.Type.Pressed)
```
Gui.Mouse.Event.Type.Pressed: Type
```
### Gui.Mouse.Event.Type.Released[🔗](#$api.gui~Gui.Mouse.Event.Type.Released)
```
Gui.Mouse.Event.Type.Released: Type
```
### Gui.Mouse.Event.Type.Clicked[🔗](#$api.gui~Gui.Mouse.Event.Type.Clicked)
```
Gui.Mouse.Event.Type.Clicked: Type
```
### Gui.Mouse.Event.Type.Entered[🔗](#$api.gui~Gui.Mouse.Event.Type.Entered)
```
Gui.Mouse.Event.Type.Entered: Type
```
### Gui.Mouse.Event.Type.Exited[🔗](#$api.gui~Gui.Mouse.Event.Type.Exited)
```
Gui.Mouse.Event.Type.Exited: Type
```
### Gui.Mouse.Event.Type.Moved[🔗](#$api.gui~Gui.Mouse.Event.Type.Moved)
```
Gui.Mouse.Event.Type.Moved: Type
```
### Gui.Mouse.Event.Type.Wheel[🔗](#$api.gui~Gui.Mouse.Event.Type.Wheel)
```
Gui.Mouse.Event.Type.Wheel: Type
```
### Gui.Mouse.Event.Type.DoubleClicked[🔗](#$api.gui~Gui.Mouse.Event.Type.DoubleClicked)
```
Gui.Mouse.Event.Type.DoubleClicked: Type
```
### Gui.Mouse.Event.Type.PressedOutside[🔗](#$api.gui~Gui.Mouse.Event.Type.PressedOutside)
```
Gui.Mouse.Event.Type.PressedOutside: Type
```
### Gui.Mouse.Event.type[🔗](#$api.gui~Gui.Mouse.Event.type)
```
Gui.Mouse.Event.type: Type
```
Event type.
### Gui.Mouse.Event.button[🔗](#$api.gui~Gui.Mouse.Event.button)
```
Gui.Mouse.Event.button: integer
```
Mouse button: 0 = left, 1 = middle, 2 = right.
### Gui.Mouse.Event.x[🔗](#$api.gui~Gui.Mouse.Event.x)
```
Gui.Mouse.Event.x: integer
```
Horizontal position of the mouse when event was triggered
### Gui.Mouse.Event.y[🔗](#$api.gui~Gui.Mouse.Event.y)
```
Gui.Mouse.Event.y: integer
```
Vertical position of the mouse when event was triggered
### Gui.Mouse.Event.xrel[🔗](#$api.gui~Gui.Mouse.Event.xrel)
```
Gui.Mouse.Event.xrel: integer
```
Relative horizontal movement.
### Gui.Mouse.Event.yrel[🔗](#$api.gui~Gui.Mouse.Event.yrel)
```
Gui.Mouse.Event.yrel: integer
```
Relative vertical movement.
### Gui.Mouse.Event.handled[🔗](#$api.gui~Gui.Mouse.Event.handled)
```
Gui.Mouse.Event.handled: boolean
```
Whether the event was already handled by a child component.
### Gui.Mouse.getTerrainPosition[🔗](#$api.gui~Gui.Mouse.getTerrainPosition)
```
function Gui.Mouse.getTerrainPosition(): Vec3f
```
Gets the last valid terrain position pointed by the mouse.
**Returns**
1. `Vec3f` — coordinates of the terrain position
### Gui.Mouse.hasTerrainPosition[🔗](#$api.gui~Gui.Mouse.hasTerrainPosition)
```
function Gui.Mouse.hasTerrainPosition(): boolean
```
Returns whether a valid terrain position is currently available.
**Returns**
1. `boolean` — boolean true if the mouse is pointing at the terrain
### Gui.Key[🔗](#$api.gui~Gui.Key)
```
[Expand All] [Collapse All]
record Gui.Key record State Up: State
Pressed: State
end
record InputEvent dir: State
repeated: boolean
isGamepadEvent: function(InputEvent): boolean
isKeyboardEvent: function(InputEvent): boolean
getKey: function(InputEvent): integer
getKeyMod: function(InputEvent): integer
end
record Event data: InputEvent
isPressed: function(Event): boolean
end
end
```
### Gui.Key.State[🔗](#$api.gui~Gui.Key.State)
```
record Gui.Key.State Up: State
Pressed: State
end
```
### Gui.Key.State.Up[🔗](#$api.gui~Gui.Key.State.Up)
```
Gui.Key.State.Up: State
```
### Gui.Key.State.Pressed[🔗](#$api.gui~Gui.Key.State.Pressed)
```
Gui.Key.State.Pressed: State
```
### Gui.Key.InputEvent[🔗](#$api.gui~Gui.Key.InputEvent)
```
record Gui.Key.InputEvent dir: State
repeated: boolean
isGamepadEvent: function(InputEvent): boolean
isKeyboardEvent: function(InputEvent): boolean
getKey: function(InputEvent): integer
getKeyMod: function(InputEvent): integer
end
```
### Gui.Key.InputEvent.dir[🔗](#$api.gui~Gui.Key.InputEvent.dir)
```
Gui.Key.InputEvent.dir: State
```
### Gui.Key.InputEvent.repeated[🔗](#$api.gui~Gui.Key.InputEvent.repeated)
```
Gui.Key.InputEvent.repeated: boolean
```
### Gui.Key.InputEvent.isGamepadEvent[🔗](#$api.gui~Gui.Key.InputEvent.isGamepadEvent)
```
function Gui.Key.InputEvent.isGamepadEvent(InputEvent): boolean
```
Returns whether this is a gamepad event.
**Parameters**
* `InputEvent`
**Returns**
1. `boolean`
### Gui.Key.InputEvent.isKeyboardEvent[🔗](#$api.gui~Gui.Key.InputEvent.isKeyboardEvent)
```
function Gui.Key.InputEvent.isKeyboardEvent(InputEvent): boolean
```
Returns whether this is a keyboard event.
**Parameters**
* `InputEvent`
**Returns**
1. `boolean`
### Gui.Key.InputEvent.getKey[🔗](#$api.gui~Gui.Key.InputEvent.getKey)
```
function Gui.Key.InputEvent.getKey(InputEvent): integer
```
Returns the key code.
**Parameters**
* `InputEvent`
**Returns**
1. `integer`
### Gui.Key.InputEvent.getKeyMod[🔗](#$api.gui~Gui.Key.InputEvent.getKeyMod)
```
function Gui.Key.InputEvent.getKeyMod(InputEvent): integer
```
Returns key modifiers.
**Parameters**
* `InputEvent`
**Returns**
1. `integer`
### Gui.Key.Event[🔗](#$api.gui~Gui.Key.Event)
```
record Gui.Key.Event data: InputEvent
isPressed: function(Event): boolean
end
```
Represents a key press event.
### Gui.Key.Event.data[🔗](#$api.gui~Gui.Key.Event.data)
```
Gui.Key.Event.data: InputEvent
```
### Gui.Key.Event.isPressed[🔗](#$api.gui~Gui.Key.Event.isPressed)
```
function Gui.Key.Event.isPressed(Event): boolean
```
Returns whether the key is pressed.
**Parameters**
* `Event`
**Returns**
1. `boolean`
### Gui.DataTransferItem[🔗](#$api.gui~Gui.DataTransferItem)
```
record Gui.DataTransferItem new: function(ResName, any): DataTransferItem
type: ResName
data: any
end
```
### Gui.DataTransferItem.new[🔗](#$api.gui~Gui.DataTransferItem.new)
```
function Gui.DataTransferItem.new(ResName, any): DataTransferItem
```
**Parameters**
* `ResName`
* `any`
**Returns**
1. `DataTransferItem`
### Gui.DataTransferItem.type[🔗](#$api.gui~Gui.DataTransferItem.type)
```
Gui.DataTransferItem.type: ResName
```
### Gui.DataTransferItem.data[🔗](#$api.gui~Gui.DataTransferItem.data)
```
Gui.DataTransferItem.data: any
```
### Gui.DnD[🔗](#$api.gui~Gui.DnD)
```
[Expand All] [Collapse All]
record Gui.DnD record Event record Type Drop: Type
DragStarted: Type
DragEntered: Type
DragExited: Type
end
type: Type
end
setCursor: function(cursor : integer)
addTransferData: function(dragStartEvent : Event, item : DataTransferItem)
getAllTransferData: function(): {DataTransferItem}
end
```
### Gui.DnD.Event[🔗](#$api.gui~Gui.DnD.Event)
```
[Expand All] [Collapse All]
record Gui.DnD.Event record Type Drop: Type
DragStarted: Type
DragEntered: Type
DragExited: Type
end
type: Type
end
```
Represents drag & drop event
### Gui.DnD.Event.Type[🔗](#$api.gui~Gui.DnD.Event.Type)
```
record Gui.DnD.Event.Type Drop: Type
DragStarted: Type
DragEntered: Type
DragExited: Type
end
```
### Gui.DnD.Event.Type.Drop[🔗](#$api.gui~Gui.DnD.Event.Type.Drop)
```
Gui.DnD.Event.Type.Drop: Type
```
### Gui.DnD.Event.Type.DragStarted[🔗](#$api.gui~Gui.DnD.Event.Type.DragStarted)
```
Gui.DnD.Event.Type.DragStarted: Type
```
### Gui.DnD.Event.Type.DragEntered[🔗](#$api.gui~Gui.DnD.Event.Type.DragEntered)
```
Gui.DnD.Event.Type.DragEntered: Type
```
### Gui.DnD.Event.Type.DragExited[🔗](#$api.gui~Gui.DnD.Event.Type.DragExited)
```
Gui.DnD.Event.Type.DragExited: Type
```
### Gui.DnD.Event.type[🔗](#$api.gui~Gui.DnD.Event.type)
```
Gui.DnD.Event.type: Type
```
Event type.
### Gui.DnD.setCursor[🔗](#$api.gui~Gui.DnD.setCursor)
```
function Gui.DnD.setCursor(cursor : integer)
```
Set cursor while dragging (will get reset when a new drag starts).
**Parameters**
* `cursor` :`integer` — the cursor id
### Gui.DnD.addTransferData[🔗](#$api.gui~Gui.DnD.addTransferData)
```
function Gui.DnD.addTransferData(dragStartEvent : Event, item : DataTransferItem)
```
Add transfer data to the current drag & drop operation.
**Parameters**
* `dragStartEvent` :`Event` — drag start event (must be Event.Type.DragStarted)
* `item` :`DataTransferItem` — transferable item
### Gui.DnD.getAllTransferData[🔗](#$api.gui~Gui.DnD.getAllTransferData)
```
function Gui.DnD.getAllTransferData(): {DataTransferItem}
```
Get current drag & drop data.
**Returns**
1. `{DataTransferItem}` — current transfer data list
### Gui.InputAction[🔗](#$api.gui~Gui.InputAction)
```
[Expand All] [Collapse All]
record Gui.InputAction record InputActionState Disabled: InputActionState
Inactive: InputActionState
Enabled: InputActionState
end
record InvokeData record Status Triggered: Status
Repeat: Status
PressedStep: Status
EndReleased: Status
EndAborted: Status
end
status: Status
end
modifierOnlyActionIsActive: function(inputActionId : string): boolean
hasConflicts: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): string
findDuplicatesOf: function(inputActionId : string): {string}
getFixedKeyCmdDefs: function(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): {string : {KeyComboDef}}
end
```
### Gui.InputAction.InputActionState[🔗](#$api.gui~Gui.InputAction.InputActionState)
```
record Gui.InputAction.InputActionState Disabled: InputActionState
Inactive: InputActionState
Enabled: InputActionState
end
```
### Gui.InputAction.InputActionState.Disabled[🔗](#$api.gui~Gui.InputAction.InputActionState.Disabled)
```
Gui.InputAction.InputActionState.Disabled: InputActionState
```
### Gui.InputAction.InputActionState.Inactive[🔗](#$api.gui~Gui.InputAction.InputActionState.Inactive)
```
Gui.InputAction.InputActionState.Inactive: InputActionState
```
### Gui.InputAction.InputActionState.Enabled[🔗](#$api.gui~Gui.InputAction.InputActionState.Enabled)
```
Gui.InputAction.InputActionState.Enabled: InputActionState
```
### Gui.InputAction.InvokeData[🔗](#$api.gui~Gui.InputAction.InvokeData)
```
[Expand All] [Collapse All]
record Gui.InputAction.InvokeData record Status Triggered: Status
Repeat: Status
PressedStep: Status
EndReleased: Status
EndAborted: Status
end
status: Status
end
```
Additional info about the invocation of an input action event
### Gui.InputAction.InvokeData.Status[🔗](#$api.gui~Gui.InputAction.InvokeData.Status)
```
record Gui.InputAction.InvokeData.Status Triggered: Status
Repeat: Status
PressedStep: Status
EndReleased: Status
EndAborted: Status
end
```
Status type of the InputActionInvokeData
### Gui.InputAction.InvokeData.Status.Triggered[🔗](#$api.gui~Gui.InputAction.InvokeData.Status.Triggered)
```
Gui.InputAction.InvokeData.Status.Triggered: Status
```
### Gui.InputAction.InvokeData.Status.Repeat[🔗](#$api.gui~Gui.InputAction.InvokeData.Status.Repeat)
```
Gui.InputAction.InvokeData.Status.Repeat: Status
```
### Gui.InputAction.InvokeData.Status.PressedStep[🔗](#$api.gui~Gui.InputAction.InvokeData.Status.PressedStep)
```
Gui.InputAction.InvokeData.Status.PressedStep: Status
```
### Gui.InputAction.InvokeData.Status.EndReleased[🔗](#$api.gui~Gui.InputAction.InvokeData.Status.EndReleased)
```
Gui.InputAction.InvokeData.Status.EndReleased: Status
```
### Gui.InputAction.InvokeData.Status.EndAborted[🔗](#$api.gui~Gui.InputAction.InvokeData.Status.EndAborted)
```
Gui.InputAction.InvokeData.Status.EndAborted: Status
```
### Gui.InputAction.InvokeData.status[🔗](#$api.gui~Gui.InputAction.InvokeData.status)
```
Gui.InputAction.InvokeData.status: Status
```
status of the action.
### Gui.InputAction.modifierOnlyActionIsActive[🔗](#$api.gui~Gui.InputAction.modifierOnlyActionIsActive)
```
function Gui.InputAction.modifierOnlyActionIsActive(inputActionId : string): boolean
```
Checks if a modifier-only action is currently active.
**Parameters**
* `inputActionId` :`string` — the input action identifier
**Returns**
1. `boolean` — True if active.
### Gui.InputAction.hasConflicts[🔗](#$api.gui~Gui.InputAction.hasConflicts)
```
function Gui.InputAction.hasConflicts(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): string
```
Checks for key binding conflicts.
**Parameters**
* `keyCmdDefinitions` :`{string : {KeyComboDef}}` — Key command definitions.
* `inputActionId` :`string` — Input action id.
* `keyComboDef` :`KeyComboDef` — Key combo definition.
**Returns**
1. `string` — Conflict description (empty if no conflict).
### Gui.InputAction.findDuplicatesOf[🔗](#$api.gui~Gui.InputAction.findDuplicatesOf)
```
function Gui.InputAction.findDuplicatesOf(inputActionId : string): {string}
```
Recursively find list of all IAs that should are duplicates of this one (i.e. duplicateOf == inputActionId and duplicatedKeybindings == true)
**Parameters**
* `inputActionId` :`string` — Input action id.
**Returns**
1. `{string}` — Duplications of the IA
### Gui.InputAction.getFixedKeyCmdDefs[🔗](#$api.gui~Gui.InputAction.getFixedKeyCmdDefs)
```
function Gui.InputAction.getFixedKeyCmdDefs(keyCmdDefinitions : {string : {KeyComboDef}}, inputActionId : string, keyComboDef : KeyComboDef): {string : {KeyComboDef}}
```
Resolves key binding conflicts and returns updated key command definitions.
**Parameters**
* `keyCmdDefinitions` :`{string : {KeyComboDef}}` — Key command definitions.
* `inputActionId` :`string` — Input action id.
* `keyComboDef` :`KeyComboDef` — Key combo definition.
**Returns**
1. `{string : {KeyComboDef}}` — Fixed key command definitions or empty table if change not allowed.
### Gui.ById[🔗](#$api.gui~Gui.ById)
```
record Gui.ById setVisibilityByClass: function(idOrTag : string, visible : boolean, idOnly : boolean)
setEnabled: function(idOrTag : string, enabled : boolean, idOnly : boolean)
setHighlighted: function(idOrTag : string, highlighted : boolean, style : HighlightStyle, color : Vec3f, idOnly : boolean)
isVisible: function(id : string): boolean
isVisibleRecursive: function(id : string): boolean
setVisible: function(id : string, visible : boolean)
resetMovedWindowPosition: function(id : string)
getSize: function(id : string): Vec2f
end
```
### Gui.ById.setVisibilityByClass[🔗](#$api.gui~Gui.ById.setVisibilityByClass)
```
function Gui.ById.setVisibilityByClass(idOrTag : string, visible : boolean, idOnly : boolean)
```
Shows or hides a component.
**Parameters**
* `idOrTag` :`string` — the component identifier or a tag
* `visible` :`boolean` — whether visible or not (nil to reset the rule
* `idOnly` :`boolean` — idOnly -> do not consider tags
### Gui.ById.setEnabled[🔗](#$api.gui~Gui.ById.setEnabled)
```
function Gui.ById.setEnabled(idOrTag : string, enabled : boolean, idOnly : boolean)
```
Enables or disables a component.
**Parameters**
* `idOrTag` :`string` — the component identifier or a tag
* `enabled` :`boolean` — whether enabled or not (nil sets to enabled and removes the rule)
* `idOnly` :`boolean` — idOnly -> do not consider tags
### Gui.ById.setHighlighted[🔗](#$api.gui~Gui.ById.setHighlighted)
```
function Gui.ById.setHighlighted(idOrTag : string, highlighted : boolean, style : HighlightStyle, color : Vec3f, idOnly : boolean)
```
Sets the highlighted state of a component.
**Parameters**
* `idOrTag` :`string` — the component identifier or a tag
* `highlighted` :`boolean` — whether highlighted or not (nil sets to not highlighted and removes the rule)
* `style` :`HighlightStyle` — defaults to HighlightStyle::Circle
* `color` :`Vec3f` — the color of the highlight, defaults to yellow
* `idOnly` :`boolean` — idOnly -> do not consider tags
### Gui.ById.isVisible[🔗](#$api.gui~Gui.ById.isVisible)
```
function Gui.ById.isVisible(id : string): boolean
```
Checks if a UI component is visible by its id.
**Parameters**
* `id` :`string` — the component identifier
**Returns**
1. `boolean` — true if the component is visible
### Gui.ById.isVisibleRecursive[🔗](#$api.gui~Gui.ById.isVisibleRecursive)
```
function Gui.ById.isVisibleRecursive(id : string): boolean
```
Checks if a UI component and all its parents are visible by id.
**Parameters**
* `id` :`string` — the component identifier
**Returns**
1. `boolean` — true if the component and all parents are visible
### Gui.ById.setVisible[🔗](#$api.gui~Gui.ById.setVisible)
```
function Gui.ById.setVisible(id : string, visible : boolean)
```
Sets the visibility of a UI component by its ID.
**Parameters**
* `id` :`string` — the component identifier
* `visible` :`boolean` — if the component should be visible
### Gui.ById.resetMovedWindowPosition[🔗](#$api.gui~Gui.ById.resetMovedWindowPosition)
```
function Gui.ById.resetMovedWindowPosition(id : string)
```
Resets a window to its original position if it was moved by the user.
**Parameters**
* `id` :`string` — string id the window identifier
### Gui.ById.getSize[🔗](#$api.gui~Gui.ById.getSize)
```
function Gui.ById.getSize(id : string): Vec2f
```
Get width and height of UI component
**Parameters**
* `id` :`string` — string id the window identifier
**Returns**
1. `Vec2f` — width and height
### Gui.Camera[🔗](#$api.gui~Gui.Camera)
```
record Gui.Camera setManualCamera: function(center : Vec2f, distance : number)
getCameraData: function(): Vec5f
setCameraData: function(Vec5f : Vec5f)
getHeightAboveTerrain: function(): number
focusEntity: function(entity : Engine.Entity)
focusPosition: function(position : Vec3f, distance : number)
takeScreenshot: function(scale : integer)
getFollowEntity: function(): {Engine.Entity, Engine.Revision}
followEntity: function(entity : Engine.Entity, jump : boolean)
enterFollowCameraCockpit: function(entity : Engine.Entity)
leaveFollowCameraCockpit: function()
isFreeCameraMouseAttached: function(): boolean
toggleFreeCameraMouseAttachment: function()
toggleFreeCamera: function()
world2Screen: function(Vec3f): Vec2i
screen2World: function(Vec3f): Vec3f
getEye: function(): Vec3f
getCenter: function(): Vec3f
getNearFar: function(): Vec2f
getSize: function(): Vec2i
traceToTerrain: function(worldPos : Vec3f, farPos : Vec3f, zOffset : number, numSteps : integer): Vec3f | nil
end
```
### Gui.Camera.setManualCamera[🔗](#$api.gui~Gui.Camera.setManualCamera)
```
function Gui.Camera.setManualCamera(center : Vec2f, distance : number)
```
Sets camera to a given position/orientation.
**Parameters**
* `center` :`Vec2f` — position on the map where the camera should point to
* `distance` :`number` — the distance from the position
### Gui.Camera.getCameraData[🔗](#$api.gui~Gui.Camera.getCameraData)
```
function Gui.Camera.getCameraData(): Vec5f
```
Obtains the current camera data.
**Returns**
1. `Vec5f` — the current camera data as a Vec5f {center.x, center.y, distance, angle, pitch}
### Gui.Camera.setCameraData[🔗](#$api.gui~Gui.Camera.setCameraData)
```
function Gui.Camera.setCameraData(Vec5f : Vec5f)
```
Set the camera data.
**Parameters**
* `Vec5f` :`Vec5f` — set the camera data as a Vec5f {center.x, center.y, distance, angle, pitch}
### Gui.Camera.getHeightAboveTerrain[🔗](#$api.gui~Gui.Camera.getHeightAboveTerrain)
```
function Gui.Camera.getHeightAboveTerrain(): number
```
Obtains the current height above terrain.
**Returns**
1. `number` — the height of the camera above the terrain
### Gui.Camera.focusEntity[🔗](#$api.gui~Gui.Camera.focusEntity)
```
function Gui.Camera.focusEntity(entity : Engine.Entity)
```
Focuses the camera on an entity.
**Parameters**
* `entity` :`Engine.Entity` — the id of the entity that should be focused on
### Gui.Camera.focusPosition[🔗](#$api.gui~Gui.Camera.focusPosition)
```
function Gui.Camera.focusPosition(position : Vec3f, distance : number)
```
Focuses the camera on a position.
**Parameters**
* `position` :`Vec3f` — the position that should be focused
* `distance` :`number` — the distance of the camera from the target
### Gui.Camera.takeScreenshot[🔗](#$api.gui~Gui.Camera.takeScreenshot)
```
function Gui.Camera.takeScreenshot(scale : integer)
```
Takes a screenshot and stores it in userdata folder
**Parameters**
* `scale` :`integer` — image resolution
### Gui.Camera.getFollowEntity[🔗](#$api.gui~Gui.Camera.getFollowEntity)
```
function Gui.Camera.getFollowEntity(): {Engine.Entity, Engine.Revision}
```
Gets the entity currently being followed.
**Returns**
1. `{Engine.Entity, Engine.Revision}` — the entity being followed (and the entity revision)
### Gui.Camera.followEntity[🔗](#$api.gui~Gui.Camera.followEntity)
```
function Gui.Camera.followEntity(entity : Engine.Entity, jump : boolean)
```
Sets camera to follow an Entity.
**Parameters**
* `entity` :`Engine.Entity` — the id of the entity that should be followed
* `jump` :`boolean` — true if the camera should directly jump to the entity and not slide there
### Gui.Camera.enterFollowCameraCockpit[🔗](#$api.gui~Gui.Camera.enterFollowCameraCockpit)
```
function Gui.Camera.enterFollowCameraCockpit(entity : Engine.Entity)
```
Enters the cockpit of an entity.
**Parameters**
* `entity` :`Engine.Entity` — entity of the object to enter
### Gui.Camera.leaveFollowCameraCockpit[🔗](#$api.gui~Gui.Camera.leaveFollowCameraCockpit)
```
function Gui.Camera.leaveFollowCameraCockpit()
```
Leave the cockpit of an entity.
### Gui.Camera.isFreeCameraMouseAttached[🔗](#$api.gui~Gui.Camera.isFreeCameraMouseAttached)
```
function Gui.Camera.isFreeCameraMouseAttached(): boolean
```
Tells if mouse is attached to free cam or not
**Returns**
1. `boolean` — if mouse is attached (true) or not (false)
### Gui.Camera.toggleFreeCameraMouseAttachment[🔗](#$api.gui~Gui.Camera.toggleFreeCameraMouseAttachment)
```
function Gui.Camera.toggleFreeCameraMouseAttachment()
```
Toggles mouse attachment
### Gui.Camera.toggleFreeCamera[🔗](#$api.gui~Gui.Camera.toggleFreeCamera)
```
function Gui.Camera.toggleFreeCamera()
```
Toggles free camera
### Gui.Camera.world2Screen[🔗](#$api.gui~Gui.Camera.world2Screen)
```
function Gui.Camera.world2Screen(Vec3f): Vec2i
```
Convert a 3D World position into a position on screen (in pixels)
**Parameters**
* `Vec3f`
**Returns**
1. `Vec2i`
### Gui.Camera.screen2World[🔗](#$api.gui~Gui.Camera.screen2World)
```
function Gui.Camera.screen2World(Vec3f): Vec3f
```
Convert a position on the screen (in pixels) (with depth [0, 1]) into a 3D World position
**Parameters**
* `Vec3f`
**Returns**
1. `Vec3f`
### Gui.Camera.getEye[🔗](#$api.gui~Gui.Camera.getEye)
```
function Gui.Camera.getEye(): Vec3f
```
Get camera origin in world coordinates
**Returns**
1. `Vec3f`
### Gui.Camera.getCenter[🔗](#$api.gui~Gui.Camera.getCenter)
```
function Gui.Camera.getCenter(): Vec3f
```
Get camera center ("look-at" pos) in world coordinates
**Returns**
1. `Vec3f`
### Gui.Camera.getNearFar[🔗](#$api.gui~Gui.Camera.getNearFar)
```
function Gui.Camera.getNearFar(): Vec2f
```
Get near and far distances of camera in x and y coordinates repsectively
**Returns**
1. `Vec2f`
### Gui.Camera.getSize[🔗](#$api.gui~Gui.Camera.getSize)
```
function Gui.Camera.getSize(): Vec2i
```
Width and height of the viewport, in pixels
**Returns**
1. `Vec2i`
### Gui.Camera.traceToTerrain[🔗](#$api.gui~Gui.Camera.traceToTerrain)
```
function Gui.Camera.traceToTerrain(worldPos : Vec3f, farPos : Vec3f, zOffset : number, numSteps : integer): Vec3f | nil
```
Trace a ray from worldPos to farPos, and find the intersection (if any) with the terrain, offsetted at zOffset
**Parameters**
* `worldPos` :`Vec3f` — world position of starting point of ray
* `farPos` :`Vec3f` — world position of end point of ray
* `zOffset` :`number` — offset to shift the terrain for intersection
* `numSteps` :`integer` — number of steps to perform for finding an intersection. more steps are more precise but cost more, 30 is a good compromise
**Returns**
1. `Vec3f | nil`
### Gui.Sound[🔗](#$api.gui~Gui.Sound)
```
record Gui.Sound letVehicleHorn: function(vehicleEntity : Engine.Entity)
playRandomSoundEffect: function(paths : {FilePath})
end
```
### Gui.Sound.letVehicleHorn[🔗](#$api.gui~Gui.Sound.letVehicleHorn)
```
function Gui.Sound.letVehicleHorn(vehicleEntity : Engine.Entity)
```
Sounds the vehicle horn.
**Parameters**
* `vehicleEntity` :`Engine.Entity` — the vehicle to sound the horn
### Gui.Sound.playRandomSoundEffect[🔗](#$api.gui~Gui.Sound.playRandomSoundEffect)
```
function Gui.Sound.playRandomSoundEffect(paths : {FilePath})
```
Plays a single sound effect randomly selected of the provided selection.
**Parameters**
* `paths` :`{FilePath}` — vector of strings paths of sound effects
### Gui.MusicPlayer[🔗](#$api.gui~Gui.MusicPlayer)
```
record Gui.MusicPlayer goBack: function()
goForward: function()
togglePause: function()
getTitle: function(): string
getArtist: function(): string
hasPlaylist: function(): boolean
getPlaylistIndex: function(): integer
setTrackListFromPlayList: function(playlist : string, startPaused : boolean, offset : number)
setPlaylist: function(playlist : string)
getPlaylist: function(): string
isPlaying: function(): boolean
playTrack: function(trackName : string, offset : number)
playTrackFile: function(filePath : string, offset : number)
getTrackLength: function(): number
getTrackElapsedTime: function(): number
getGain: function(): number
setGain: function(gain : number)
setTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean)
addTrackList: function(trackList : {{string, string, boolean}}, enableRepeat : boolean)
setContextTag: function(contextTag : string)
end
```
### Gui.MusicPlayer.goBack[🔗](#$api.gui~Gui.MusicPlayer.goBack)
```
function Gui.MusicPlayer.goBack()
```
Goes back to the previous track in the music player.
### Gui.MusicPlayer.goForward[🔗](#$api.gui~Gui.MusicPlayer.goForward)
```
function Gui.MusicPlayer.goForward()
```
Goes forward to the next track in the music player.
### Gui.MusicPlayer.togglePause[🔗](#$api.gui~Gui.MusicPlayer.togglePause)
```
function Gui.MusicPlayer.togglePause()
```
Toggles pause/play state of the music player.
### Gui.MusicPlayer.getTitle[🔗](#$api.gui~Gui.MusicPlayer.getTitle)
```
function Gui.MusicPlayer.getTitle(): string
```
Gets the title of the currently playing track.
**Returns**
1. `string` — the track title
### Gui.MusicPlayer.getArtist[🔗](#$api.gui~Gui.MusicPlayer.getArtist)
```
function Gui.MusicPlayer.getArtist(): string
```
Gets the artist of the currently playing track.
**Returns**
1. `string` — the track artist
### Gui.MusicPlayer.hasPlaylist[🔗](#$api.gui~Gui.MusicPlayer.hasPlaylist)
```
function Gui.MusicPlayer.hasPlaylist(): boolean
```
Checks if the music player has tracks loaded.
**Returns**
1. `boolean` — true if the music player has tracks
### Gui.MusicPlayer.getPlaylistIndex[🔗](#$api.gui~Gui.MusicPlayer.getPlaylistIndex)
```
function Gui.MusicPlayer.getPlaylistIndex(): integer
```
Gets the current track index (1-based).
**Returns**
1. `integer` — the current track index
### Gui.MusicPlayer.setTrackListFromPlayList[🔗](#$api.gui~Gui.MusicPlayer.setTrackListFromPlayList)
```
function Gui.MusicPlayer.setTrackListFromPlayList(playlist : string, startPaused : boolean, offset : number)
```
Sets the current playlist.
The current track will only start after the current track ends. To trigger the new playlist immediately, call `goForward()` right after this call.
**Parameters**
* `playlist` :`string` — the playlist resource name
* `startPaused` :`boolean` — if set, does not play the playlist, just prepares it
* `offset` :`number` — playback offset in seconds (optional)
### Gui.MusicPlayer.setPlaylist[🔗](#$api.gui~Gui.MusicPlayer.setPlaylist)
```
function Gui.MusicPlayer.setPlaylist(playlist : string)
```
Sets the current playlist. Only available while in-game.
The current track will only start after the current track ends. To trigger the new playlist immediately, call `goForward()` right after this call.
**Parameters**
* `playlist` :`string` — the playlist resource name
### Gui.MusicPlayer.getPlaylist[🔗](#$api.gui~Gui.MusicPlayer.getPlaylist)
```
function Gui.MusicPlayer.getPlaylist(): string
```
Gets the current playlist. Only available while in-game.
**Returns**
1. `string` — the resource name of the current playlist
### Gui.MusicPlayer.isPlaying[🔗](#$api.gui~Gui.MusicPlayer.isPlaying)
```
function Gui.MusicPlayer.isPlaying(): boolean
```
Checks if the music player is currently playing.
**Returns**
1. `boolean` — true if music is playing
### Gui.MusicPlayer.playTrack[🔗](#$api.gui~Gui.MusicPlayer.playTrack)
```
function Gui.MusicPlayer.playTrack(trackName : string, offset : number)
```
Plays a track by name.
**Parameters**
* `trackName` :`string` — the name of the track to play
* `offset` :`number` — playback offset in seconds (optional)
### Gui.MusicPlayer.playTrackFile[🔗](#$api.gui~Gui.MusicPlayer.playTrackFile)
```
function Gui.MusicPlayer.playTrackFile(filePath : string, offset : number)
```
Plays a specific file that might not be part of the current track list
**Parameters**
* `filePath` :`string` — the path to the track file
* `offset` :`number` — playback offset in seconds (optional)
### Gui.MusicPlayer.getTrackLength[🔗](#$api.gui~Gui.MusicPlayer.getTrackLength)
```
function Gui.MusicPlayer.getTrackLength(): number
```
Gets the length (duration) of the current track
**Returns**
1. `number` — the track duration in second
### Gui.MusicPlayer.getTrackElapsedTime[🔗](#$api.gui~Gui.MusicPlayer.getTrackElapsedTime)
```
function Gui.MusicPlayer.getTrackElapsedTime(): number
```
Gets the time of the current track
**Returns**
1. `number` — the current time of the current track
### Gui.MusicPlayer.getGain[🔗](#$api.gui~Gui.MusicPlayer.getGain)
```
function Gui.MusicPlayer.getGain(): number
```
Gets the current gain (volume) of the music player.
**Returns**
1. `number` — the gain value
### Gui.MusicPlayer.setGain[🔗](#$api.gui~Gui.MusicPlayer.setGain)
```
function Gui.MusicPlayer.setGain(gain : number)
```
Sets the gain (volume) of the music player.
**Parameters**
* `gain` :`number` — the gain value
### Gui.MusicPlayer.setTrackList[🔗](#$api.gui~Gui.MusicPlayer.setTrackList)
```
function Gui.MusicPlayer.setTrackList(trackList : {{string, string, boolean}}, enableRepeat : boolean)
```
Sets the track list for the music player, replaces the current track list.
**Parameters**
* `trackList` :`{{string, string, boolean}}` — array of tuples containing track name, file path, and repeat flag
* `enableRepeat` :`boolean` — true to enable repeat for the entire list
### Gui.MusicPlayer.addTrackList[🔗](#$api.gui~Gui.MusicPlayer.addTrackList)
```
function Gui.MusicPlayer.addTrackList(trackList : {{string, string, boolean}}, enableRepeat : boolean)
```
Adds a track list to the music player. This doesn't replace the existing tracks
and once the added tracks are finish, the track previously playing will resume
**Parameters**
* `trackList` :`{{string, string, boolean}}` — array of tuples containing track name, file path, and repeat flag
* `enableRepeat` :`boolean` — true to enable repeat for the entire list
### Gui.MusicPlayer.setContextTag[🔗](#$api.gui~Gui.MusicPlayer.setContextTag)
```
function Gui.MusicPlayer.setContextTag(contextTag : string)
```
Sets the context tag for the music player.
The context tag can be used to change the variant of a playing track.
**Parameters**
* `contextTag` :`string` — the context tag to set
### Gui.VoiceOverManager[🔗](#$api.gui~Gui.VoiceOverManager)
```
record Gui.VoiceOverManager stop: function()
play: function(voiceOverRes : string, delayInSeconds : number)
isPlaying: function(voiceOverRes : string): boolean
isPlayingAny: function(): boolean
getPlaying: function(): ResName
end
```
### Gui.VoiceOverManager.stop[🔗](#$api.gui~Gui.VoiceOverManager.stop)
```
function Gui.VoiceOverManager.stop()
```
Stops the current voice over playing
### Gui.VoiceOverManager.play[🔗](#$api.gui~Gui.VoiceOverManager.play)
```
function Gui.VoiceOverManager.play(voiceOverRes : string, delayInSeconds : number)
```
Plays a new voice over
**Parameters**
* `voiceOverRes` :`string` — the file path to the voice over to play
* `delayInSeconds` :`number` — delay before the voice over starts
### Gui.VoiceOverManager.isPlaying[🔗](#$api.gui~Gui.VoiceOverManager.isPlaying)
```
function Gui.VoiceOverManager.isPlaying(voiceOverRes : string): boolean
```
Checks whether a specific voice over is playing
**Parameters**
* `voiceOverRes` :`string` — the voice over file to check
**Returns**
1. `boolean` — true if the voice over file is playing
### Gui.VoiceOverManager.isPlayingAny[🔗](#$api.gui~Gui.VoiceOverManager.isPlayingAny)
```
function Gui.VoiceOverManager.isPlayingAny(): boolean
```
Checks whether any voice over is current playing
**Returns**
1. `boolean` — true if any voice over is playing
### Gui.VoiceOverManager.getPlaying[🔗](#$api.gui~Gui.VoiceOverManager.getPlaying)
```
function Gui.VoiceOverManager.getPlaying(): ResName
```
Checks whether any voice over is current playing and returns the file path if one is playing
**Returns**
1. `ResName` — file path if any voice over is playing
### Gui.ByEntity[🔗](#$api.gui~Gui.ByEntity)
```
record Gui.ByEntity isLineEmptyOrVisible: function(Engine.Entity : Engine.Entity): boolean
isVisible: function(Engine.Entity : Engine.Entity): boolean
isVehicleVisible: function(Engine.Entity : Engine.Entity): boolean
end
```
### Gui.ByEntity.isLineEmptyOrVisible[🔗](#$api.gui~Gui.ByEntity.isLineEmptyOrVisible)
```
function Gui.ByEntity.isLineEmptyOrVisible(Engine.Entity : Engine.Entity): boolean
```
Checks if line is empty or visible
**Parameters**
* `Engine.Entity` :`Engine.Entity` — the line entity to check
**Returns**
1. `boolean` — true if the line is empty or visible
### Gui.ByEntity.isVisible[🔗](#$api.gui~Gui.ByEntity.isVisible)
```
function Gui.ByEntity.isVisible(Engine.Entity : Engine.Entity): boolean
```
Checks if an entity is visible
**Parameters**
* `Engine.Entity` :`Engine.Entity` — the entity to check
**Returns**
1. `boolean` — true if the entity is visible
### Gui.ByEntity.isVehicleVisible[🔗](#$api.gui~Gui.ByEntity.isVehicleVisible)
```
function Gui.ByEntity.isVehicleVisible(Engine.Entity : Engine.Entity): boolean
```
Checks if vehicle is visible
**Parameters**
* `Engine.Entity` :`Engine.Entity` — the vehicle entity to check
**Returns**
1. `boolean` — true if the vehicle is visible
### Gui.ContextHelper[🔗](#$api.gui~Gui.ContextHelper)
```
[Expand All] [Collapse All]
record Gui.ContextHelper record SubjectState Visible: SubjectState
Focused: SubjectState
end
collectSubjectStates: function(idsOfInterest : {string}): {string : SubjectState}
getIdsOfActiveTool: function(): {string}
end
```
### Gui.ContextHelper.SubjectState[🔗](#$api.gui~Gui.ContextHelper.SubjectState)
```
record Gui.ContextHelper.SubjectState Visible: SubjectState
Focused: SubjectState
end
```
### Gui.ContextHelper.SubjectState.Visible[🔗](#$api.gui~Gui.ContextHelper.SubjectState.Visible)
```
Gui.ContextHelper.SubjectState.Visible: SubjectState
```
### Gui.ContextHelper.SubjectState.Focused[🔗](#$api.gui~Gui.ContextHelper.SubjectState.Focused)
```
Gui.ContextHelper.SubjectState.Focused: SubjectState
```
### Gui.ContextHelper.collectSubjectStates[🔗](#$api.gui~Gui.ContextHelper.collectSubjectStates)
```
function Gui.ContextHelper.collectSubjectStates(idsOfInterest : {string}): {string : SubjectState}
```
Collects subject states for given ids
**Parameters**
* `idsOfInterest` :`{string}` — ids to collect states for
**Returns**
1. `{string : SubjectState}`
### Gui.ContextHelper.getIdsOfActiveTool[🔗](#$api.gui~Gui.ContextHelper.getIdsOfActiveTool)
```
function Gui.ContextHelper.getIdsOfActiveTool(): {string}
```
**Returns**
1. `{string}`
### Gui.Construction[🔗](#$api.gui~Gui.Construction)
```
record Gui.Construction setAngle: function(angle : number)
modify: function(construction : Engine.Entity)
getBrushIcons: function(): {string}
provideDustWheneverPossible: function(proposal : Proposal, proposalData : ProposalData)
getRefundableEntities: function(): {{Engine.Entity, integer}, {Engine.Revision, integer}}
updateRefundableEntities: function(resultEntities : {Engine.Entity}, proposal : Proposal.StreetProposal)
end
```
### Gui.Construction.setAngle[🔗](#$api.gui~Gui.Construction.setAngle)
```
function Gui.Construction.setAngle(angle : number)
```
Sets the default construction angle for constructions.
**Parameters**
* `angle` :`number` — the default construction angle
### Gui.Construction.modify[🔗](#$api.gui~Gui.Construction.modify)
```
function Gui.Construction.modify(construction : Engine.Entity)
```
Modifies a construction
**Parameters**
* `construction` :`Engine.Entity` — the construction entity
### Gui.Construction.getBrushIcons[🔗](#$api.gui~Gui.Construction.getBrushIcons)
```
function Gui.Construction.getBrushIcons(): {string}
```
Returns brush icons for construction menu
**Returns**
1. `{string}` — paths to brush icons for the construction menu
### Gui.Construction.provideDustWheneverPossible[🔗](#$api.gui~Gui.Construction.provideDustWheneverPossible)
```
function Gui.Construction.provideDustWheneverPossible(proposal : Proposal, proposalData : ProposalData)
```
Provides dust effects for proposal
**Parameters**
* `proposal` :`Proposal` — the proposal
* `proposalData` :`ProposalData` — the proposal data
### Gui.Construction.getRefundableEntities[🔗](#$api.gui~Gui.Construction.getRefundableEntities)
```
function Gui.Construction.getRefundableEntities(): {{Engine.Entity, integer}, {Engine.Revision, integer}}
```
**Returns**
1. `{{Engine.Entity, integer}, {Engine.Revision, integer}}`
### Gui.Construction.updateRefundableEntities[🔗](#$api.gui~Gui.Construction.updateRefundableEntities)
```
function Gui.Construction.updateRefundableEntities(resultEntities : {Engine.Entity}, proposal : Proposal.StreetProposal)
```
Updates refundable entities
**Parameters**
* `resultEntities` :`{Engine.Entity}` — result entities
* `proposal` :`Proposal.StreetProposal` — the street proposal
### Gui.Mission[🔗](#$api.gui~Gui.Mission)
```
record Gui.Mission getMission: function(): string
getCampaign: function(): string
setZone: function(key : string, polygon : {Vec2f}, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number)
setZoneCircle: function(key : string, center : Vec2f, radius : number, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number)
removeZone: function(key : string)
setMarkerAtPosition: function(key : string, pos : Vec3f, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean)
setMarkerAtEntity: function(key : string, entity : Engine.Entity, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean)
removeMarker: function(key : string)
setMovePathVisualizationAtEntity: function(key : string, entity : Engine.Entity, color : Vec3f)
removeMovePathVisualization: function(key : string)
playCutscene: function(filePath : string, resolveLanguageFolder : boolean, entityToEntityMap : {Engine.Entity : Engine.Entity})
isCutscenePlaying: function(): boolean
getCutsceneElapsedTime: function(): number
end
```
### Gui.Mission.getMission[🔗](#$api.gui~Gui.Mission.getMission)
```
function Gui.Mission.getMission(): string
```
Get the current mission
**Returns**
1. `string` — the mission name
### Gui.Mission.getCampaign[🔗](#$api.gui~Gui.Mission.getCampaign)
```
function Gui.Mission.getCampaign(): string
```
Get the current campaign
**Returns**
1. `string` — the campaign name
### Gui.Mission.setZone[🔗](#$api.gui~Gui.Mission.setZone)
```
function Gui.Mission.setZone(key : string, polygon : {Vec2f}, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number)
```
Adds a zone
**Parameters**
* `key` :`string` — the key (name) of the zone
* `polygon` :`{Vec2f}` — the shape of the zone as a list of 2d position
* `draw` :`boolean` — if the zone should be drawn
* `drawColor` :`Vec4f` — the color of the zone
* `prohibitBuilding` :`boolean` — if prevented or not to build inside the zone
* `playAnimation` :`boolean` — if player zone animation (optional), default to true
* `zOffset` :`number` — (optional), default to terrain level
### Gui.Mission.setZoneCircle[🔗](#$api.gui~Gui.Mission.setZoneCircle)
```
function Gui.Mission.setZoneCircle(key : string, center : Vec2f, radius : number, draw : boolean, drawColor : Vec4f, prohibitBuilding : boolean, playAnimation : boolean, zOffset : number)
```
Adds a zone as a cylinder
**Parameters**
* `key` :`string` — the key (name) of the zone
* `center` :`Vec2f` — the center of the zone
* `radius` :`number` — the radius of the zone
* `draw` :`boolean` — if the zone should be drawn
* `drawColor` :`Vec4f` — the color of the zone
* `prohibitBuilding` :`boolean` — if prevented or not to build inside the zone
* `playAnimation` :`boolean` — if player zone animation (optional), default to true
* `zOffset` :`number` — (optional), default to terrain level
### Gui.Mission.removeZone[🔗](#$api.gui~Gui.Mission.removeZone)
```
function Gui.Mission.removeZone(key : string)
```
Removes a zone
**Parameters**
* `key` :`string` — the key of the zone
### Gui.Mission.setMarkerAtPosition[🔗](#$api.gui~Gui.Mission.setMarkerAtPosition)
```
function Gui.Mission.setMarkerAtPosition(key : string, pos : Vec3f, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean)
```
Sets marker at the given position
**Parameters**
* `key` :`string` — the key of the marker
* `pos` :`Vec3f` — the position of the marker
* `type` :`string` — type of marker (optional)
* `scaling` :`number` — scaling of marker (optional)
* `isSelectable` :`boolean` — whether marker is selectable
* `fireSelectEntity` :`boolean` — whether selecting the marker also selects the underlying entity (default is true)
### Gui.Mission.setMarkerAtEntity[🔗](#$api.gui~Gui.Mission.setMarkerAtEntity)
```
function Gui.Mission.setMarkerAtEntity(key : string, entity : Engine.Entity, type : string, scaling : number, isSelectable : boolean, fireSelectEntity : boolean)
```
Sets marker at the given entity
**Parameters**
* `key` :`string` — the key of the marker
* `entity` :`Engine.Entity` — the entity
* `type` :`string` — optional type
* `scaling` :`number` — optional scaling
* `isSelectable` :`boolean` — whether marker is selectable
* `fireSelectEntity` :`boolean` — whether selecting the marker also selects the underlying entity (default is true)
### Gui.Mission.removeMarker[🔗](#$api.gui~Gui.Mission.removeMarker)
```
function Gui.Mission.removeMarker(key : string)
```
Removes a marker
**Parameters**
* `key` :`string` — the key of the marker
### Gui.Mission.setMovePathVisualizationAtEntity[🔗](#$api.gui~Gui.Mission.setMovePathVisualizationAtEntity)
```
function Gui.Mission.setMovePathVisualizationAtEntity(key : string, entity : Engine.Entity, color : Vec3f)
```
Renderes the move path of an entity dynamically
ATTENTION: at the moment, only ships are supported.
**Parameters**
* `key` :`string` — unique key
* `entity` :`Engine.Entity` — entity
* `color` :`Vec3f` — optional color
### Gui.Mission.removeMovePathVisualization[🔗](#$api.gui~Gui.Mission.removeMovePathVisualization)
```
function Gui.Mission.removeMovePathVisualization(key : string)
```
Removes the move path of an entity dynamically
**Parameters**
* `key` :`string` — unique key
### Gui.Mission.playCutscene[🔗](#$api.gui~Gui.Mission.playCutscene)
```
function Gui.Mission.playCutscene(filePath : string, resolveLanguageFolder : boolean, entityToEntityMap : {Engine.Entity : Engine.Entity})
```
Plays a cutscene.
**Parameters**
* `filePath` :`string` — the filepath to the cutscene keyframe definition that should be played
* `resolveLanguageFolder` :`boolean` — automatically resolve the selected keyframe file by language
* `entityToEntityMap` :`{Engine.Entity : Engine.Entity}` — maps entities from the keyframe file to possible runtime entities
### Gui.Mission.isCutscenePlaying[🔗](#$api.gui~Gui.Mission.isCutscenePlaying)
```
function Gui.Mission.isCutscenePlaying(): boolean
```
Checks if a cutscene is currently playing.
**Returns**
1. `boolean`
### Gui.Mission.getCutsceneElapsedTime[🔗](#$api.gui~Gui.Mission.getCutsceneElapsedTime)
```
function Gui.Mission.getCutsceneElapsedTime(): number
```
Return the current cutscene time for syncing mission related systems to the cutscene
**Returns**
1. `number` — the actual simulated cutscene time
### Gui.Game[🔗](#$api.gui~Gui.Game)
```
record Gui.Game isSavegameUIBlocked: function(): boolean
setInGameMenuPause: function(pause : boolean)
getGuiSaveData: function(modId : string): {<any type> : <any type>}
setGuiSaveData: function(modId : string, data : {<any type> : <any type>})
getEstimatedMaximumGameSpeed: function(): integer
isMapEditor: function(): boolean
getDefaultSavegameId: function(): string
setEnvironment: function(environment : ResName)
getEnvironment: function(): ResName
end
```
### Gui.Game.isSavegameUIBlocked[🔗](#$api.gui~Gui.Game.isSavegameUIBlocked)
```
function Gui.Game.isSavegameUIBlocked(): boolean
```
Returns if the UI is blocked by a savegame in progress
**Returns**
1. `boolean` — true if the ui is blocked by a savegame
### Gui.Game.setInGameMenuPause[🔗](#$api.gui~Gui.Game.setInGameMenuPause)
```
function Gui.Game.setInGameMenuPause(pause : boolean)
```
Sets if the game pause menu is open
**Parameters**
* `pause` :`boolean` — true if the user is in the pause menu
### Gui.Game.getGuiSaveData[🔗](#$api.gui~Gui.Game.getGuiSaveData)
```
function Gui.Game.getGuiSaveData(modId : string): {<any type> : <any type>}
```
Returns the GUI SaveData
**Parameters**
* `modId` :`string` — the mod to get the user data for
**Returns**
1. `{<any type> : <any type>}` — the userData as a lua table
### Gui.Game.setGuiSaveData[🔗](#$api.gui~Gui.Game.setGuiSaveData)
```
function Gui.Game.setGuiSaveData(modId : string, data : {<any type> : <any type>})
```
Sets the GUI SaveData
**Parameters**
* `modId` :`string` — the mod to set the user data for
* `data` :`{<any type> : <any type>}` — the user data
### Gui.Game.getEstimatedMaximumGameSpeed[🔗](#$api.gui~Gui.Game.getEstimatedMaximumGameSpeed)
```
function Gui.Game.getEstimatedMaximumGameSpeed(): integer
```
Returns the (estimated) maximum possible game speed based on actual simulation timings.
Only available in GUI thread.
**Returns**
1. `integer` — maximum game speed (or 0 if not enough data available)
### Gui.Game.isMapEditor[🔗](#$api.gui~Gui.Game.isMapEditor)
```
function Gui.Game.isMapEditor(): boolean
```
Returns if the game is currently in the map editor
**Returns**
1. `boolean` — true if in the map editor
### Gui.Game.getDefaultSavegameId[🔗](#$api.gui~Gui.Game.getDefaultSavegameId)
```
function Gui.Game.getDefaultSavegameId(): string
```
Returns the default savegame id
**Returns**
1. `string` — the default savegame id
### Gui.Game.setEnvironment[🔗](#$api.gui~Gui.Game.setEnvironment)
```
function Gui.Game.setEnvironment(environment : ResName)
```
Sets an environment. This value is saved in the GUI SaveData and will be restored on next load.
Changing it will not change the current environment, for that `api.gui.rendering.setEnvironment` needs to be as well called.
**Parameters**
* `environment` :`ResName` — the resource name for the environment
### Gui.Game.getEnvironment[🔗](#$api.gui~Gui.Game.getEnvironment)
```
function Gui.Game.getEnvironment(): ResName
```
Returns the resource name of the current environment
**Returns**
1. `ResName` — the environment resource name
### Gui.Guide[🔗](#$api.gui~Gui.Guide)
```
[Expand All] [Collapse All]
record Gui.Guide record GuidePosition Left: GuidePosition
Right: GuidePosition
Above: GuidePosition
Below: GuidePosition
end
record FreeGuidePosition High: FreeGuidePosition
Low: FreeGuidePosition
end
record GuideTarget new: function(string, GuidePosition): GuideTarget
idOrTag: string
position: GuidePosition
end
trySpawnGuideById: function({GuideTarget}, string, string): boolean
trySpawnGuideFree: function(FreeGuidePosition, string, string): boolean
completeGuideById: function({GuideTarget}): boolean
end
```
### Gui.Guide.GuidePosition[🔗](#$api.gui~Gui.Guide.GuidePosition)
```
record Gui.Guide.GuidePosition Left: GuidePosition
Right: GuidePosition
Above: GuidePosition
Below: GuidePosition
end
```
Gui positioning of the guide "bookmark" with respect to target component
### Gui.Guide.GuidePosition.Left[🔗](#$api.gui~Gui.Guide.GuidePosition.Left)
```
Gui.Guide.GuidePosition.Left: GuidePosition
```
### Gui.Guide.GuidePosition.Right[🔗](#$api.gui~Gui.Guide.GuidePosition.Right)
```
Gui.Guide.GuidePosition.Right: GuidePosition
```
### Gui.Guide.GuidePosition.Above[🔗](#$api.gui~Gui.Guide.GuidePosition.Above)
```
Gui.Guide.GuidePosition.Above: GuidePosition
```
### Gui.Guide.GuidePosition.Below[🔗](#$api.gui~Gui.Guide.GuidePosition.Below)
```
Gui.Guide.GuidePosition.Below: GuidePosition
```
### Gui.Guide.FreeGuidePosition[🔗](#$api.gui~Gui.Guide.FreeGuidePosition)
```
record Gui.Guide.FreeGuidePosition High: FreeGuidePosition
Low: FreeGuidePosition
end
```
Gui positioning of the guide "bookmark" with respect to the entire screen
### Gui.Guide.FreeGuidePosition.High[🔗](#$api.gui~Gui.Guide.FreeGuidePosition.High)
```
Gui.Guide.FreeGuidePosition.High: FreeGuidePosition
```
### Gui.Guide.FreeGuidePosition.Low[🔗](#$api.gui~Gui.Guide.FreeGuidePosition.Low)
```
Gui.Guide.FreeGuidePosition.Low: FreeGuidePosition
```
### Gui.Guide.GuideTarget[🔗](#$api.gui~Gui.Guide.GuideTarget)
```
record Gui.Guide.GuideTarget new: function(string, GuidePosition): GuideTarget
idOrTag: string
position: GuidePosition
end
```
A target component for the guide system
### Gui.Guide.GuideTarget.new[🔗](#$api.gui~Gui.Guide.GuideTarget.new)
```
function Gui.Guide.GuideTarget.new(string, GuidePosition): GuideTarget
```
**Parameters**
* `string`
* `GuidePosition`
**Returns**
1. `GuideTarget`
### Gui.Guide.GuideTarget.idOrTag[🔗](#$api.gui~Gui.Guide.GuideTarget.idOrTag)
```
Gui.Guide.GuideTarget.idOrTag: string
```
### Gui.Guide.GuideTarget.position[🔗](#$api.gui~Gui.Guide.GuideTarget.position)
```
Gui.Guide.GuideTarget.position: GuidePosition
```
### Gui.Guide.trySpawnGuideById[🔗](#$api.gui~Gui.Guide.trySpawnGuideById)
```
function Gui.Guide.trySpawnGuideById({GuideTarget}, string, string): boolean
```
**Parameters**
* `{GuideTarget}`
* `string`
* `string`
**Returns**
1. `boolean`
### Gui.Guide.trySpawnGuideFree[🔗](#$api.gui~Gui.Guide.trySpawnGuideFree)
```
function Gui.Guide.trySpawnGuideFree(FreeGuidePosition, string, string): boolean
```
**Parameters**
* `FreeGuidePosition`
* `string`
* `string`
**Returns**
1. `boolean`
### Gui.Guide.completeGuideById[🔗](#$api.gui~Gui.Guide.completeGuideById)
```
function Gui.Guide.completeGuideById({GuideTarget}): boolean
```
**Parameters**
* `{GuideTarget}`
**Returns**
1. `boolean`
### Gui.Rendering[🔗](#$api.gui~Gui.Rendering)
```
record Gui.Rendering setEnvironment: function(environment : Environment)
getEnvironment: function(): Environment
spawnDust: function(bbMin : Vec3f, bbMax : Vec3f, transf : Mat4f)
getFrameTime01: function(): number
end
```
### Gui.Rendering.setEnvironment[🔗](#$api.gui~Gui.Rendering.setEnvironment)
```
function Gui.Rendering.setEnvironment(environment : Environment)
```
Sets an environment. This will change the current environment, but will not persist the environment resource name.
It might be necessary to as well call `api.gui.game.setEnvironment` if a different environment resource is set.
**Parameters**
* `environment` :`Environment` — the description for the environment
### Gui.Rendering.getEnvironment[🔗](#$api.gui~Gui.Rendering.getEnvironment)
```
function Gui.Rendering.getEnvironment(): Environment
```
Returns the current environment data
**Returns**
1. `Environment` — the current environment data
### Gui.Rendering.spawnDust[🔗](#$api.gui~Gui.Rendering.spawnDust)
```
function Gui.Rendering.spawnDust(bbMin : Vec3f, bbMax : Vec3f, transf : Mat4f)
```
Makes a dust cloud appear
**Parameters**
* `bbMin` :`Vec3f` — bounding box min
* `bbMax` :`Vec3f` — bounding box max
* `transf` :`Mat4f` — transformation matrix
### Gui.Rendering.getFrameTime01[🔗](#$api.gui~Gui.Rendering.getFrameTime01)
```
function Gui.Rendering.getFrameTime01(): number
```
**Returns**
1. `number`
### Gui.Map[🔗](#$api.gui~Gui.Map)
```
record Gui.Map setMapSeedText: function(seed : string)
reloadMaterialIndexManagerPipeline: function()
openTerrainEditor: function()
closeTerrainEditor: function()
end
```
### Gui.Map.setMapSeedText[🔗](#$api.gui~Gui.Map.setMapSeedText)
```
function Gui.Map.setMapSeedText(seed : string)
```
Sets seed for the map. Only available in GUI thread.
**Parameters**
* `seed` :`string` — the seed
### Gui.Map.reloadMaterialIndexManagerPipeline[🔗](#$api.gui~Gui.Map.reloadMaterialIndexManagerPipeline)
```
function Gui.Map.reloadMaterialIndexManagerPipeline()
```
Reloads the material index manager pipeline.
### Gui.Map.openTerrainEditor[🔗](#$api.gui~Gui.Map.openTerrainEditor)
```
function Gui.Map.openTerrainEditor()
```
### Gui.Map.closeTerrainEditor[🔗](#$api.gui~Gui.Map.closeTerrainEditor)
```
function Gui.Map.closeTerrainEditor()
```
### Gui.BenchMark[🔗](#$api.gui~Gui.BenchMark)
```
[Expand All] [Collapse All]
record Gui.BenchMark record SimTime frameTime: integer
gameTime: integer
end
getBeginFrameTimes: function(): {integer}
getEventTimes: function(): {integer}
getCoreStepTimes: function(): {integer}
getRenderTimes: function(): {integer}
getSwapTimes: function(): {integer}
getReplicateTimes: function(): {SimTime}
getCommandTimes: function(): {SimTime}
getGameStepTimes: function(): {SimTime}
end
```
### Gui.BenchMark.SimTime[🔗](#$api.gui~Gui.BenchMark.SimTime)
```
record Gui.BenchMark.SimTime frameTime: integer
gameTime: integer
end
```
Simulation time frame along with game time at moment of capture
### Gui.BenchMark.SimTime.frameTime[🔗](#$api.gui~Gui.BenchMark.SimTime.frameTime)
```
Gui.BenchMark.SimTime.frameTime: integer
```
### Gui.BenchMark.SimTime.gameTime[🔗](#$api.gui~Gui.BenchMark.SimTime.gameTime)
```
Gui.BenchMark.SimTime.gameTime: integer
```
### Gui.BenchMark.getBeginFrameTimes[🔗](#$api.gui~Gui.BenchMark.getBeginFrameTimes)
```
function Gui.BenchMark.getBeginFrameTimes(): {integer}
```
Returns the rendering preparation time
**Returns**
1. `{integer}`
### Gui.BenchMark.getEventTimes[🔗](#$api.gui~Gui.BenchMark.getEventTimes)
```
function Gui.BenchMark.getEventTimes(): {integer}
```
Returns the events processing time
**Returns**
1. `{integer}`
### Gui.BenchMark.getCoreStepTimes[🔗](#$api.gui~Gui.BenchMark.getCoreStepTimes)
```
function Gui.BenchMark.getCoreStepTimes(): {integer}
```
Returns the gui update time
**Returns**
1. `{integer}`
### Gui.BenchMark.getRenderTimes[🔗](#$api.gui~Gui.BenchMark.getRenderTimes)
```
function Gui.BenchMark.getRenderTimes(): {integer}
```
Returns the rendering time
**Returns**
1. `{integer}`
### Gui.BenchMark.getSwapTimes[🔗](#$api.gui~Gui.BenchMark.getSwapTimes)
```
function Gui.BenchMark.getSwapTimes(): {integer}
```
Returns the rendering finish time
**Returns**
1. `{integer}`
### Gui.BenchMark.getReplicateTimes[🔗](#$api.gui~Gui.BenchMark.getReplicateTimes)
```
function Gui.BenchMark.getReplicateTimes(): {SimTime}
```
Returns the sync time between gui and simulation. Only available in GUI thread.
**Returns**
1. `{SimTime}`
### Gui.BenchMark.getCommandTimes[🔗](#$api.gui~Gui.BenchMark.getCommandTimes)
```
function Gui.BenchMark.getCommandTimes(): {SimTime}
```
Returns commands processing time. Only available in GUI thread.
**Returns**
1. `{SimTime}`
### Gui.BenchMark.getGameStepTimes[🔗](#$api.gui~Gui.BenchMark.getGameStepTimes)
```
function Gui.BenchMark.getGameStepTimes(): {SimTime}
```
Returns the simulation update time. Only available in GUI thread.
**Returns**
1. `{SimTime}`
### Gui.Debug[🔗](#$api.gui~Gui.Debug)
```
record Gui.Debug selectEntity: function(entity : Engine.Entity)
end
```
### Gui.Debug.selectEntity[🔗](#$api.gui~Gui.Debug.selectEntity)
```
function Gui.Debug.selectEntity(entity : Engine.Entity)
```
Set the current debug entity
**Parameters**
* `entity` :`Engine.Entity` — the entity
### Gui.Achievements[🔗](#$api.gui~Gui.Achievements)
```
record Gui.Achievements areStatsDisabled: function(): boolean
unlockAchievement: function(achievement : string)
isAchievementUnlockable: function(achievement : string): boolean
isAchievementUnlocked: function(achievement : string): boolean
updateStat: function(playerStat : string, value : number)
setStat: function(playerStat : string, value : number)
getStatValue: function(playerStat : string): number
setStatExtraData: function(playerStat : string, data : {<any type> : <any type>})
getStatExtraData: function(playerStat : string): {<any type> : <any type>}
setEarnedSFX: function(sfx : {FilePath})
end
```
### Gui.Achievements.areStatsDisabled[🔗](#$api.gui~Gui.Achievements.areStatsDisabled)
```
function Gui.Achievements.areStatsDisabled(): boolean
```
Checkes whether player stats are disabled
**Returns**
1. `boolean` — true if player stats are disabled
### Gui.Achievements.unlockAchievement[🔗](#$api.gui~Gui.Achievements.unlockAchievement)
```
function Gui.Achievements.unlockAchievement(achievement : string)
```
Unlocks an achievement based on its string id
**Parameters**
* `achievement` :`string` — achievement to unlock
### Gui.Achievements.isAchievementUnlockable[🔗](#$api.gui~Gui.Achievements.isAchievementUnlockable)
```
function Gui.Achievements.isAchievementUnlockable(achievement : string): boolean
```
Checks whether an achievement can be unlocked
**Parameters**
* `achievement` :`string` — achievement to check
**Returns**
1. `boolean` — true if the achievement can be unlocked
### Gui.Achievements.isAchievementUnlocked[🔗](#$api.gui~Gui.Achievements.isAchievementUnlocked)
```
function Gui.Achievements.isAchievementUnlocked(achievement : string): boolean
```
Checks whether an achievement is unlocked (completed)
**Parameters**
* `achievement` :`string` — achievement to check
**Returns**
1. `boolean` — true if the achievement is unlocked
### Gui.Achievements.updateStat[🔗](#$api.gui~Gui.Achievements.updateStat)
```
function Gui.Achievements.updateStat(playerStat : string, value : number)
```
Increments a player stat value by the provided value
**Parameters**
* `playerStat` :`string` — the stat id to update
* `value` :`number` — the value to add to the stat
### Gui.Achievements.setStat[🔗](#$api.gui~Gui.Achievements.setStat)
```
function Gui.Achievements.setStat(playerStat : string, value : number)
```
Sets a player stat value, replacing the current value by the provided one
**Parameters**
* `playerStat` :`string` — the stat id to update
* `value` :`number` — the value to add to the stat
### Gui.Achievements.getStatValue[🔗](#$api.gui~Gui.Achievements.getStatValue)
```
function Gui.Achievements.getStatValue(playerStat : string): number
```
Gets a player stat value
**Parameters**
* `playerStat` :`string` — the stat id to get
**Returns**
1. `number` — the current value of the stat
### Gui.Achievements.setStatExtraData[🔗](#$api.gui~Gui.Achievements.setStatExtraData)
```
function Gui.Achievements.setStatExtraData(playerStat : string, data : {<any type> : <any type>})
```
Sets extra data associated with a stat.
Extra data are stored locally in the player profile and allow tracking of more informations if necessary.
**Parameters**
* `playerStat` :`string` — the stat id to set the extra data for
* `data` :`{<any type> : <any type>}` — the extra data to set
### Gui.Achievements.getStatExtraData[🔗](#$api.gui~Gui.Achievements.getStatExtraData)
```
function Gui.Achievements.getStatExtraData(playerStat : string): {<any type> : <any type>}
```
Gets extra data associated with a stat.
Extra data are stored locally in the player profile and allow tracking of more informations if necessary.
**Parameters**
* `playerStat` :`string` — the stat id to get the extra data for
**Returns**
1. `{<any type> : <any type>}` — the extra data
### Gui.Achievements.setEarnedSFX[🔗](#$api.gui~Gui.Achievements.setEarnedSFX)
```
function Gui.Achievements.setEarnedSFX(sfx : {FilePath})
```
Set sound effect(s) to be played when an achievement is earned.
**Parameters**
* `sfx` :`{FilePath}` — vector of filepaths pointing to .wav files with according sound effect(s)
### Gui.GenericRep[🔗](#$api.gui~Gui.GenericRep)
```
record Gui.GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer}
end
```
### Gui.GenericRep.getAllOfType[🔗](#$api.gui~Gui.GenericRep.getAllOfType)
```
function Gui.GenericRep.getAllOfType(typeName : string, includeInvisible : boolean): {integer}
```
Gets all the Genereic Resource Type of a given type name
Only allows typeName in { "gui*res*overwrite", "gui\_res" }, for other types, use `api.res.genericRep`
**Parameters**
* `typeName` :`string` — the type name
* `includeInvisible` :`boolean` — whether to include invisible resources
**Returns**
1. `{integer}`
### Gui.Backend[🔗](#$api.gui~Gui.Backend)
```
[Expand All] [Collapse All]
record Gui.Backend record LegalDocument title: string
text: string
end
isInitialized: function(): boolean
hasLegalDocuments: function()
getLegalDocuments: function(): {PdxLegalDocumentType}
isAccountLoggedIn: function(): boolean
loginAccount: function(string, string): PdxFuture<PdxLoginResult>
logoutAccount: function(): PdxFuture<PdxResult>
getAccountInfo: function(): PdxFuture<PdxAccountInfo>
getProfile: function(boolean): PdxFuture<PdxProfileResult>
createProfile: function(string, boolean): PdxFuture<PdxResult>
renameProfile: function(string, boolean): PdxFuture<PdxResult>
getCountries: function(): {PdxCountry}
getLegalDocument: function(PdxLegalDocumentType): PdxFuture<PdxLegalDocument>
createAccount: function(string, string, string, integer, boolean): PdxFuture<PdxResult>
supportsAccountLinking: function(): boolean
getThirdPartyLinkState: function(): PdxFuture<PdxThirdPartyLinkState>
getThirdPartyAutoLoginPromptState: function(): PdxThirdPartyAutoLoginPromptState
setThirdPartyAutoLoginPromptState: function(PdxThirdPartyAutoLoginPromptState)
linkThirdPartyAccount: function(): PdxFuture<PdxResult>
unlinkThirdPartyAccount: function(): PdxFuture<PdxResult>
loginThirdPartyAccount: function(): PdxFuture<PdxLoginResult>
end
```
### Gui.Backend.LegalDocument[🔗](#$api.gui~Gui.Backend.LegalDocument)
```
record Gui.Backend.LegalDocument title: string
text: string
end
```
### Gui.Backend.LegalDocument.title[🔗](#$api.gui~Gui.Backend.LegalDocument.title)
```
Gui.Backend.LegalDocument.title: string
```
### Gui.Backend.LegalDocument.text[🔗](#$api.gui~Gui.Backend.LegalDocument.text)
```
Gui.Backend.LegalDocument.text: string
```
### Gui.Backend.isInitialized[🔗](#$api.gui~Gui.Backend.isInitialized)
```
function Gui.Backend.isInitialized(): boolean
```
**Returns**
1. `boolean`
### Gui.Backend.hasLegalDocuments[🔗](#$api.gui~Gui.Backend.hasLegalDocuments)
```
function Gui.Backend.hasLegalDocuments()
```
### Gui.Backend.getLegalDocuments[🔗](#$api.gui~Gui.Backend.getLegalDocuments)
```
function Gui.Backend.getLegalDocuments(): {PdxLegalDocumentType}
```
**Returns**
1. `{PdxLegalDocumentType}`
### Gui.Backend.isAccountLoggedIn[🔗](#$api.gui~Gui.Backend.isAccountLoggedIn)
```
function Gui.Backend.isAccountLoggedIn(): boolean
```
**Returns**
1. `boolean`
### Gui.Backend.loginAccount[🔗](#$api.gui~Gui.Backend.loginAccount)
```
function Gui.Backend.loginAccount(string, string): PdxFuture<PdxLoginResult>
```
**Parameters**
* `string`
* `string`
**Returns**
1. `PdxFuture<PdxLoginResult>`
### Gui.Backend.logoutAccount[🔗](#$api.gui~Gui.Backend.logoutAccount)
```
function Gui.Backend.logoutAccount(): PdxFuture<PdxResult>
```
**Returns**
1. `PdxFuture<PdxResult>`
### Gui.Backend.getAccountInfo[🔗](#$api.gui~Gui.Backend.getAccountInfo)
```
function Gui.Backend.getAccountInfo(): PdxFuture<PdxAccountInfo>
```
**Returns**
1. `PdxFuture<PdxAccountInfo>`
### Gui.Backend.getProfile[🔗](#$api.gui~Gui.Backend.getProfile)
```
function Gui.Backend.getProfile(boolean): PdxFuture<PdxProfileResult>
```
**Parameters**
* `boolean`
**Returns**
1. `PdxFuture<PdxProfileResult>`
### Gui.Backend.createProfile[🔗](#$api.gui~Gui.Backend.createProfile)
```
function Gui.Backend.createProfile(string, boolean): PdxFuture<PdxResult>
```
**Parameters**
* `string`
* `boolean`
**Returns**
1. `PdxFuture<PdxResult>`
### Gui.Backend.renameProfile[🔗](#$api.gui~Gui.Backend.renameProfile)
```
function Gui.Backend.renameProfile(string, boolean): PdxFuture<PdxResult>
```
**Parameters**
* `string`
* `boolean`
**Returns**
1. `PdxFuture<PdxResult>`
### Gui.Backend.getCountries[🔗](#$api.gui~Gui.Backend.getCountries)
```
function Gui.Backend.getCountries(): {PdxCountry}
```
**Returns**
1. `{PdxCountry}`
### Gui.Backend.getLegalDocument[🔗](#$api.gui~Gui.Backend.getLegalDocument)
```
function Gui.Backend.getLegalDocument(PdxLegalDocumentType): PdxFuture<PdxLegalDocument>
```
**Parameters**
* `PdxLegalDocumentType`
**Returns**
1. `PdxFuture<PdxLegalDocument>`
### Gui.Backend.createAccount[🔗](#$api.gui~Gui.Backend.createAccount)
```
function Gui.Backend.createAccount(string, string, string, integer, boolean): PdxFuture<PdxResult>
```
**Parameters**
* `string`
* `string`
* `string`
* `integer`
* `boolean`
**Returns**
1. `PdxFuture<PdxResult>`
### Gui.Backend.supportsAccountLinking[🔗](#$api.gui~Gui.Backend.supportsAccountLinking)
```
function Gui.Backend.supportsAccountLinking(): boolean
```
**Returns**
1. `boolean`
### Gui.Backend.getThirdPartyLinkState[🔗](#$api.gui~Gui.Backend.getThirdPartyLinkState)
```
function Gui.Backend.getThirdPartyLinkState(): PdxFuture<PdxThirdPartyLinkState>
```
**Returns**
1. `PdxFuture<PdxThirdPartyLinkState>`
### Gui.Backend.getThirdPartyAutoLoginPromptState[🔗](#$api.gui~Gui.Backend.getThirdPartyAutoLoginPromptState)
```
function Gui.Backend.getThirdPartyAutoLoginPromptState(): PdxThirdPartyAutoLoginPromptState
```
**Returns**
1. `PdxThirdPartyAutoLoginPromptState`
### Gui.Backend.setThirdPartyAutoLoginPromptState[🔗](#$api.gui~Gui.Backend.setThirdPartyAutoLoginPromptState)
```
function Gui.Backend.setThirdPartyAutoLoginPromptState(PdxThirdPartyAutoLoginPromptState)
```
**Parameters**
* `PdxThirdPartyAutoLoginPromptState`
### Gui.Backend.linkThirdPartyAccount[🔗](#$api.gui~Gui.Backend.linkThirdPartyAccount)
```
function Gui.Backend.linkThirdPartyAccount(): PdxFuture<PdxResult>
```
**Returns**
1. `PdxFuture<PdxResult>`
### Gui.Backend.unlinkThirdPartyAccount[🔗](#$api.gui~Gui.Backend.unlinkThirdPartyAccount)
```
function Gui.Backend.unlinkThirdPartyAccount(): PdxFuture<PdxResult>
```
**Returns**
1. `PdxFuture<PdxResult>`
### Gui.Backend.loginThirdPartyAccount[🔗](#$api.gui~Gui.Backend.loginThirdPartyAccount)
```
function Gui.Backend.loginThirdPartyAccount(): PdxFuture<PdxLoginResult>
```
**Returns**
1. `PdxFuture<PdxLoginResult>`
### Gui.mouse[🔗](#$api.gui~Gui.mouse)
```
Gui.mouse: Mouse
```
### Gui.key[🔗](#$api.gui~Gui.key)
```
Gui.key: Key
```
### Gui.dnd[🔗](#$api.gui~Gui.dnd)
```
Gui.dnd: DnD
```
### Gui.inputAction[🔗](#$api.gui~Gui.inputAction)
```
Gui.inputAction: InputAction
```
### Gui.byId[🔗](#$api.gui~Gui.byId)
```
Gui.byId: ById
```
### Gui.camera[🔗](#$api.gui~Gui.camera)
```
Gui.camera: Camera
```
### Gui.sound[🔗](#$api.gui~Gui.sound)
```
Gui.sound: Sound
```
### Gui.musicPlayer[🔗](#$api.gui~Gui.musicPlayer)
```
Gui.musicPlayer: MusicPlayer
```
### Gui.backend[🔗](#$api.gui~Gui.backend)
```
Gui.backend: Backend
```
### Gui.voiceOverManager[🔗](#$api.gui~Gui.voiceOverManager)
```
Gui.voiceOverManager: VoiceOverManager
```
### Gui.byEntity[🔗](#$api.gui~Gui.byEntity)
```
Gui.byEntity: ByEntity
```
### Gui.contextHelper[🔗](#$api.gui~Gui.contextHelper)
```
Gui.contextHelper: ContextHelper
```
### Gui.construction[🔗](#$api.gui~Gui.construction)
```
Gui.construction: Construction
```
### Gui.mission[🔗](#$api.gui~Gui.mission)
```
Gui.mission: Mission
```
### Gui.guide[🔗](#$api.gui~Gui.guide)
```
Gui.guide: Guide
```
### Gui.game[🔗](#$api.gui~Gui.game)
```
Gui.game: Game
```
### Gui.map[🔗](#$api.gui~Gui.map)
```
Gui.map: Map
```
### Gui.benchMark[🔗](#$api.gui~Gui.benchMark)
```
Gui.benchMark: BenchMark
```
### Gui.rendering[🔗](#$api.gui~Gui.rendering)
```
Gui.rendering: Rendering
```
### Gui.debug[🔗](#$api.gui~Gui.debug)
```
Gui.debug: Debug
```
### Gui.achievements[🔗](#$api.gui~Gui.achievements)
```
Gui.achievements: Achievements
```
### Gui.genericRep[🔗](#$api.gui~Gui.genericRep)
```
Gui.genericRep: GenericRep
```
### Gui.StyleSheet[🔗](#$api.gui~Gui.StyleSheet)
```
Gui.StyleSheet: StyleSheet
```
### Gui.NinePatch[🔗](#$api.gui~Gui.NinePatch)
```
Gui.NinePatch: NinePatch
```
## Category: globals[🔗](#category-globals)
### NinePatch[🔗](#$api.gui~NinePatch)
```
global record NinePatch new: function(): NinePatch
fileName: string
horizontal: {integer}
vertical: {integer}
flipHorizontally: boolean
repeatHorizontally: boolean
repeatVertically: boolean
repeatFactor: number
end
```
Nine-patch image description.
### NinePatch.new[🔗](#$api.gui~NinePatch.new)
```
function NinePatch.new(): NinePatch
```
**Returns**
1. `NinePatch`
### NinePatch.fileName[🔗](#$api.gui~NinePatch.fileName)
```
NinePatch.fileName: string
```
### NinePatch.horizontal[🔗](#$api.gui~NinePatch.horizontal)
```
NinePatch.horizontal: {integer}
```
### NinePatch.vertical[🔗](#$api.gui~NinePatch.vertical)
```
NinePatch.vertical: {integer}
```
### NinePatch.flipHorizontally[🔗](#$api.gui~NinePatch.flipHorizontally)
```
NinePatch.flipHorizontally: boolean
```
### NinePatch.repeatHorizontally[🔗](#$api.gui~NinePatch.repeatHorizontally)
```
NinePatch.repeatHorizontally: boolean
```
### NinePatch.repeatVertically[🔗](#$api.gui~NinePatch.repeatVertically)
```
NinePatch.repeatVertically: boolean
```
### NinePatch.repeatFactor[🔗](#$api.gui~NinePatch.repeatFactor)
```
NinePatch.repeatFactor: number
```
Repeat factor (must be positive).
### StyleSheet[🔗](#$api.gui~StyleSheet)
```
global record StyleSheet new: function(): StyleSheet
backgroundColor: Vec4f
backgroundColor1: Vec4f
backgroundColor2: Vec4f
backgroundImage1: NinePatch
backgroundImage2: NinePatch
borderWidth: Vec4f
borderColor: Vec4f
color: Vec4f
size: Vec2f
padding: Vec4f
fontSize: integer
borderImage: NinePatch
anchorPoint: Vec2f
end
```
Stylesheet used by GUI components.
### StyleSheet.new[🔗](#$api.gui~StyleSheet.new)
```
function StyleSheet.new(): StyleSheet
```
**Returns**
1. `StyleSheet`
### StyleSheet.backgroundColor[🔗](#$api.gui~StyleSheet.backgroundColor)
```
StyleSheet.backgroundColor: Vec4f
```
### StyleSheet.backgroundColor1[🔗](#$api.gui~StyleSheet.backgroundColor1)
```
StyleSheet.backgroundColor1: Vec4f
```
### StyleSheet.backgroundColor2[🔗](#$api.gui~StyleSheet.backgroundColor2)
```
StyleSheet.backgroundColor2: Vec4f
```
### StyleSheet.backgroundImage1[🔗](#$api.gui~StyleSheet.backgroundImage1)
```
StyleSheet.backgroundImage1: NinePatch
```
### StyleSheet.backgroundImage2[🔗](#$api.gui~StyleSheet.backgroundImage2)
```
StyleSheet.backgroundImage2: NinePatch
```
### StyleSheet.borderWidth[🔗](#$api.gui~StyleSheet.borderWidth)
```
StyleSheet.borderWidth: Vec4f
```
### StyleSheet.borderColor[🔗](#$api.gui~StyleSheet.borderColor)
```
StyleSheet.borderColor: Vec4f
```
### StyleSheet.color[🔗](#$api.gui~StyleSheet.color)
```
StyleSheet.color: Vec4f
```
### StyleSheet.size[🔗](#$api.gui~StyleSheet.size)
```
StyleSheet.size: Vec2f
```
### StyleSheet.padding[🔗](#$api.gui~StyleSheet.padding)
```
StyleSheet.padding: Vec4f
```
### StyleSheet.fontSize[🔗](#$api.gui~StyleSheet.fontSize)
```
StyleSheet.fontSize: integer
```
### StyleSheet.borderImage[🔗](#$api.gui~StyleSheet.borderImage)
```
StyleSheet.borderImage: NinePatch
```
### StyleSheet.anchorPoint[🔗](#$api.gui~StyleSheet.anchorPoint)
```
StyleSheet.anchorPoint: Vec2f
```