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  * Text utility defines
21  */
22 
23 #ifndef TINSEL_TEXT_H // prevent multiple includes
24 #define TINSEL_TEXT_H
25 
26 #include "common/coroutines.h"
27 #include "tinsel/object.h" // object manager defines
28 
29 namespace Tinsel {
30 
32 enum {
33  TXT_CENTER = 0x0001,
34  TXT_RIGHT = 0x0002,
35  TXT_SHADOW = 0x0004,
36  TXT_ABSOLUTE = 0x0008
37 };
38 
40 #define MAX_FONT_CHARS 256
41 
42 #define C16_240 0x4000
43 #define C16_224 0x8000
44 #define C16_MAP 0xC000
45 #define C16_FLAG_MASK (C16_240 | C16_224 | C16_MAP)
46 
52 struct FONT {
53  int xSpacing;
54  int ySpacing;
55  int xShadow;
56  int yShadow;
57  int spaceSize;
58  int baseColor;
61 };
62 
63 
65 struct TEXTOUT {
67  char *szStr;
68  int color;
69  int xPos;
70  int yPos;
72  int mode;
73  int sleepTime;
74 };
75 
76 
77 /*----------------------------------------------------------------------*\
78 |* Text Function Prototypes *|
79 \*----------------------------------------------------------------------*/
80 
94 OBJECT *ObjectTextOut(OBJECT **pList, char *szStr, int color,
95  int xPos, int yPos, SCNHANDLE hFont, int mode, int sleepTime = 0);
96 
97 bool IsCharImage( // Is there an image for this character in this font?
98  SCNHANDLE hFont, // which font to use
99  char c); // character to test
100 
101 uint32 t3GetBaseColor();
102 
103 } // End of namespace Tinsel
104 
105 #endif // TINSEL_TEXT_H
right justify text
Definition: text.h:34
int sleepTime
sleep time between each character (if non-zero)
Definition: text.h:73
int spaceSize
x spacing to use for a space character
Definition: text.h:57
int xPos
x position of string
Definition: text.h:69
uint32 SCNHANDLE
Definition: dw.h:31
Definition: text.h:65
Definition: object.h:126
Definition: text.h:52
OBJECT * pList
object list to add text to
Definition: text.h:66
int baseColor
base color which can be replaced, specific to Tinsel 3
Definition: text.h:58
position of text is absolute (only for object text)
Definition: text.h:36
int xSpacing
x spacing between characters
Definition: text.h:53
Definition: object.h:74
char * szStr
string to output
Definition: text.h:67
int color
color for monochrome text
Definition: text.h:68
center justify text
Definition: text.h:33
shadow each character
Definition: text.h:35
Definition: actors.h:36
SCNHANDLE hFont
which font to use
Definition: text.h:71
int ySpacing
y spacing between characters
Definition: text.h:54
int yPos
y position of string
Definition: text.h:70
int yShadow
y shadow offset
Definition: text.h:56
int xShadow
x shadow offset
Definition: text.h:55
OBJECT * ObjectTextOut(OBJECT **pList, char *szStr, int color, int xPos, int yPos, SCNHANDLE hFont, int mode, int sleepTime=0)
OBJ_INIT fontInit
structure used to init text objects
Definition: text.h:59
SCNHANDLE fontDef[300]
image handle array for all characters in the font
Definition: text.h:60
int mode
mode flags for the string
Definition: text.h:72