index / api / gui

Module api.gui🔗

Contains all GUI functionality apart from react.

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🔗

Gui🔗

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🔗

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🔗

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🔗

record Gui.HighlightStyle Square: HighlightStyle Circle: HighlightStyle end

Gui.HighlightStyle.Square🔗

Gui.HighlightStyle.Square: HighlightStyle

Gui.HighlightStyle.Circle🔗

Gui.HighlightStyle.Circle: HighlightStyle

Gui.SpawnHudImageParams🔗

record Gui.SpawnHudImageParams iconPath: FilePath color: Vec4f entity: Engine.Entity position: Vec3f end

Gui.SpawnHudImageParams.iconPath🔗

Gui.SpawnHudImageParams.iconPath: FilePath

Mandatory path to the icon

Gui.SpawnHudImageParams.color🔗

Gui.SpawnHudImageParams.color: Vec4f

Optional color. If set, the icon is expected to be grayscale.

Gui.SpawnHudImageParams.entity🔗

Gui.SpawnHudImageParams.entity: Engine.Entity

Optional entity (if not used, specify position)

Gui.SpawnHudImageParams.position🔗

Gui.SpawnHudImageParams.position: Vec3f

Optional position (if not used, position of the entity is used)

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🔗

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🔗

function Gui.closeAllWindows()

Close all windows

Gui.SelectionDetails🔗

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()🔗

function Gui.SelectionDetails.new()(): SelectionDetails
Returns
  1. SelectionDetails

Gui.SelectionDetails.new(SelectionDetails)🔗

function Gui.SelectionDetails.new(SelectionDetails)(SelectionDetails): SelectionDetails
Parameters
  • SelectionDetails
Returns
  1. SelectionDetails

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🔗

Gui.SelectionDetails.Type.None: Type

Gui.SelectionDetails.Type.Line🔗

Gui.SelectionDetails.Type.Line: Type

Gui.SelectionDetails.Type.Station🔗

Gui.SelectionDetails.Type.Station: Type

Gui.SelectionDetails.Type.Signal🔗

Gui.SelectionDetails.Type.Signal: Type

Gui.SelectionDetails.Type.Stop🔗

Gui.SelectionDetails.Type.Stop: Type

Gui.SelectionDetails.Type.Waypoint🔗

Gui.SelectionDetails.Type.Waypoint: Type

Gui.SelectionDetails.Type.TransportNetworkEdge🔗

Gui.SelectionDetails.Type.TransportNetworkEdge: Type

Gui.SelectionDetails.Type.World🔗

Gui.SelectionDetails.Type.World: Type

Gui.SelectionDetails.Type.Marker🔗

Gui.SelectionDetails.Type.Marker: Type

Gui.SelectionDetails.Type.Town🔗

Gui.SelectionDetails.Type.Town: Type

Gui.SelectionDetails.DataType🔗

interface Gui.SelectionDetails.DataType kind: Type end

Gui.SelectionDetails.DataType.kind🔗

Gui.SelectionDetails.DataType.kind: Type

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🔗

Gui.SelectionDetails.Line.line: Engine.Entity

The line entity

Gui.SelectionDetails.Line.stop🔗

Gui.SelectionDetails.Line.stop: integer

Stop index where the selected line segment starts

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🔗

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🔗

function Gui.SelectionDetails.Station.new(): Station
Returns
  1. Station

Gui.SelectionDetails.Station.stationGroup🔗

Gui.SelectionDetails.Station.stationGroup: Engine.Entity

The station group entity

Gui.SelectionDetails.Station.flatStationTerminalIndex🔗

Gui.SelectionDetails.Station.flatStationTerminalIndex: integer

Index in the the StationGroup's flattened list of station/terminals

Gui.SelectionDetails.Station.stationTerminal🔗

Gui.SelectionDetails.Station.stationTerminal: StationTerminal

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🔗

Gui.SelectionDetails.Signal.signalList: Engine.Entity

The signalList entity

Gui.SelectionDetails.Signal.signalIndex🔗

Gui.SelectionDetails.Signal.signalIndex: integer

Index of the actual signal in the the SignalList

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🔗

function Gui.SelectionDetails.Stop.new(): Stop
Returns
  1. Stop

Gui.SelectionDetails.Stop.station🔗

Gui.SelectionDetails.Stop.station: SelectionDetails.Station

The station / terminal

Gui.SelectionDetails.Stop.line🔗

Gui.SelectionDetails.Stop.line: Engine.Entity

The line entity

Gui.SelectionDetails.Stop.stopIndex🔗

Gui.SelectionDetails.Stop.stopIndex: integer

Index of the stop in the line

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🔗

Gui.SelectionDetails.Waypoint.line: Engine.Entity

The line entity

Gui.SelectionDetails.Waypoint.stopIndex🔗

Gui.SelectionDetails.Waypoint.stopIndex: integer

Index of the stop in the line

Gui.SelectionDetails.Waypoint.waypointIndex🔗

Gui.SelectionDetails.Waypoint.waypointIndex: integer

Index of the waypoint in the line (index in stop.waypoints)

Gui.SelectionDetails.Waypoint.tag🔗

Gui.SelectionDetails.Waypoint.tag: integer

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🔗

function Gui.SelectionDetails.TransportNetworkEdge.new(): TransportNetworkEdge
Returns
  1. TransportNetworkEdge

Gui.SelectionDetails.TransportNetworkEdge.snap🔗

Gui.SelectionDetails.TransportNetworkEdge.snap: EdgePos

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🔗

function Gui.SelectionDetails.World.new(): World
Returns
  1. World

Gui.SelectionDetails.World.pos🔗

Gui.SelectionDetails.World.pos: Vec3f

Gui.SelectionDetails.World.water🔗

Gui.SelectionDetails.World.water: boolean

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🔗

function Gui.SelectionDetails.Marker.new(): Marker
Returns
  1. Marker

Gui.SelectionDetails.Marker.marker🔗

Gui.SelectionDetails.Marker.marker: string

Gui.SelectionDetails.Marker.fireSelectEntity🔗

Gui.SelectionDetails.Marker.fireSelectEntity: boolean

If true, select the underlying entity of the marker (default = true)

Gui.SelectionDetails.Marker.pos🔗

Gui.SelectionDetails.Marker.pos: Vec3f

Get the marker position (if it is a position marker)

Gui.SelectionDetails.Marker.entity🔗

Gui.SelectionDetails.Marker.entity: Engine.Entity

Get the marked entity (if it is an entity marker)

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🔗

function Gui.SelectionDetails.Town.new(): Town
Returns
  1. Town

Gui.SelectionDetails.Town.townEntity🔗

Gui.SelectionDetails.Town.townEntity: Engine.Entity

Gui.SelectionDetails.Town.districtType🔗

Gui.SelectionDetails.Town.districtType: LandUseType

Gui.SelectionDetails.Town.districtCenter🔗

Gui.SelectionDetails.Town.districtCenter: Vec3f

Gui.SelectionDetails.data🔗

Gui.SelectionDetails.data: DataType

Gui.WorldEvent🔗

record Gui.WorldEvent pos: {number, number, number} water: boolean end

Gui.WorldEvent.pos🔗

Gui.WorldEvent.pos: {number, number, number}

Gui.WorldEvent.water🔗

Gui.WorldEvent.water: boolean

Gui.Mouse🔗

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🔗

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🔗

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🔗

Gui.Mouse.Event.Type.Pressed: Type

Gui.Mouse.Event.Type.Released🔗

Gui.Mouse.Event.Type.Released: Type

Gui.Mouse.Event.Type.Clicked🔗

Gui.Mouse.Event.Type.Clicked: Type

Gui.Mouse.Event.Type.Entered🔗

Gui.Mouse.Event.Type.Entered: Type

Gui.Mouse.Event.Type.Exited🔗

Gui.Mouse.Event.Type.Exited: Type

Gui.Mouse.Event.Type.Moved🔗

Gui.Mouse.Event.Type.Moved: Type

Gui.Mouse.Event.Type.Wheel🔗

Gui.Mouse.Event.Type.Wheel: Type

Gui.Mouse.Event.Type.DoubleClicked🔗

Gui.Mouse.Event.Type.DoubleClicked: Type

Gui.Mouse.Event.Type.PressedOutside🔗

Gui.Mouse.Event.Type.PressedOutside: Type

Gui.Mouse.Event.type🔗

Gui.Mouse.Event.type: Type

Event type.

Gui.Mouse.Event.button🔗

Gui.Mouse.Event.button: integer

Mouse button: 0 = left, 1 = middle, 2 = right.

Gui.Mouse.Event.x🔗

Gui.Mouse.Event.x: integer

Horizontal position of the mouse when event was triggered

Gui.Mouse.Event.y🔗

Gui.Mouse.Event.y: integer

Vertical position of the mouse when event was triggered

Gui.Mouse.Event.xrel🔗

Gui.Mouse.Event.xrel: integer

Relative horizontal movement.

Gui.Mouse.Event.yrel🔗

Gui.Mouse.Event.yrel: integer

Relative vertical movement.

Gui.Mouse.Event.handled🔗

Gui.Mouse.Event.handled: boolean

Whether the event was already handled by a child component.

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🔗

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🔗

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🔗

record Gui.Key.State Up: State Pressed: State end

Gui.Key.State.Up🔗

Gui.Key.State.Up: State

Gui.Key.State.Pressed🔗

Gui.Key.State.Pressed: State

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🔗

Gui.Key.InputEvent.dir: State

Gui.Key.InputEvent.repeated🔗

Gui.Key.InputEvent.repeated: boolean

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🔗

function Gui.Key.InputEvent.isKeyboardEvent(InputEvent): boolean

Returns whether this is a keyboard event.

Parameters
  • InputEvent
Returns
  1. boolean

Gui.Key.InputEvent.getKey🔗

function Gui.Key.InputEvent.getKey(InputEvent): integer

Returns the key code.

Parameters
  • InputEvent
Returns
  1. integer

Gui.Key.InputEvent.getKeyMod🔗

function Gui.Key.InputEvent.getKeyMod(InputEvent): integer

Returns key modifiers.

Parameters
  • InputEvent
Returns
  1. integer

Gui.Key.Event🔗

record Gui.Key.Event data: InputEvent isPressed: function(Event): boolean end

Represents a key press event.

Gui.Key.Event.data🔗

Gui.Key.Event.data: InputEvent

Gui.Key.Event.isPressed🔗

function Gui.Key.Event.isPressed(Event): boolean

Returns whether the key is pressed.

Parameters
  • Event
Returns
  1. boolean

Gui.DataTransferItem🔗

record Gui.DataTransferItem new: function(ResName, any): DataTransferItem type: ResName data: any end

Gui.DataTransferItem.new🔗

function Gui.DataTransferItem.new(ResName, any): DataTransferItem
Parameters
  • ResName
  • any
Returns
  1. DataTransferItem

Gui.DataTransferItem.type🔗

Gui.DataTransferItem.type: ResName

Gui.DataTransferItem.data🔗

Gui.DataTransferItem.data: any

Gui.DnD🔗

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🔗

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🔗

record Gui.DnD.Event.Type Drop: Type DragStarted: Type DragEntered: Type DragExited: Type end

Gui.DnD.Event.Type.Drop🔗

Gui.DnD.Event.Type.Drop: Type

Gui.DnD.Event.Type.DragStarted🔗

Gui.DnD.Event.Type.DragStarted: Type

Gui.DnD.Event.Type.DragEntered🔗

Gui.DnD.Event.Type.DragEntered: Type

Gui.DnD.Event.Type.DragExited🔗

Gui.DnD.Event.Type.DragExited: Type

Gui.DnD.Event.type🔗

Gui.DnD.Event.type: Type

Event type.

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🔗

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🔗

function Gui.DnD.getAllTransferData(): {DataTransferItem}

Get current drag & drop data.

Returns
  1. {DataTransferItem} — current transfer data list

Gui.InputAction🔗

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🔗

record Gui.InputAction.InputActionState Disabled: InputActionState Inactive: InputActionState Enabled: InputActionState end

Gui.InputAction.InputActionState.Disabled🔗

Gui.InputAction.InputActionState.Disabled: InputActionState

Gui.InputAction.InputActionState.Inactive🔗

Gui.InputAction.InputActionState.Inactive: InputActionState

Gui.InputAction.InputActionState.Enabled🔗

Gui.InputAction.InputActionState.Enabled: InputActionState

Gui.InputAction.InvokeData🔗

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🔗

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🔗

Gui.InputAction.InvokeData.Status.Triggered: Status

Gui.InputAction.InvokeData.Status.Repeat🔗

Gui.InputAction.InvokeData.Status.Repeat: Status

Gui.InputAction.InvokeData.Status.PressedStep🔗

Gui.InputAction.InvokeData.Status.PressedStep: Status

Gui.InputAction.InvokeData.Status.EndReleased🔗

Gui.InputAction.InvokeData.Status.EndReleased: Status

Gui.InputAction.InvokeData.Status.EndAborted🔗

Gui.InputAction.InvokeData.Status.EndAborted: Status

Gui.InputAction.InvokeData.status🔗

Gui.InputAction.InvokeData.status: Status

status of the action.

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

function Gui.Camera.takeScreenshot(scale : integer)

Takes a screenshot and stores it in userdata folder

Parameters
  • scale :integer — image resolution

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🔗

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🔗

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🔗

function Gui.Camera.leaveFollowCameraCockpit()

Leave the cockpit of an entity.

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🔗

function Gui.Camera.toggleFreeCameraMouseAttachment()

Toggles mouse attachment

Gui.Camera.toggleFreeCamera🔗

function Gui.Camera.toggleFreeCamera()

Toggles free camera

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🔗

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🔗

function Gui.Camera.getEye(): Vec3f

Get camera origin in world coordinates

Returns
  1. Vec3f

Gui.Camera.getCenter🔗

function Gui.Camera.getCenter(): Vec3f

Get camera center ("look-at" pos) in world coordinates

Returns
  1. Vec3f

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🔗

function Gui.Camera.getSize(): Vec2i

Width and height of the viewport, in pixels

Returns
  1. Vec2i

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🔗

record Gui.Sound letVehicleHorn: function(vehicleEntity : Engine.Entity) playRandomSoundEffect: function(paths : {FilePath}) end

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🔗

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🔗

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🔗

function Gui.MusicPlayer.goBack()

Goes back to the previous track in the music player.

Gui.MusicPlayer.goForward🔗

function Gui.MusicPlayer.goForward()

Goes forward to the next track in the music player.

Gui.MusicPlayer.togglePause🔗

function Gui.MusicPlayer.togglePause()

Toggles pause/play state of the music player.

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🔗

function Gui.MusicPlayer.getArtist(): string

Gets the artist of the currently playing track.

Returns
  1. string — the track artist

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🔗

function Gui.MusicPlayer.getPlaylistIndex(): integer

Gets the current track index (1-based).

Returns
  1. integer — the current track index

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🔗

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🔗

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🔗

function Gui.MusicPlayer.isPlaying(): boolean

Checks if the music player is currently playing.

Returns
  1. boolean — true if music is playing

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🔗

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🔗

function Gui.MusicPlayer.getTrackLength(): number

Gets the length (duration) of the current track

Returns
  1. number — the track duration in second

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🔗

function Gui.MusicPlayer.getGain(): number

Gets the current gain (volume) of the music player.

Returns
  1. number — the gain value

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🔗

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🔗

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🔗

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🔗

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🔗

function Gui.VoiceOverManager.stop()

Stops the current voice over playing

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

record Gui.ContextHelper
record SubjectState Visible: SubjectState Focused: SubjectState end
collectSubjectStates: function(idsOfInterest : {string}): {string : SubjectState} getIdsOfActiveTool: function(): {string} end

Gui.ContextHelper.SubjectState🔗

record Gui.ContextHelper.SubjectState Visible: SubjectState Focused: SubjectState end

Gui.ContextHelper.SubjectState.Visible🔗

Gui.ContextHelper.SubjectState.Visible: SubjectState

Gui.ContextHelper.SubjectState.Focused🔗

Gui.ContextHelper.SubjectState.Focused: SubjectState

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🔗

function Gui.ContextHelper.getIdsOfActiveTool(): {string}
Returns
  1. {string}

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🔗

function Gui.Construction.setAngle(angle : number)

Sets the default construction angle for constructions.

Parameters
  • angle :number — the default construction angle

Gui.Construction.modify🔗

function Gui.Construction.modify(construction : Engine.Entity)

Modifies a construction

Parameters
  • construction :Engine.Entity — the construction entity

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🔗

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🔗

function Gui.Construction.getRefundableEntities(): {{Engine.Entity, integer}, {Engine.Revision, integer}}
Returns
  1. {{Engine.Entity, integer}, {Engine.Revision, integer}}

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🔗

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🔗

function Gui.Mission.getMission(): string

Get the current mission

Returns
  1. string — the mission name

Gui.Mission.getCampaign🔗

function Gui.Mission.getCampaign(): string

Get the current campaign

Returns
  1. string — the campaign name

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🔗

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🔗

function Gui.Mission.removeZone(key : string)

Removes a zone

Parameters
  • key :string — the key of the zone

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🔗

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🔗

function Gui.Mission.removeMarker(key : string)

Removes a marker

Parameters
  • key :string — the key of the marker

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🔗

function Gui.Mission.removeMovePathVisualization(key : string)

Removes the move path of an entity dynamically

Parameters
  • key :string — unique key

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🔗

function Gui.Mission.isCutscenePlaying(): boolean

Checks if a cutscene is currently playing.

Returns
  1. boolean

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

function Gui.Game.getDefaultSavegameId(): string

Returns the default savegame id

Returns
  1. string — the default savegame id

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🔗

function Gui.Game.getEnvironment(): ResName

Returns the resource name of the current environment

Returns
  1. ResName — the environment resource name

Gui.Guide🔗

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🔗

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🔗

Gui.Guide.GuidePosition.Left: GuidePosition

Gui.Guide.GuidePosition.Right🔗

Gui.Guide.GuidePosition.Right: GuidePosition

Gui.Guide.GuidePosition.Above🔗

Gui.Guide.GuidePosition.Above: GuidePosition

Gui.Guide.GuidePosition.Below🔗

Gui.Guide.GuidePosition.Below: GuidePosition

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🔗

Gui.Guide.FreeGuidePosition.High: FreeGuidePosition

Gui.Guide.FreeGuidePosition.Low🔗

Gui.Guide.FreeGuidePosition.Low: FreeGuidePosition

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🔗

function Gui.Guide.GuideTarget.new(string, GuidePosition): GuideTarget
Parameters
  • string
  • GuidePosition
Returns
  1. GuideTarget

Gui.Guide.GuideTarget.idOrTag🔗

Gui.Guide.GuideTarget.idOrTag: string

Gui.Guide.GuideTarget.position🔗

Gui.Guide.GuideTarget.position: GuidePosition

Gui.Guide.trySpawnGuideById🔗

function Gui.Guide.trySpawnGuideById({GuideTarget}, string, string): boolean
Parameters
  • {GuideTarget}
  • string
  • string
Returns
  1. boolean

Gui.Guide.trySpawnGuideFree🔗

function Gui.Guide.trySpawnGuideFree(FreeGuidePosition, string, string): boolean
Parameters
  • FreeGuidePosition
  • string
  • string
Returns
  1. boolean

Gui.Guide.completeGuideById🔗

function Gui.Guide.completeGuideById({GuideTarget}): boolean
Parameters
  • {GuideTarget}
Returns
  1. boolean

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🔗

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🔗

function Gui.Rendering.getEnvironment(): Environment

Returns the current environment data

Returns
  1. Environment — the current environment data

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🔗

function Gui.Rendering.getFrameTime01(): number
Returns
  1. number

Gui.Map🔗

record Gui.Map setMapSeedText: function(seed : string) reloadMaterialIndexManagerPipeline: function() openTerrainEditor: function() closeTerrainEditor: function() end

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🔗

function Gui.Map.reloadMaterialIndexManagerPipeline()

Reloads the material index manager pipeline.

Gui.Map.openTerrainEditor🔗

function Gui.Map.openTerrainEditor()

Gui.Map.closeTerrainEditor🔗

function Gui.Map.closeTerrainEditor()

Gui.BenchMark🔗

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🔗

record Gui.BenchMark.SimTime frameTime: integer gameTime: integer end

Simulation time frame along with game time at moment of capture

Gui.BenchMark.SimTime.frameTime🔗

Gui.BenchMark.SimTime.frameTime: integer

Gui.BenchMark.SimTime.gameTime🔗

Gui.BenchMark.SimTime.gameTime: integer

Gui.BenchMark.getBeginFrameTimes🔗

function Gui.BenchMark.getBeginFrameTimes(): {integer}

Returns the rendering preparation time

Returns
  1. {integer}

Gui.BenchMark.getEventTimes🔗

function Gui.BenchMark.getEventTimes(): {integer}

Returns the events processing time

Returns
  1. {integer}

Gui.BenchMark.getCoreStepTimes🔗

function Gui.BenchMark.getCoreStepTimes(): {integer}

Returns the gui update time

Returns
  1. {integer}

Gui.BenchMark.getRenderTimes🔗

function Gui.BenchMark.getRenderTimes(): {integer}

Returns the rendering time

Returns
  1. {integer}

Gui.BenchMark.getSwapTimes🔗

function Gui.BenchMark.getSwapTimes(): {integer}

Returns the rendering finish time

Returns
  1. {integer}

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🔗

function Gui.BenchMark.getCommandTimes(): {SimTime}

Returns commands processing time. Only available in GUI thread.

Returns
  1. {SimTime}

Gui.BenchMark.getGameStepTimes🔗

function Gui.BenchMark.getGameStepTimes(): {SimTime}

Returns the simulation update time. Only available in GUI thread.

Returns
  1. {SimTime}

Gui.Debug🔗

record Gui.Debug selectEntity: function(entity : Engine.Entity) end

Gui.Debug.selectEntity🔗

function Gui.Debug.selectEntity(entity : Engine.Entity)

Set the current debug entity

Parameters
  • entity :Engine.Entity — the entity

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🔗

function Gui.Achievements.areStatsDisabled(): boolean

Checkes whether player stats are disabled

Returns
  1. boolean — true if player stats are disabled

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

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🔗

record Gui.GenericRep getAllOfType: function(typeName : string, includeInvisible : boolean): {integer} end

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 { "guiresoverwrite", "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🔗

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🔗

record Gui.Backend.LegalDocument title: string text: string end

Gui.Backend.LegalDocument.title🔗

Gui.Backend.LegalDocument.title: string

Gui.Backend.LegalDocument.text🔗

Gui.Backend.LegalDocument.text: string

Gui.Backend.isInitialized🔗

function Gui.Backend.isInitialized(): boolean
Returns
  1. boolean

Gui.Backend.hasLegalDocuments🔗

function Gui.Backend.hasLegalDocuments()

Gui.Backend.getLegalDocuments🔗

function Gui.Backend.getLegalDocuments(): {PdxLegalDocumentType}
Returns
  1. {PdxLegalDocumentType}

Gui.Backend.isAccountLoggedIn🔗

function Gui.Backend.isAccountLoggedIn(): boolean
Returns
  1. boolean

Gui.Backend.loginAccount🔗

function Gui.Backend.loginAccount(string, string): PdxFuture<PdxLoginResult>
Parameters
  • string
  • string
Returns
  1. PdxFuture<PdxLoginResult>

Gui.Backend.logoutAccount🔗

function Gui.Backend.logoutAccount(): PdxFuture<PdxResult>
Returns
  1. PdxFuture<PdxResult>

Gui.Backend.getAccountInfo🔗

function Gui.Backend.getAccountInfo(): PdxFuture<PdxAccountInfo>
Returns
  1. PdxFuture<PdxAccountInfo>

Gui.Backend.getProfile🔗

function Gui.Backend.getProfile(boolean): PdxFuture<PdxProfileResult>
Parameters
  • boolean
Returns
  1. PdxFuture<PdxProfileResult>

Gui.Backend.createProfile🔗

function Gui.Backend.createProfile(string, boolean): PdxFuture<PdxResult>
Parameters
  • string
  • boolean
Returns
  1. PdxFuture<PdxResult>

Gui.Backend.renameProfile🔗

function Gui.Backend.renameProfile(string, boolean): PdxFuture<PdxResult>
Parameters
  • string
  • boolean
Returns
  1. PdxFuture<PdxResult>

Gui.Backend.getCountries🔗

function Gui.Backend.getCountries(): {PdxCountry}
Returns
  1. {PdxCountry}

Gui.Backend.getLegalDocument🔗

function Gui.Backend.getLegalDocument(PdxLegalDocumentType): PdxFuture<PdxLegalDocument>
Parameters
  • PdxLegalDocumentType
Returns
  1. PdxFuture<PdxLegalDocument>

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🔗

function Gui.Backend.supportsAccountLinking(): boolean
Returns
  1. boolean

Gui.Backend.getThirdPartyLinkState🔗

function Gui.Backend.getThirdPartyLinkState(): PdxFuture<PdxThirdPartyLinkState>
Returns
  1. PdxFuture<PdxThirdPartyLinkState>

Gui.Backend.getThirdPartyAutoLoginPromptState🔗

function Gui.Backend.getThirdPartyAutoLoginPromptState(): PdxThirdPartyAutoLoginPromptState
Returns
  1. PdxThirdPartyAutoLoginPromptState

Gui.Backend.setThirdPartyAutoLoginPromptState🔗

function Gui.Backend.setThirdPartyAutoLoginPromptState(PdxThirdPartyAutoLoginPromptState)
Parameters
  • PdxThirdPartyAutoLoginPromptState

Gui.Backend.linkThirdPartyAccount🔗

function Gui.Backend.linkThirdPartyAccount(): PdxFuture<PdxResult>
Returns
  1. PdxFuture<PdxResult>

Gui.Backend.unlinkThirdPartyAccount🔗

function Gui.Backend.unlinkThirdPartyAccount(): PdxFuture<PdxResult>
Returns
  1. PdxFuture<PdxResult>

Gui.Backend.loginThirdPartyAccount🔗

function Gui.Backend.loginThirdPartyAccount(): PdxFuture<PdxLoginResult>
Returns
  1. PdxFuture<PdxLoginResult>

Gui.mouse🔗

Gui.mouse: Mouse

Gui.key🔗

Gui.key: Key

Gui.dnd🔗

Gui.dnd: DnD

Gui.inputAction🔗

Gui.inputAction: InputAction

Gui.byId🔗

Gui.byId: ById

Gui.camera🔗

Gui.camera: Camera

Gui.sound🔗

Gui.sound: Sound

Gui.musicPlayer🔗

Gui.musicPlayer: MusicPlayer

Gui.backend🔗

Gui.backend: Backend

Gui.voiceOverManager🔗

Gui.voiceOverManager: VoiceOverManager

Gui.byEntity🔗

Gui.byEntity: ByEntity

Gui.contextHelper🔗

Gui.contextHelper: ContextHelper

Gui.construction🔗

Gui.construction: Construction

Gui.mission🔗

Gui.mission: Mission

Gui.guide🔗

Gui.guide: Guide

Gui.game🔗

Gui.game: Game

Gui.map🔗

Gui.map: Map

Gui.benchMark🔗

Gui.benchMark: BenchMark

Gui.rendering🔗

Gui.rendering: Rendering

Gui.debug🔗

Gui.debug: Debug

Gui.achievements🔗

Gui.achievements: Achievements

Gui.genericRep🔗

Gui.genericRep: GenericRep

Gui.StyleSheet🔗

Gui.StyleSheet: StyleSheet

Gui.NinePatch🔗

Gui.NinePatch: NinePatch

Category: globals🔗

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🔗

function NinePatch.new(): NinePatch
Returns
  1. NinePatch

NinePatch.fileName🔗

NinePatch.fileName: string

NinePatch.horizontal🔗

NinePatch.horizontal: {integer}

NinePatch.vertical🔗

NinePatch.vertical: {integer}

NinePatch.flipHorizontally🔗

NinePatch.flipHorizontally: boolean

NinePatch.repeatHorizontally🔗

NinePatch.repeatHorizontally: boolean

NinePatch.repeatVertically🔗

NinePatch.repeatVertically: boolean

NinePatch.repeatFactor🔗

NinePatch.repeatFactor: number

Repeat factor (must be positive).

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🔗

function StyleSheet.new(): StyleSheet
Returns
  1. StyleSheet

StyleSheet.backgroundColor🔗

StyleSheet.backgroundColor: Vec4f

StyleSheet.backgroundColor1🔗

StyleSheet.backgroundColor1: Vec4f

StyleSheet.backgroundColor2🔗

StyleSheet.backgroundColor2: Vec4f

StyleSheet.backgroundImage1🔗

StyleSheet.backgroundImage1: NinePatch

StyleSheet.backgroundImage2🔗

StyleSheet.backgroundImage2: NinePatch

StyleSheet.borderWidth🔗

StyleSheet.borderWidth: Vec4f

StyleSheet.borderColor🔗

StyleSheet.borderColor: Vec4f

StyleSheet.color🔗

StyleSheet.color: Vec4f

StyleSheet.size🔗

StyleSheet.size: Vec2f

StyleSheet.padding🔗

StyleSheet.padding: Vec4f

StyleSheet.fontSize🔗

StyleSheet.fontSize: integer

StyleSheet.borderImage🔗

StyleSheet.borderImage: NinePatch

StyleSheet.anchorPoint🔗

StyleSheet.anchorPoint: Vec2f
Transport Fever 3 Wiki
Gameplay ReferenceComing soon
●
Modding Manual
  • api
  • api.cmd
  • api.engine
  • api.engine.system
  • api.engine.util
  • api.gui
  • api.res
  • api.type
  • api.type.mod
  • api.type.modhub
  • api.type.transformator
  • app
  • main
  • content
    • base
      • difficulty_util
      • model_metadata_util
      • post_run_util
    • climates
      • gen
        • map_gen_util_serialized
    • game_mechanics
      • achievements
        • sound
          • achievement_sfx
      • celebrations
        • celebration_react_util
        • gui
          • sound
            • celebration_sfx
      • company
        • company
        • company_metadata
        • company_progression_util
        • company_react_util
        • company_static_util
        • company_util
        • explorations
          • exploration_plane
        • prospection_metadata
        • sound
          • company_sfx
      • emission
        • emission_config_metadata
        • emission_metadata
        • emissions
      • finance
        • account
        • finances_react_util
        • finances_util
        • loan
        • loan_util
        • sound
          • finance_sfx
      • fun_elements
        • blimp_util
        • custom_entity_util
        • fun_elements
        • rocket_util
        • ufo_util
      • game_time
        • game_time
      • industries
        • industries
      • notifications
        • gui
          • notification_colors
          • sound
            • notification_sfx
        • notification_legacy_util
        • notification_util
        • notifications
        • types
          • notification_react_util
          • notification_types
      • subventions
        • specific_subvention
        • subvention
        • subvention_legacy_util
        • subvention_util
        • subventions_gui
      • towns
        • district_colors
        • sound
          • town_sfx
        • town_cargo
        • town_growth_metadata
        • town_marketing_metadata
        • town_react_util
        • town_util
        • town_util_parallel
        • towns
    • gui
      • construction
        • construction_colors
        • construction_desc_react_util
        • construction_menu
        • construction_react_util
        • sound
          • construction_sfx
        • track_description_metadata
        • track_modifier_metadata
      • context_helper
        • context_helper
      • entity_window
        • animal
          • animal_eow
        • empty_construction
          • empty_construction_eow
        • entity_window_hud
        • entity_window_util
        • eow_extension_util
        • fun_elements
          • fun_elements_eow
        • gameplay_colors
        • industry
          • industry_eow
        • industry_react_util
        • line
          • line_eow
        • maintenance_station
          • maintenance_station_eow
        • perk
          • perk_eow
        • sim_person
          • sim_person_eow
        • station_group
          • station_group_eow
        • town
          • town_eow
        • town_building
          • town_building_eow
        • vehicle
          • vehicle_eow
        • view_manager
        • view_manager_util
        • warehouse
          • warehouse_eow
      • game_bar
        • game_bar
        • game_bar_widgets
      • guidesystem
        • sound
          • guidesystem_sfx
      • hud
        • hud_gui_config
        • hud_react_util
      • layers
        • layer_cargo
        • layer_cargo_flow
        • layer_colors
        • layer_noise
        • layer_pollution
        • layer_public_transport
        • layer_react_util
        • layer_traffic
        • layers_button_ridge
      • line_vehicle_mgmt
        • cargofilter_window
        • feedback_list_util
        • line
        • line_react_util
        • line_util
        • manager_hud_util
        • manager_tooltips_util
        • manager_window
        • sound
          • lvm_sfx
        • vehicle_list_react_util
        • vehicle_react_util
        • vehicle_store
        • vehicle_store_table
        • vehicle_store_util
        • vehicle_store_window
        • vehicle_util
      • main
        • button_react_util
        • callout_react_util
        • cargo_react_util
        • cargo_util
        • collapsible_checkbox_list
        • content_card
        • credits_react_util
        • default_colors
        • disable_features
        • engine_react_util
        • free_cam_options
        • game_context
        • game_react_globals
        • game_tooltips
        • game_windows
        • gui_react_util
        • gui_res_modding
        • hud_icon_toolbox
        • industry_util
        • input_action_colors
        • main_mod_button_area
        • menu_category_util
        • mod_entry_point
        • particle_colors
        • particle_react_util
        • popover_react_util
        • radial_menu_extension
        • script_param_util
        • selection_colors
        • selector
        • selector_react_util
        • styleutil
        • tile_list_react_util
        • tool_react_util
        • town_hud_react_util
      • map_editor
        • map_editor
      • menu
        • dialog_react_util
        • difficulty_react_util
        • graphics_presets_util
        • main_menu
        • map_preview_colors
        • menu_icon_react_util
        • menu_util
        • mod_colors
        • mod_manager_react_util
        • mod_util
        • new_game_react_util
        • paradox_react_util
        • releasenotes_util
        • savegame_react_util
        • sound
          • main_menu_sfx
      • sound
        • gui_comp_sfx
      • statistics
        • statistics
        • statistics_react_util
    • industries
      • industry_productivity_util
      • industry_workers
    • infrastructure
      • traffic_light
        • traffic_light
    • landmarks
      • hq
        • headquarter_util_serialized
      • landmark
      • landmark_util
      • landmark_util_serialized
    • mission
      • arrival_tracker
      • builder_util
      • calendar
      • guide_system
        • guide_system_react
        • guides
          • guide_event
          • guide_generic
          • guide_state
          • guide_timer
          • guide_ui_event
      • mission_boot_util
      • mission_colors
      • mission_framework
        • mission_end_window_util
        • mission_framework_react
        • mission_framework_react_util
        • mission_framework_util
        • mission_framework_util_entity
        • mission_framework_util_line
        • mission_interface
      • mission_pathfinding_util
      • mission_react_util
      • mission_task_util
      • mission_types
      • modifier
      • name_util
      • tasks
        • assign_vehicle
          • mission_task_assign_vehicle
          • mission_task_visit_stations_ordered
        • auto_builder
          • mission_task_electrify
          • mission_task_track_builder
          • prepare_track_building_util
        • build_construction
          • mission_task_build_construction
          • mission_task_build_construction_util
          • mission_task_build_construction_variant
        • build_path
          • mission_task_build_path
        • bulldoze
          • mission_task_auto_bulldoze
          • mission_task_bulldoze
        • buy_vehicle
          • mission_task_buy_vehicle
          • mission_task_clone_vehicle
        • click_and_collect_custom_entity
          • mission_task_collect_entity
          • mission_task_spawn_entity
        • click_entity
          • mission_task_click_entity
        • connect_nodes
          • mission_task_connect_nodes
        • create_line
          • mission_task_create_line
          • mission_task_create_line_for_towns
          • mission_task_stop_config
        • cutscene
          • mission_task_cutscene
        • dialogue
          • mission_task_dialogue
        • finish
          • mission_task_finish
        • guide
          • mission_task_guide
          • mission_task_guide_collect_entity
        • join
          • mission_task_join
        • mission_dialogue_data
        • non_bulldozable
          • mission_task_non_bulldozable
        • observe_entity
          • mission_task_observe_entity
        • page
          • mission_task_page
        • spawn_sims
          • mission_task_spawn_sims
          • sampling_util
        • subsidies
          • mission_task_guide_subsidies
          • mission_task_subsidies
        • task_decorator
        • town_rating
          • mission_task_town_rating
          • mission_task_town_rating_observer
        • town_size
          • mission_task_town_size
        • transfer_ownership
          • mission_task_transfer_ownership
          • transfer_ownership_util
        • transport_cargo
          • mission_task_empty_stocks
          • mission_task_industry_boosted
          • mission_task_transport_cargo
          • mission_task_transport_cargo_faster
          • mission_task_transport_cargo_observer
          • mission_task_transport_passengers
        • utility
          • mission_task_cargo_needs
          • mission_task_check_entities
          • mission_task_check_landmark_level
          • mission_task_clouds
          • mission_task_highlight
          • mission_task_industry_activity
          • mission_task_landmark_requirements
          • mission_task_play_sound
          • mission_task_protected_entities
          • mission_task_relay_update
          • mission_task_send_command
          • mission_task_send_event
          • mission_task_store_any
          • mission_task_substitute_constructions
          • mission_task_time_of_day
          • mission_task_town_development
          • mission_town_util
        • vehicle_util
          • mission_task_replace_vehicles
          • mission_task_sell_vehicles
          • mission_task_start_vehicles
          • mission_task_vehicle_modifier
          • mission_task_vehicle_position
          • mission_vehicle_util
        • wait
          • mission_task_wait
          • mission_task_wait_event
          • mission_task_wait_for
          • mission_task_wait_ui_event
        • waypoints
          • mission_task_waypoints
      • tutorial
        • tasks
          • mission_task_tutorial_init
        • tutorial_story_util
    • scripts
      • app_util
      • audio_util
      • builtin
      • construction
        • asset_util
        • collider_util_serialized
        • construction_config_metadata
        • construction_specialization_metadata
        • construction_util_serialized
        • lane_util_serialized
        • modules_util_serialized
        • param_util
        • street_util_serialized
      • entity_util
      • gamescript
      • journal
      • lang_util
      • log
      • mat4
      • math_util
      • metadata_util
      • polygon_util
      • random_util
      • react
      • soundset
      • string_util
      • table_util
      • tex_util
      • transformator_util
      • util
        • config_util
        • listutil
        • romberg_util
        • town_growth_function
      • vec2
      • vec3
      • vec4
    • stations
      • station_metadata
    • vehicle
      • vehicle_modifier

Generated 19-08-2026

Transport Fever 3 ● Urban Games © 2026