LUADOC - Farming Simulator 22

Script v1_7_1_0

Engine v1_7_1_0

Foundation Reference

TextBackdropElement

Description
Element that sizes depending on the size of its child text element
Parent
BitmapElement
Functions

copyAttributes

Description
Definition
copyAttributes()
Code
42function TextBackdropElement:copyAttributes(src)
43 TextBackdropElement:superClass().copyAttributes(self, src)
44
45 self.padding = table.copy(src.padding)
46end

loadFromXML

Description
Definition
loadFromXML()
Code
26function TextBackdropElement:loadFromXML(xmlFile, key)
27 TextBackdropElement:superClass().loadFromXML(self, xmlFile, key)
28
29 self.padding = GuiUtils.getNormalizedValues(getXMLString(xmlFile, key.."#padding"), self.outputSize, self.padding)
30end

loadProfile

Description
Definition
loadProfile()
Code
34function TextBackdropElement:loadProfile(profile, applyProfile)
35 TextBackdropElement:superClass().loadProfile(self, profile, applyProfile)
36
37 self.padding = GuiUtils.getNormalizedValues(profile:getValue("padding"), self.outputSize, self.padding)
38end

new

Description
Definition
new()
Code
16function TextBackdropElement.new(target, custom_mt)
17 local self = BitmapElement.new(target, custom_mt or TextBackdropElement_mt)
18
19 self.padding = {0, 0, 0, 0} -- left, top, right, bottom
20
21 return self
22end