ScummVM API documentation
text.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef MEDIASTATION_TEXT_H
23 #define MEDIASTATION_TEXT_H
24 
25 #include "common/str.h"
26 
27 #include "mediastation/asset.h"
28 #include "mediastation/mediascript/scriptvalue.h"
29 #include "mediastation/mediascript/scriptconstants.h"
30 
31 namespace MediaStation {
32 
33 enum TextJustification {
34  kTextJustificationLeft = 0x25c,
35  kTextJustificationRight = 0x25d,
36  kTextJustificationCenter = 0x25e
37 };
38 
39 enum TextPosition {
40  kTextPositionMiddle = 0x25e,
41  kTextPositionTop = 0x260,
42  kTextPositionBotom = 0x261
43 };
44 
46  uint firstAsciiCode = 0;
47  uint lastAsciiCode = 0;
48 };
49 
50 class Text : public SpatialEntity {
51 public:
52  Text() : SpatialEntity(kAssetTypeText) {};
53 
54  virtual bool isVisible() const override { return _isVisible; }
55  virtual void readParameter(Chunk &chunk, AssetHeaderSectionType paramType) override;
56  virtual ScriptValue callMethod(BuiltInMethod methodId, Common::Array<ScriptValue> &args) override;
57 
58 private:
59  bool _editable = false;
60  uint _loadType = 0;
61  bool _isVisible = false;
62  Common::String _text;
63  uint _maxTextLength = 0;
64  uint _fontAssetId = 0;
65  TextJustification _justification;
66  TextPosition _position;
67  Common::Array<CharacterClass> _acceptedInput;
68 
69  // Method implementations.
70  Common::String text() const;
71  void setText(Common::String text);
72 };
73 
74 } // End of namespace MediaStation
75 
76 #endif
Definition: str.h:59
Definition: asset.h:167
Definition: asset.h:32
Definition: text.h:50
Definition: datafile.h:103
Definition: text.h:45
Definition: scriptvalue.h:36