libscratchcpp
A library for C++ based Scratch project players
Toggle main menu visibility
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
9
namespace
libscratchcpp
10
{
11
12
class
IStageHandler
;
13
class
StagePrivate;
14
16
class
LIBSCRATCHCPP_EXPORT
Stage
:
public
Target
17
{
18
public
:
19
enum class
VideoState
20
{
21
On,
22
Off,
23
OnFlipped
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
libscratchcpp::IGraphicsEffect
The IGraphicsEffects class is an interface for custom graphics effects.
Definition
igraphicseffect.h:14
libscratchcpp::IStageHandler
The IStageHandler class provides a stage interface for Scratch project players.
Definition
istagehandler.h:15
libscratchcpp::Rect
Definition
rect.h:15
libscratchcpp::Stage
The Stage class is the project stage.
Definition
stage.h:17
libscratchcpp::Stage::fastBoundingRect
Rect fastBoundingRect() const override
Definition
stage.cpp:171
libscratchcpp::Stage::setCostumeIndex
void setCostumeIndex(int newCostumeIndex) override
Definition
stage.cpp:49
libscratchcpp::Stage::videoStateStr
std::string videoStateStr() const
Definition
stage.cpp:97
libscratchcpp::Stage::tempo
int tempo() const
Definition
stage.cpp:77
libscratchcpp::Stage::getInterface
IStageHandler * getInterface() const
Definition
stage.cpp:37
libscratchcpp::Stage::clearGraphicsEffects
void clearGraphicsEffects() override
Definition
stage.cpp:220
libscratchcpp::Stage::touchingPoint
bool touchingPoint(double x, double y) const override
Definition
stage.cpp:180
libscratchcpp::Stage::Stage
Stage()
Definition
stage.cpp:14
libscratchcpp::Stage::VideoState
VideoState
Definition
stage.h:20
libscratchcpp::Stage::isStage
bool isStage() const override
Definition
stage.cpp:43
libscratchcpp::Stage::videoState
VideoState videoState() const
Definition
stage.cpp:91
libscratchcpp::Stage::currentCostumeHeight
int currentCostumeHeight() const override
Definition
stage.cpp:68
libscratchcpp::Stage::setTextToSpeechLanguage
void setTextToSpeechLanguage(const std::string &newTextToSpeechLanguage)
Definition
stage.cpp:156
libscratchcpp::Stage::textToSpeechLanguage
const std::string & textToSpeechLanguage() const
Definition
stage.cpp:150
libscratchcpp::Stage::setVideoTransparency
void setVideoTransparency(int newVideoTransparency)
Definition
stage.cpp:142
libscratchcpp::Stage::setGraphicsEffectValue
void setGraphicsEffectValue(IGraphicsEffect *effect, double value) override
Definition
stage.cpp:207
libscratchcpp::Stage::setInterface
void setInterface(IStageHandler *newInterface)
Definition
stage.cpp:29
libscratchcpp::Stage::touchingColor
bool touchingColor(Rgb color) const override
Definition
stage.cpp:189
libscratchcpp::Stage::boundingRect
Rect boundingRect() const override
Definition
stage.cpp:162
libscratchcpp::Stage::videoTransparency
int videoTransparency() const
Definition
stage.cpp:136
libscratchcpp::Stage::setVideoState
void setVideoState(VideoState newVideoState)
Definition
stage.cpp:111
libscratchcpp::Stage::currentCostumeWidth
int currentCostumeWidth() const override
Definition
stage.cpp:59
libscratchcpp::Stage::setTempo
void setTempo(int newTempo)
Definition
stage.cpp:83
libscratchcpp::Stage::Stage
Stage(const Stage &)=delete
libscratchcpp::Target::Target
Target()
Definition
target.cpp:26
LIBSCRATCHCPP_EXPORT
#define LIBSCRATCHCPP_EXPORT
Definition
global.h:17
libscratchcpp
The main namespace of the library.
Definition
asset.h:10
libscratchcpp::Rgb
unsigned int Rgb
Definition
value_functions.h:11
target.h
include
scratchcpp
stage.h
Generated by
1.17.0