1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13: namespace ManiaLib\Gui\Elements;
14:
15: class Format extends \ManiaLib\Gui\Element
16: {
17: const AvatarButtonNormal = 'AvatarButtonNormal';
18: const StyleTextScriptEditor = 'StyleTextScriptEditor';
19: const StyleValueYellowSmall = 'StyleValueYellowSmall';
20: const TextButtonBig = 'TextButtonBig';
21: const TextButtonMedium = 'TextButtonMedium';
22: const TextButtonNav = 'TextButtonNav';
23: const TextButtonNavBack = 'TextButtonNavBack';
24: const TextButtonSmall = 'TextButtonSmall';
25: const TextCardInfoSmall = 'TextCardInfoSmall';
26: const TextCardMedium = 'TextCardMedium';
27: const TextCardRaceRank = 'TextCardRaceRank';
28: const TextCardScores2 = 'TextCardScores2';
29: const TextCardSmallScores2 = 'TextCardSmallScores2';
30: const TextCardSmallScores2Rank = 'TextCardSmallScores2Rank';
31: const TextChallengeNameMedal = 'TextChallengeNameMedal';
32: const TextChallengeNameMedalNone = 'TextChallengeNameMedalNone';
33: const TextChallengeNameMedium = 'TextChallengeNameMedium';
34: const TextChallengeNameSmall = 'TextChallengeNameSmall';
35: const TextCongratsBig = 'TextCongratsBig';
36: const TextCredits = 'TextCredits';
37: const TextCreditsTitle = 'TextCreditsTitle';
38: const TextInfoMedium = 'TextInfoMedium';
39: const TextInfoSmall = 'TextInfoSmall';
40: const TextPlayerCardName = 'TextPlayerCardName';
41: const TextPlayerCardScore = 'TextPlayerCardScore';
42: const TextRaceChat = 'TextRaceChat';
43: const TextRaceChrono = 'TextRaceChrono';
44: const TextRaceChronoError = 'TextRaceChronoError';
45: const TextRaceChronoOfficial = 'TextRaceChronoOfficial';
46: const TextRaceChronoWarning = 'TextRaceChronoWarning';
47: const TextRaceMessage = 'TextRaceMessage';
48: const TextRaceMessageBig = 'TextRaceMessageBig';
49: const TextRaceStaticSmall = 'TextRaceStaticSmall';
50: const TextRaceValueSmall = 'TextRaceValueSmall';
51: const TextRankingsBig = 'TextRankingsBig';
52: const TextSPScoreBig = 'TextSPScoreBig';
53: const TextSPScoreMedium = 'TextSPScoreMedium';
54: const TextSPScoreSmall = 'TextSPScoreSmall';
55: const TextStaticMedium = 'TextStaticMedium';
56: const TextStaticSmall = 'TextStaticSmall';
57: const TextStaticVerySmall = 'TextStaticVerySmall';
58: const TextSubTitle1 = 'TextSubTitle1';
59: const TextSubTitle2 = 'TextSubTitle2';
60: const TextTips = 'TextTips';
61: const TextTitle1 = 'TextTitle1';
62: const TextTitle2 = 'TextTitle2';
63: const TextTitle2Blink = 'TextTitle2Blink';
64: const TextTitle3 = 'TextTitle3';
65: const TextTitle3Header = 'TextTitle3Header';
66: const TextTitleError = 'TextTitleError';
67: const TextValueBig = 'TextValueBig';
68: const TextValueMedium = 'TextValueMedium';
69: const TextValueSmall = 'TextValueSmall';
70: const TrackListItem = 'TrackListItem';
71: const TrackListLine = 'TrackListLine';
72: const TrackerText = 'TrackerText';
73: const TrackerTextBig = 'TrackerTextBig';
74:
75: protected $xmlTagName = 'format';
76: protected $halign = null;
77: protected $valign = null;
78: protected $posX = null;
79: protected $posY = null;
80: protected $posZ = null;
81: protected $style = null;
82: protected $subStyle = null;
83: protected $textSize;
84: protected $textColor;
85:
86: function __construct()
87: {
88:
89: }
90:
91: 92: 93: 94:
95: function setTextSize($textsize)
96: {
97: $this->textSize = $textsize;
98: $this->setStyle(null);
99: $this->setSubStyle(null);
100: }
101:
102: 103: 104: 105:
106: function setTextColor($textcolor)
107: {
108: $this->textColor = $textcolor;
109: $this->setStyle(null);
110: $this->setSubStyle(null);
111: }
112:
113: 114: 115: 116:
117: function getTextSize()
118: {
119: return $this->textSize;
120: }
121:
122: 123: 124: 125:
126: function getTextColor()
127: {
128: return $this->textColor;
129: }
130:
131: protected function postFilter()
132: {
133: if($this->textSize !== null)
134: $this->xml->setAttribute('textsize', $this->textSize);
135: if($this->textColor !== null)
136: $this->xml->setAttribute('textcolor', $this->textColor);
137: }
138:
139: }
140:
141: ?>