ScummVM API documentation
autotextscroll.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 NANCY_ACTION_AUTOTEXTSCROLL_H
23#define NANCY_ACTION_AUTOTEXTSCROLL_H
24
25#include "engines/nancy/commontypes.h"
26#include "engines/nancy/action/actionrecord.h"
27
28namespace Nancy {
29namespace Action {
30
31// Nancy16 scrolling text, used for the end credits. Each of the listed AUTOTEXT
32// entries is rendered as hypertext and scrolled through a rectangle, one after another.
33// Once they have all scrolled out of view, an event flag gets set.
35public:
36 // The text goes over the overlays of the scene, e.g. Nancy17's index cards
37 AutotextScroll(bool hasDrawingOrder = false) : RenderActionRecord(15), _hasDrawingOrder(hasDrawingOrder) {}
38 virtual ~AutotextScroll();
39
40 void init() override;
41 void updateGraphics() override;
42
43 void readData(Common::SeekableReadStream &stream) override;
44 void execute() override;
45
46 bool isViewportRelative() const override { return true; }
47
48protected:
49 Common::String getRecordTypeName() const override { return "AutotextScroll"; }
50
53 int32 ticks = 0;
54 int32 offset = 0; // scroll position; the text starts this far above the top of the rect
55 };
56
57 void startText(const Common::String &key);
58 bool scrollText(ScrollingText &text, int32 ticks);
59 void update(int32 ticks);
60
61 void redraw();
62
63 // -- File data --
64 bool _hasDrawingOrder; // Nancy18 has a type that can be put above or below other records
65 int32 _startDepth = 0; // how far below the top of the rect the text starts
66 Common::Rect _bounds;
67 int32 _intervalTicks = 0; // between two entries starting
68 float _speed = 0; // pixels per tick; negative scrolls up
69 uint32 _fontID = 0;
70 uint32 _colorID = 0;
72 FlagDescription _doneFlag;
73
74 // -- Runtime state --
75 uint _nextKey = 0;
76 int32 _intervalCounter = 0;
78 uint32 _lastTickTime = 0;
79};
80
81} // End of namespace Action
82} // End of namespace Nancy
83
84#endif // NANCY_ACTION_AUTOTEXTSCROLL_H
Definition: stream.h:745
Definition: str.h:59
Definition: managed_surface.h:51
Definition: autotextscroll.h:34
Definition: actionrecord.h:169
Definition: actionmanager.h:32
Definition: rect.h:536
Definition: autotextscroll.h:51
Definition: commontypes.h:201