ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
display.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 AGS_ENGINE_AC_DISPLAY_H
23 #define AGS_ENGINE_AC_DISPLAY_H
24 
25 #include "ags/shared/gui/gui_main.h"
26 
27 namespace AGS3 {
28 
29 using AGS::Shared::GUIMain;
30 
31 // options for 'disp_type' parameter
32 // blocking speech
33 #define DISPLAYTEXT_SPEECH 0
34 // super-blocking message box
35 #define DISPLAYTEXT_MESSAGEBOX 1
36 // regular non-blocking overlay
37 #define DISPLAYTEXT_NORMALOVERLAY 2
38 // also accepts explicit overlay ID >= OVER_CUSTOM
39 
40 struct ScreenOverlay;
41 Shared::Bitmap *create_textual_image(const char *text, int asspch, int isThought,
42  int &xx, int &yy, int &adjustedXX, int &adjustedYY, int wii, int usingfont, int allowShrink,
43  bool &alphaChannel);
44 // Creates a textual overlay using the given parameters;
45 // Pass yy = -1 to find Y co-ord automatically
46 // allowShrink = 0 for none, 1 for leftwards, 2 for rightwards
47 // pass blocking=2 to create permanent overlay
48 ScreenOverlay *display_main(int xx, int yy, int wii, const char *text, int disp_type, int usingfont,
49  int asspch, int isThought, int allowShrink, bool overlayPositionFixed, bool roomlayer = false);
50 // Displays a standard blocking message box at a given position
51 void display_at(int xx, int yy, int wii, const char *text);
52 // Cleans up display message state
53 void post_display_cleanup();
54 // Tests the given string for the voice-over tags and plays cue clip for the given character;
55 // will assign replacement string, which will be blank string if game is in "voice-only" mode
56 // and clip was started, or string cleaned from voice-over tags which is safe to display on screen.
57 // Returns whether voice-over clip was started successfully.
58 bool try_auto_play_speech(const char *text, const char *&replace_text, int charid);
59 // Calculates meaningful length of the displayed text
60 int GetTextDisplayLength(const char *text);
61 // Calculates number of game loops for displaying a text on screen
62 int GetTextDisplayTime(const char *text, int canberel = 0);
63 // Draw an outline if requested, then draw the text on top
64 void wouttext_outline(Shared::Bitmap *ds, int xxp, int yyp, int usingfont, color_t text_color, const char *texx);
65 void wouttext_aligned(Shared::Bitmap *ds, int usexp, int yy, int oriwid, int usingfont, color_t text_color, const char *text, HorAlignment align);
66 void do_corner(Shared::Bitmap *ds, int sprn, int xx1, int yy1, int typx, int typy);
67 // Returns the image of a button control on the GUI under given child index
68 int get_but_pic(GUIMain *guo, int indx);
69 void draw_button_background(Shared::Bitmap *ds, int xx1, int yy1, int xx2, int yy2, GUIMain *iep);
70 // Calculate the width that the left and right border of the textwindow
71 // GUI take up
72 int get_textwindow_border_width(int twgui);
73 // get the hegiht of the text window's top border
74 int get_textwindow_top_border_height(int twgui);
75 // draw_text_window: draws the normal or custom text window
76 // create a new bitmap the size of the window before calling, and
77 // point text_window_ds to it
78 // returns text start x & y pos in parameters
79 // Warning!: draw_text_window() and draw_text_window_and_bar() can create new text_window_ds
80 void draw_text_window(Shared::Bitmap **text_window_ds, bool should_free_ds, int *xins, int *yins, int *xx, int *yy, int *wii, color_t *set_text_color, int ovrheight, int ifnum);
81 void draw_text_window_and_bar(Shared::Bitmap **text_window_ds, bool should_free_ds,
82  int *xins, int *yins, int *xx, int *yy, int *wii, color_t *set_text_color, int ovrheight = 0, int ifnum = -1);
83 int get_textwindow_padding(int ifnum);
84 
85 } // namespace AGS3
86 
87 #endif
Definition: ags.h:40