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