libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
stage.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5#include <string>
6
7#include "target.h"
8
9namespace libscratchcpp
10{
11
12class IStageHandler;
13class StagePrivate;
14
17{
18 public:
19 enum class VideoState
20 {
24 };
25
26 Stage();
27 Stage(const Stage &) = delete;
28
29 void setInterface(IStageHandler *newInterface);
30 IStageHandler *getInterface() const; // NOTE: This can't be called interface because of... Microsoft... (it wouldn't compile on Windows)
31
32 bool isStage() const override;
33
34 void setCostumeIndex(int newCostumeIndex) override;
35
36 int currentCostumeWidth() const override;
37 int currentCostumeHeight() const override;
38
39 int tempo() const;
40 void setTempo(int newTempo);
41
42 VideoState videoState() const;
43 std::string videoStateStr() const;
44 void setVideoState(VideoState newVideoState);
45 void setVideoState(const std::string &newVideoState);
46 void setVideoState(const char *newVideoState);
47
48 int videoTransparency() const;
49 void setVideoTransparency(int newVideoTransparency);
50
51 const std::string &textToSpeechLanguage() const;
52 void setTextToSpeechLanguage(const std::string &newTextToSpeechLanguage);
53
54 Rect boundingRect() const override;
55 Rect fastBoundingRect() const override;
56
57 bool touchingPoint(double x, double y) const override;
58 bool touchingColor(Rgb color) const override;
59 bool touchingColor(Rgb color, Rgb mask) const override;
60
61 void setGraphicsEffectValue(IGraphicsEffect *effect, double value) override;
62
63 void clearGraphicsEffects() override;
64
65 private:
66 bool touchingClones(const std::vector<Sprite *> &clones) const override;
67
68 spimpl::unique_impl_ptr<StagePrivate> impl;
69};
70
71} // namespace libscratchcpp
The IGraphicsEffects class is an interface for custom graphics effects.
Definition igraphicseffect.h:14
The IStageHandler class provides a stage interface for Scratch project players.
Definition istagehandler.h:15
Definition rect.h:15
The Stage class is the project stage.
Definition stage.h:17
Rect fastBoundingRect() const override
Definition stage.cpp:171
void setCostumeIndex(int newCostumeIndex) override
Definition stage.cpp:49
std::string videoStateStr() const
Definition stage.cpp:97
int tempo() const
Definition stage.cpp:77
IStageHandler * getInterface() const
Definition stage.cpp:37
void clearGraphicsEffects() override
Definition stage.cpp:220
bool touchingPoint(double x, double y) const override
Definition stage.cpp:180
Stage()
Definition stage.cpp:14
VideoState
Definition stage.h:20
@ On
Definition stage.h:21
@ OnFlipped
Definition stage.h:23
@ Off
Definition stage.h:22
bool isStage() const override
Definition stage.cpp:43
VideoState videoState() const
Definition stage.cpp:91
int currentCostumeHeight() const override
Definition stage.cpp:68
void setTextToSpeechLanguage(const std::string &newTextToSpeechLanguage)
Definition stage.cpp:156
const std::string & textToSpeechLanguage() const
Definition stage.cpp:150
void setVideoTransparency(int newVideoTransparency)
Definition stage.cpp:142
void setGraphicsEffectValue(IGraphicsEffect *effect, double value) override
Definition stage.cpp:207
void setInterface(IStageHandler *newInterface)
Definition stage.cpp:29
bool touchingColor(Rgb color) const override
Definition stage.cpp:189
Rect boundingRect() const override
Definition stage.cpp:162
int videoTransparency() const
Definition stage.cpp:136
void setVideoState(VideoState newVideoState)
Definition stage.cpp:111
int currentCostumeWidth() const override
Definition stage.cpp:59
void setTempo(int newTempo)
Definition stage.cpp:83
Stage(const Stage &)=delete
Target()
Definition target.cpp:26
#define LIBSCRATCHCPP_EXPORT
Definition global.h:17
The main namespace of the library.
Definition asset.h:10
unsigned int Rgb
Definition value_functions.h:11