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
InputGlyphElementUI
ParentGuiElementFunctions
copyAttributes
DescriptionDefinitioncopyAttributes()Code
57 | function InputGlyphElementUI:copyAttributes(src) |
58 | InputGlyphElementUI:superClass().copyAttributes(self, src) |
59 | |
60 | self.color = table.copy(src.color) |
61 | |
62 | if src.glyphElement ~= nil then |
63 | local actionNames = src.glyphElement.actionNames |
64 | local actionText = src.glyphElement.actionText |
65 | local actionTextSize = src.glyphElement.actionTextSize |
66 | |
67 | self:rebuildGlyph() |
68 | self:setActions(actionNames, actionText, actionTextSize) |
69 | end |
70 | end |
delete
DescriptionDefinitiondelete()Code
26 | function InputGlyphElementUI:delete() |
27 | if self.glyphElement ~= nil then |
28 | self.glyphElement:delete() |
29 | self.glyphElement = nil |
30 | end |
31 | |
32 | InputGlyphElementUI:superClass().delete(self) |
33 | end |
draw
DescriptionDraw the glyphDefinition
draw()Code
95 | function InputGlyphElementUI:draw(clipX1, clipY1, clipX2, clipY2) |
96 | InputGlyphElementUI:superClass().draw(self, clipX1, clipY1, clipX2, clipY2) |
97 | |
98 | if self.glyphElement ~= nil then |
99 | self.glyphElement:draw(clipX1, clipY1, clipX2, clipY2) |
100 | end |
101 | end |
loadFromXML
DescriptionDefinitionloadFromXML()Code
37 | function InputGlyphElementUI:loadFromXML(xmlFile, key) |
38 | InputGlyphElementUI:superClass().loadFromXML(self, xmlFile, key) |
39 | |
40 | self.color = GuiUtils.getColorArray(getXMLString(xmlFile, key.."#glyphColor"), self.color) |
41 | |
42 | self:rebuildGlyph() |
43 | end |
loadProfile
DescriptionDefinitionloadProfile()Code
47 | function InputGlyphElementUI:loadProfile(profile, applyProfile) |
48 | InputGlyphElementUI:superClass().loadProfile(self, profile, applyProfile) |
49 | |
50 | self.color = GuiUtils.getColorArray(profile:getValue("glyphColor"), self.color) |
51 | |
52 | self:rebuildGlyph() |
53 | end |
new
DescriptionDefinitionnew()Code
16 | function InputGlyphElementUI.new(target, custom_mt) |
17 | local self = GuiElement.new(target, custom_mt or InputGlyphElementUI_mt) |
18 | |
19 | self.color = {1, 1, 1, 1} |
20 | |
21 | return self |
22 | end |
setActions
DescriptionSet glyph actionsDefinition
setActions()Code
105 | function InputGlyphElementUI:setActions(actions, ...) |
106 | if self.glyphElement ~= nil then |
107 | self.glyphElement:setActions(actions, ...) |
108 | |
109 | -- The size could have changed |
110 | if not self.didSetAbsolutePosition then |
111 | self:updateAbsolutePosition() |
112 | end |
113 | |
114 | -- A bit of a nasty thing: base size is based on original width and height of the element, |
115 | -- but we change the width based on the content. We still need the original width in case position changes. |
116 | if self.absSize[1] > 0 then |
117 | self.originalWidth = self.originalWidth or self.absSize[1] |
118 | end |
119 | |
120 | self.absSize[1] = self.glyphElement:getGlyphWidth() |
121 | self.size[1] = self.absSize[1] / g_aspectScaleX |
122 | |
123 | if self.parent ~= nil and self.parent.invalidateLayout ~= nil then |
124 | self.parent:invalidateLayout() |
125 | end |
126 | end |
127 | end |