Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- AnimalScreen
- AnimationElement
- BitmapElement
- BoxLayoutElement
- BreadcrumbsElement
- ButtonElement
- ButtonOverlay
- ChatWindow
- CheckedOptionElement
- ClearElement
- ColorPickButtonElement
- ConstructionScreen
- ContextActionDisplay
- ControlBarDisplay
- DialogElement
- DynamicFadedBitmapElement
- FillLevelsDisplay
- FlowLayoutElement
- FocusManager
- FrameElement
- FrameReferenceElement
- GameInfoDisplay
- GameInfoDisplayMobile
- GamePausedDisplay
- Gui
- GuiDataSource
- GuiElement
- GuiMixin
- GuiOverlay
- GuiProfile
- GuiSoundPlayer
- GuiTopDownCamera
- GuiTopDownCursor
- GuiUtils
- HUDDisplayElement
- HUDElement
- HUDFrameElement
- HUDPopupMessage
- HUDSliderElement
- HUDTextDisplay
- IndexChangeSubjectMixin
- IndexStateElement
- InfoDisplay
- InfoHUDBox
- InGameIcon
- IngameMap
- IngameMapElement
- InputGlyphElement
- InputGlyphElementUI
- InputHelpDisplay
- KeyValueInfoHUDBox
- ListElement
- ListItemElement
- MapOverlayGenerator
- MixerWagonHUDExtension
- MultiTextOptionElement
- MultiValueTween
- Overlay
- PagingElement
- PictureElement
- PlatformIconElement
- PlayerControlPadDisplay
- PlaySampleMixin
- RenderElement
- RoundStatusBar
- ScreenElement
- ScrollingLayoutElement
- SettingsModel
- SideNotification
- SideNotificationMobile
- SliderElement
- SpeakerDisplay
- SpeedMeterDisplay
- SpeedSliderDisplay
- StatusBar
- SteeringSliderDisplay
- TabbedMenu
- TabbedMenuFrameElement
- TabbedMenuWithDetails
- TableElement
- TableHeaderElement
- TerrainLayerElement
- TextBackdropElement
- TextElement
- TextInputElement
- ThreePartBitmapElement
- TimerElement
- ToggleButtonElement
- TopNotification
- Tween
- TweenSequence
- VariableWorkWidthHUDExten...
- VehicleHUDExtension
- VehicleSchemaDisplay
- VideoElement
- WardrobeScreen
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
GameInfoDisplayMobile
DescriptionVehicle Steering Slider for Mobile VersionParent
HUDDisplayElementFunctions
- createBackground
- createBorders
- createButtonElement
- createHUDElement
- createInfoElement
- createSeparators
- draw
- getBackgroundPosition
- getFuelValue
- getMoneyValue
- getTimeValue
- new
- onOpenMap
- onOpenMenu
- onOpenShop
- setEnvironment
- setMissionInfo
- setMissionStats
- setMoneyUnit
- setMoneyVisible
- setScale
- setTemperatureVisible
- setTimeVisible
- setTutorialProgress
- setTutorialVisible
- setVehicle
- setWeatherVisible
- updateInfoElement
createBackground
DescriptionCreate an empty background overlay as a base frame for this element.Definition
createBackground()Code
407 | function GameInfoDisplayMobile.createBackground() |
408 | local width, height = getNormalizedScreenValues(unpack(GameInfoDisplayMobile.SIZE.BACKGROUND)) |
409 | local posX, posY = GameInfoDisplayMobile.getBackgroundPosition(1, width) |
410 | |
411 | return Overlay.new(nil, posX, posY, width, height) -- empty overlay, only used as a positioning frame |
412 | end |
createBorders
DescriptionDefinitioncreateBorders()Code
81 | function GameInfoDisplayMobile:createBorders() |
82 | -- bottom |
83 | local border = self:createHUDElement({0, 0}, {GameInfoDisplayMobile.SIZE.BACKGROUND[1], 2}, HUDElement.UV.FILL, GameInfoDisplayMobile.COLOR.BORDER) |
84 | table.insert(self.elements, border) |
85 | |
86 | -- left |
87 | border = self:createHUDElement({0, 2}, {2, GameInfoDisplayMobile.SIZE.BACKGROUND[2]}, HUDElement.UV.FILL, GameInfoDisplayMobile.COLOR.BORDER) |
88 | table.insert(self.elements, border) |
89 | |
90 | -- right |
91 | border = self:createHUDElement({GameInfoDisplayMobile.SIZE.BACKGROUND[1] - 2, 2}, {2, GameInfoDisplayMobile.SIZE.BACKGROUND[2]}, HUDElement.UV.FILL, GameInfoDisplayMobile.COLOR.BORDER) |
92 | table.insert(self.elements, border) |
93 | |
94 | border = self:createHUDElement({GameInfoDisplayMobile.POSITION.CENTER_BACKGROUND[1]+GameInfoDisplayMobile.SIZE.CENTER_BACKGROUND[1]+GameInfoDisplayMobile.POSITION.CENTER_BACKGROUND[1]/2, 2}, {2, GameInfoDisplayMobile.SIZE.BACKGROUND[2]}, HUDElement.UV.FILL, GameInfoDisplayMobile.COLOR.BORDER) |
95 | table.insert(self.elements, border) |
96 | |
97 | border = self:createHUDElement({GameInfoDisplayMobile.POSITION.CENTER_BACKGROUND[1]-2, 2}, {2, GameInfoDisplayMobile.SIZE.BACKGROUND[2]}, HUDElement.UV.FILL, GameInfoDisplayMobile.COLOR.BORDER) |
98 | table.insert(self.elements, border) |
99 | |
100 | border = self:createHUDElement({GameInfoDisplayMobile.POSITION.CENTER_BACKGROUND[1]+GameInfoDisplayMobile.SIZE.CENTER_BACKGROUND[1], 2}, {2, GameInfoDisplayMobile.SIZE.BACKGROUND[2]}, HUDElement.UV.FILL, GameInfoDisplayMobile.COLOR.BORDER) |
101 | table.insert(self.elements, border) |
102 | end |
createButtonElement
DescriptionDefinitioncreateButtonElement()Code
121 | function GameInfoDisplayMobile:createButtonElement(callback, position, size, iconSize, uvs, color, backgroundColor, iconColorPressed, inputAction) |
122 | local button = {} |
123 | button.callback = callback |
124 | button.display = callback |
125 | |
126 | button.backgroundElement = self:createHUDElement(position, size, HUDElement.UV.FILL, backgroundColor) |
127 | button.iconColorPressed = iconColorPressed |
128 | |
129 | local posX, posY = position[1] + size[1] * 0.5 - iconSize[1] * 0.5, position[2] + size[2] * 0.5 - iconSize[2] * 0.5 |
130 | button.iconElement = self:createHUDElement({posX, posY}, iconSize, uvs, color) |
131 | button.iconColor = color |
132 | |
133 | table.insert(self.elements, button.backgroundElement) |
134 | table.insert(self.elements, button.iconElement) |
135 | |
136 | local pressButton = function(button) |
137 | button.iconElement:setColor(unpack(button.iconColorPressed)) |
138 | end |
139 | |
140 | local releaseButton = function(button) |
141 | button.iconElement:setColor(unpack(button.iconColor)) |
142 | end |
143 | |
144 | local buttonCb = function(target, x, y, isCancel) |
145 | if not isCancel then |
146 | callback(target, x, y) |
147 | end |
148 | end |
149 | |
150 | self.hud:addTouchButton(button.backgroundElement.overlay, 0, 0, buttonCb, self, TouchHandler.TRIGGER_UP, {button}) |
151 | self.hud:addTouchButton(button.backgroundElement.overlay, 0, 0, pressButton, button, TouchHandler.TRIGGER_DOWN) |
152 | self.hud:addTouchButton(button.backgroundElement.overlay, 0, 0, releaseButton, button, TouchHandler.TRIGGER_UP) |
153 | |
154 | if inputAction ~= nil then |
155 | local glyphWidth, glyphHeight = getNormalizedScreenValues(unpack(GameInfoDisplayMobile.SIZE.INPUT_GLYPH)) |
156 | |
157 | local baseX, baseY = self:getPosition() |
158 | local sPosX, sPosY = getNormalizedScreenValues(unpack(position)) |
159 | local sSizeX, sSizeY = getNormalizedScreenValues(unpack(size)) |
160 | |
161 | local glyphElement = InputGlyphElement.new(g_inputDisplayManager, glyphWidth, glyphHeight) |
162 | |
163 | glyphElement:setAction(inputAction) |
164 | glyphElement:setButtonGlyphColor(GameInfoDisplayMobile.COLOR.INPUT_GLYPH) |
165 | |
166 | local actualWidth = glyphElement:getGlyphWidth() |
167 | glyphElement:setPosition(baseX + sPosX + sSizeX - actualWidth, baseY + sPosY + sSizeY - glyphHeight) |
168 | |
169 | table.insert(self.elements, glyphElement) |
170 | table.insert(self.inputGlyphs, glyphElement) |
171 | end |
172 | end |
createHUDElement
DescriptionDefinitioncreateHUDElement()Code
106 | function GameInfoDisplayMobile:createHUDElement(position, size, uvs, color) |
107 | local baseX, baseY = self:getPosition() |
108 | local posX, posY = getNormalizedScreenValues(unpack(position)) |
109 | local sizeX, sizeY = getNormalizedScreenValues(unpack(size)) |
110 | local overlay = Overlay.new(self.hudAtlasPath, baseX + posX, baseY + posY, sizeX, sizeY) |
111 | overlay:setUVs(GuiUtils.getUVs(uvs)) |
112 | if color ~= nil then |
113 | overlay:setColor(unpack(color)) |
114 | end |
115 | |
116 | return HUDElement.new(overlay) |
117 | end |
createInfoElement
DescriptionDefinitioncreateInfoElement()Code
176 | function GameInfoDisplayMobile:createInfoElement(valueFunc, position, size, iconSize, iconOffset, iconPadding, uvs, color, textOffset, textSize, textBold) |
177 | local infoElement = {} |
178 | infoElement.position = position |
179 | infoElement.size = size |
180 | |
181 | infoElement.icon = self:createHUDElement(position, iconSize, uvs, color) |
182 | infoElement.iconSize = iconSize |
183 | infoElement.iconOffset = iconOffset |
184 | infoElement.iconPadding = iconPadding |
185 | |
186 | local _, textSizeY = getNormalizedScreenValues(0, textSize[2]) |
187 | infoElement.textSize = textSizeY |
188 | |
189 | local textPosX, textPosY = getNormalizedScreenValues(position[1] + size[1] - textOffset[1], position[2] + size[2] / 2 - textSize[2] / 2 + textOffset[2]) |
190 | infoElement.textPos = {textPosX, textPosY} |
191 | infoElement.textOffset = textOffset |
192 | infoElement.textAlign = RenderText.ALIGN_RIGHT |
193 | infoElement.textBold = textBold |
194 | infoElement.valueFunc = valueFunc |
195 | |
196 | local baseX, baseY = self:getPosition() |
197 | local iconPosX, iconPosY = getNormalizedScreenValues(infoElement.position[1] + infoElement.iconOffset[1] - infoElement.iconPadding[1], infoElement.position[2] + infoElement.iconOffset[2] + infoElement.size[2] / 2 - infoElement.iconSize[2] / 2) |
198 | infoElement.icon:setPosition(baseX + iconPosX, baseY + iconPosY) |
199 | |
200 | table.insert(self.elements, infoElement.icon) |
201 | table.insert(self.infoElements, infoElement) |
202 | end |
createSeparators
DescriptionDefinitioncreateSeparators()Code
72 | function GameInfoDisplayMobile:createSeparators() |
73 | local posX = GameInfoDisplayMobile.POSITION.CENTER_BACKGROUND[1] + GameInfoDisplayMobile.POSITION.SEPARATOR_01[1] |
74 | local posY = GameInfoDisplayMobile.POSITION.CENTER_BACKGROUND[2] + GameInfoDisplayMobile.POSITION.SEPARATOR_01[2] |
75 | local separator = self:createHUDElement({posX, posY}, GameInfoDisplayMobile.SIZE.SEPARATOR, HUDElement.UV.FILL, GameInfoDisplayMobile.COLOR.SEPARATOR) |
76 | table.insert(self.elements, separator) |
77 | end |
draw
DescriptionDefinitiondraw()Code
351 | function GameInfoDisplayMobile:draw() |
352 | GameInfoDisplayMobile:superClass().draw(self) |
353 | |
354 | for _, infoElement in ipairs(self.infoElements) do |
355 | self:updateInfoElement(infoElement) |
356 | end |
357 | end |
getBackgroundPosition
DescriptionGet the position of the background element, which provides this element's absolute position.Definition
getBackgroundPosition(scale Current, float width)Arguments
scale | Current | UI scale |
float | width | Scaled background width in pixels |
float | X | position in screen space |
float | Y | position in screen space |
394 | function GameInfoDisplayMobile.getBackgroundPosition(scale, width) |
395 | local offX, offY = getNormalizedScreenValues(unpack(GameInfoDisplayMobile.POSITION.BACKGROUND)) |
396 | local sizeX, _ = getNormalizedScreenValues(unpack(GameInfoDisplayMobile.SIZE.BACKGROUND)) |
397 | |
398 | return 0.5 - sizeX / 2 - offX, 1 - g_safeFrameOffsetY - offY * scale |
399 | end |
getFuelValue
DescriptionDefinitiongetFuelValue()Code
233 | function GameInfoDisplayMobile:getFuelValue() |
234 | if self.vehicle ~= nil and self.vehicle.getConsumerFillUnitIndex ~= nil then |
235 | local fillUnitIndex = self.vehicle:getConsumerFillUnitIndex(FillType.DIESEL) |
236 | if fillUnitIndex ~= nil then |
237 | local fillLevelPct = self.vehicle:getFillUnitFillLevelPercentage(fillUnitIndex) |
238 | return string.format("%d%%", fillLevelPct * 100) |
239 | end |
240 | -- else |
241 | -- if self.isRideable then |
242 | -- return string.format("%d%%", math.min(self.vehicle:getHorseRidingScale(), 1) * 100) |
243 | -- end |
244 | end |
245 | |
246 | return "-" |
247 | end |
getMoneyValue
DescriptionDefinitiongetMoneyValue()Code
221 | function GameInfoDisplayMobile:getMoneyValue() |
222 | if g_currentMission.player ~= nil then |
223 | local farm = g_farmManager:getFarmById(g_currentMission.player.farmId) |
224 | |
225 | return g_i18n:formatMoney(farm.money, 0, false, true) |
226 | end |
227 | |
228 | return "0" |
229 | end |
getTimeValue
DescriptionDefinitiongetTimeValue()Code
251 | function GameInfoDisplayMobile:getTimeValue() |
252 | local currentTime = self.environment.dayTime / (1000 * 60 * 60) |
253 | local timeHours = math.floor(currentTime) |
254 | local timeMinutes = math.floor((currentTime - timeHours) * 60) |
255 | |
256 | return string.format("%02d:%02d", timeHours, timeMinutes) |
257 | end |
new
DescriptionCreates a new GameInfoDisplayMobile instance.Definition
new(string hudAtlasPath)Arguments
string | hudAtlasPath | Path to the HUD texture atlas. |
18 | function GameInfoDisplayMobile.new(hud, hudAtlasPath, moneyUnit, l10n) |
19 | local backgroundOverlay = GameInfoDisplayMobile.createBackground() |
20 | local self = GameInfoDisplayMobile:superClass().new(backgroundOverlay, nil, GameInfoDisplayMobile_mt) |
21 | |
22 | self.hud = hud |
23 | self.uiScale = 1.0 |
24 | self.hudAtlasPath = hudAtlasPath |
25 | self.moneyUnit = moneyUnit |
26 | self.l10n = l10n |
27 | |
28 | self.vehicle = nil |
29 | self.isRideable = false |
30 | |
31 | self.elements = {} |
32 | self.infoElements = {} |
33 | self.inputGlyphs = {} |
34 | |
35 | self.backgroundHudElement = self:createHUDElement(GameInfoDisplayMobile.POSITION.CENTER_BACKGROUND, GameInfoDisplayMobile.SIZE.CENTER_BACKGROUND, GameInfoDisplayMobile.UV.BACKGROUND) |
36 | table.insert(self.elements, self.backgroundHudElement) |
37 | |
38 | self:createSeparators() |
39 | self:createBorders() |
40 | |
41 | self:createButtonElement(self.onOpenShop, GameInfoDisplayMobile.POSITION.SHOP_ICON, GameInfoDisplayMobile.SIZE.SHOP_ICON, GameInfoDisplayMobile.SIZE.BUTTON_ICON, GameInfoDisplayMobile.UV.SHOP, GameInfoDisplayMobile.COLOR.BUTTON, GameInfoDisplayMobile.COLOR.BUTTON_BACKGROUND, GameInfoDisplayMobile.COLOR.BUTTON_SELECTED, InputAction.TOGGLE_STORE) |
42 | self:createButtonElement(self.onOpenMap, GameInfoDisplayMobile.POSITION.MAP_ICON, GameInfoDisplayMobile.SIZE.MAP_ICON, GameInfoDisplayMobile.SIZE.BUTTON_ICON, GameInfoDisplayMobile.UV.MAP, GameInfoDisplayMobile.COLOR.BUTTON, GameInfoDisplayMobile.COLOR.BUTTON_BACKGROUND, GameInfoDisplayMobile.COLOR.BUTTON_SELECTED, InputAction.TOGGLE_MAP) |
43 | self:createButtonElement(self.onOpenMenu, GameInfoDisplayMobile.POSITION.MENU_ICON, GameInfoDisplayMobile.SIZE.MENU_ICON, GameInfoDisplayMobile.SIZE.BUTTON_ICON, GameInfoDisplayMobile.UV.MENU, GameInfoDisplayMobile.COLOR.BUTTON, GameInfoDisplayMobile.COLOR.BUTTON_BACKGROUND, GameInfoDisplayMobile.COLOR.BUTTON_SELECTED, InputAction.MENU) |
44 | |
45 | self:createInfoElement(self.getMoneyValue, GameInfoDisplayMobile.POSITION.MONEY_AREA, GameInfoDisplayMobile.SIZE.MONEY_AREA, GameInfoDisplayMobile.SIZE.MONEY_ICON, GameInfoDisplayMobile.SIZE.ICON_OFFSET_MONEY, GameInfoDisplayMobile.SIZE.ICON_PADDING, GameInfoDisplayMobile.UV.SHOP, GameInfoDisplayMobile.COLOR.BUTTON, GameInfoDisplayMobile.SIZE.TEXT_OFFSET_MONEY, GameInfoDisplayMobile.SIZE.TEXT_SIZE, true) |
46 | self:createInfoElement(self.getFuelValue, GameInfoDisplayMobile.POSITION.FUEL_AREA, GameInfoDisplayMobile.SIZE.FUEL_AREA, GameInfoDisplayMobile.SIZE.FUEL_ICON, GameInfoDisplayMobile.SIZE.ICON_OFFSET_FUEL, GameInfoDisplayMobile.SIZE.ICON_PADDING, GameInfoDisplayMobile.UV.FUEL, GameInfoDisplayMobile.COLOR.BUTTON, GameInfoDisplayMobile.SIZE.TEXT_OFFSET_FUEL, GameInfoDisplayMobile.SIZE.TEXT_SIZE, true) |
47 | |
48 | for _, element in ipairs(self.elements) do |
49 | self:addChild(element) |
50 | end |
51 | |
52 | return self |
53 | end |
onOpenMap
DescriptionDefinitiononOpenMap()Code
267 | function GameInfoDisplayMobile:onOpenMap() |
268 | g_currentMission:onToggleMap() |
269 | end |
onOpenMenu
DescriptionDefinitiononOpenMenu()Code
273 | function GameInfoDisplayMobile:onOpenMenu() |
274 | g_currentMission:onToggleMenu() |
275 | end |
onOpenShop
DescriptionDefinitiononOpenShop()Code
261 | function GameInfoDisplayMobile:onOpenShop() |
262 | g_currentMission:onToggleStore() |
263 | end |
setEnvironment
DescriptionSet the environment reference to use for weather information display.Definition
setEnvironment(table environment)Arguments
table | environment | Environment reference, do not change |
306 | function GameInfoDisplayMobile:setEnvironment(environment) |
307 | self.environment = environment |
308 | end |
setMissionInfo
DescriptionSet the mission information reference for base information display.Definition
setMissionInfo(table missionInfo)Arguments
table | missionInfo | MissionInfo reference, do not change |
299 | function GameInfoDisplayMobile:setMissionInfo(missionInfo) |
300 | self.missionInfo = missionInfo |
301 | end |
setMissionStats
DescriptionSet the MissionStats reference for displaying information.Definition
setMissionStats(table missionStats)Arguments
table | missionStats | MissionStats reference, do not change |
292 | function GameInfoDisplayMobile:setMissionStats(missionStats) |
293 | self.missionStats = missionStats |
294 | end |
setMoneyUnit
DescriptionSet the money unit for displaying the account balance.Definition
setMoneyUnit(int moneyUnit)Arguments
int | moneyUnit | Money unit ID, any of [GS_MONEY_EURO | GS_MONEY_POUND | GS_MONEY_DOLLAR]. Invalid values are substituted by GS_MONEY_DOLLAR. |
280 | function GameInfoDisplayMobile:setMoneyUnit(moneyUnit) |
281 | if moneyUnit ~= GS_MONEY_EURO and moneyUnit ~= GS_MONEY_POUND and moneyUnit ~= GS_MONEY_DOLLAR then |
282 | moneyUnit = GS_MONEY_DOLLAR |
283 | end |
284 | |
285 | self.moneyUnit = moneyUnit |
286 | self.infoElements[1].icon:setUVs(GuiUtils.getUVs(GameInfoDisplayMobile.UV.MONEY_ICON[moneyUnit])) |
287 | end |
setMoneyVisible
DescriptionSet visibility of the money display.Definition
setMoneyVisible()Code
312 | function GameInfoDisplayMobile:setMoneyVisible(isVisible) |
313 | end |
setScale
DescriptionSet this element's scale.Definition
setScale()Code
374 | function GameInfoDisplayMobile:setScale(uiScale) |
375 | GameInfoDisplayMobile:superClass().setScale(self, uiScale, uiScale) |
376 | |
377 | local currentVisibility = self:getVisible() |
378 | self:setVisible(true, false) |
379 | |
380 | self.uiScale = uiScale |
381 | local posX, posY = GameInfoDisplayMobile.getBackgroundPosition(uiScale, self:getWidth()) |
382 | self:setPosition(posX, posY) |
383 | |
384 | self:storeOriginalPosition() |
385 | self:setVisible(currentVisibility, false) |
386 | end |
setTemperatureVisible
DescriptionSet visibility of temperature display.Definition
setTemperatureVisible()Code
322 | function GameInfoDisplayMobile:setTemperatureVisible(isVisible) |
323 | end |
setTimeVisible
DescriptionSet visibility of time display.Definition
setTimeVisible()Code
317 | function GameInfoDisplayMobile:setTimeVisible(isVisible) |
318 | end |
setTutorialProgress
DescriptionSet the current tutorial progress values.Definition
setTutorialProgress(float progress)Arguments
float | progress | Progress expressed as a number between 0 and 1 |
341 | function GameInfoDisplayMobile:setTutorialProgress(progress) |
342 | end |
setTutorialVisible
DescriptionSet visibility of tutorial progress display.Definition
setTutorialVisible()Code
335 | function GameInfoDisplayMobile:setTutorialVisible(isVisible) |
336 | end |
setVehicle
DescriptionDefinitionsetVehicle()Code
57 | function GameInfoDisplayMobile:setVehicle(vehicle) |
58 | self.vehicle = vehicle |
59 | |
60 | if vehicle ~= nil then |
61 | self.isRideable = SpecializationUtil.hasSpecialization(Rideable, vehicle.specializations) |
62 | |
63 | self.infoElements[2].icon:setUVs(GuiUtils.getUVs(self.isRideable and GameInfoDisplayMobile.UV.RIDING or GameInfoDisplayMobile.UV.FUEL)) |
64 | else |
65 | self.isRideable = false |
66 | self.infoElements[2].icon:setUVs(GuiUtils.getUVs(GameInfoDisplayMobile.UV.FUEL)) |
67 | end |
68 | end |
setWeatherVisible
DescriptionSet visibility of weather display.Definition
setWeatherVisible()Code
327 | function GameInfoDisplayMobile:setWeatherVisible(isVisible) |
328 | end |
updateInfoElement
DescriptionDefinitionupdateInfoElement()Code
206 | function GameInfoDisplayMobile:updateInfoElement(infoElement) |
207 | if infoElement.icon:getVisible() then |
208 | local baseX, baseY = self:getPosition() |
209 | |
210 | setTextColor(1, 1, 1, 1) |
211 | setTextBold(infoElement.textBold) |
212 | setTextAlignment(infoElement.textAlign) |
213 | renderText(baseX + infoElement.textPos[1], baseY + infoElement.textPos[2], infoElement.textSize, infoElement.valueFunc(self)) |
214 | setTextAlignment(RenderText.ALIGN_LEFT) |
215 | setTextBold(false) |
216 | end |
217 | end |