libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
istagehandler.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5#include "global.h"
6#include "stage.h"
7
8namespace libscratchcpp
9{
10
11class Sprite;
12
15{
16 public:
17 virtual ~IStageHandler() { }
18
20 virtual void init(Stage *stage) = 0;
21
23 virtual void onCostumeChanged(Costume *costume) = 0;
24
26 virtual void onTempoChanged(int tempo) = 0;
27
29 virtual void onVideoStateChanged(Stage::VideoState videoState) = 0;
30
32 virtual void onVideoTransparencyChanged(int videoTransparency) = 0;
33
38 virtual void onGraphicsEffectChanged(IGraphicsEffect *effect, double value) = 0;
39
41 virtual void onGraphicsEffectsCleared() = 0;
42
44 virtual int costumeWidth() const = 0;
45
47 virtual int costumeHeight() const = 0;
48
50 virtual Rect boundingRect() const = 0;
51
56 virtual Rect fastBoundingRect() const = 0;
57
59 virtual bool touchingClones(const std::vector<Sprite *> &clones) const = 0;
60
62 virtual bool touchingPoint(double x, double y) const = 0;
63
65 virtual bool touchingColor(Rgb color) const = 0;
66
68 virtual bool touchingColor(Rgb color, Rgb mask) const = 0;
69};
70
71} // namespace libscratchcpp
The Costume class represents a Scratch costume.
Definition costume.h:17
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
virtual void onGraphicsEffectsCleared()=0
virtual void onGraphicsEffectChanged(IGraphicsEffect *effect, double value)=0
virtual void onVideoStateChanged(Stage::VideoState videoState)=0
virtual void init(Stage *stage)=0
virtual void onCostumeChanged(Costume *costume)=0
virtual int costumeWidth() const =0
virtual bool touchingColor(Rgb color) const =0
virtual int costumeHeight() const =0
virtual bool touchingClones(const std::vector< Sprite * > &clones) const =0
virtual bool touchingPoint(double x, double y) const =0
virtual Rect fastBoundingRect() const =0
virtual bool touchingColor(Rgb color, Rgb mask) const =0
virtual Rect boundingRect() const =0
virtual void onVideoTransparencyChanged(int videoTransparency)=0
virtual void onTempoChanged(int tempo)=0
virtual ~IStageHandler()
Definition istagehandler.h:17
Definition rect.h:15
The Sprite class represents a Scratch sprite.
Definition sprite.h:18
The Stage class is the project stage.
Definition stage.h:17
VideoState
Definition stage.h:20
#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