libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
libscratchcpp::IStageHandler Class Referenceabstract

The IStageHandler class provides a stage interface for Scratch project players. More...

#include <scratchcpp/istagehandler.h>

Public Member Functions

virtual ~IStageHandler ()
 
virtual void init (Stage *stage)=0
 
virtual void onCostumeChanged (Costume *costume)=0
 
virtual void onTempoChanged (int tempo)=0
 
virtual void onVideoStateChanged (Stage::VideoState videoState)=0
 
virtual void onVideoTransparencyChanged (int videoTransparency)=0
 
virtual void onGraphicsEffectChanged (IGraphicsEffect *effect, double value)=0
 
virtual void onGraphicsEffectsCleared ()=0
 
virtual int costumeWidth () const =0
 
virtual int costumeHeight () const =0
 
virtual Rect boundingRect () const =0
 
virtual Rect fastBoundingRect () const =0
 
virtual bool touchingClones (const std::vector< Sprite * > &clones) const =0
 
virtual bool touchingPoint (double x, double y) const =0
 
virtual bool touchingColor (Rgb color) const =0
 
virtual bool touchingColor (Rgb color, Rgb mask) const =0
 

Detailed Description

The IStageHandler class provides a stage interface for Scratch project players.

Constructor & Destructor Documentation

◆ ~IStageHandler()

virtual libscratchcpp::IStageHandler::~IStageHandler ( )
inlinevirtual

Member Function Documentation

◆ boundingRect()

virtual Rect libscratchcpp::IStageHandler::boundingRect ( ) const
pure virtual

Used to get the bounding rectangle of the stage.

◆ costumeHeight()

virtual int libscratchcpp::IStageHandler::costumeHeight ( ) const
pure virtual

Used to get the current costume height.

◆ costumeWidth()

virtual int libscratchcpp::IStageHandler::costumeWidth ( ) const
pure virtual

Used to get the current costume width.

◆ fastBoundingRect()

virtual Rect libscratchcpp::IStageHandler::fastBoundingRect ( ) const
pure virtual

Used to get a less accurate bounding rectangle of the stage which is calculated by transforming the costume rectangle.

◆ init()

virtual void libscratchcpp::IStageHandler::init ( Stage * stage)
pure virtual

Called when the interface is set on a stage.

◆ onCostumeChanged()

virtual void libscratchcpp::IStageHandler::onCostumeChanged ( Costume * costume)
pure virtual

Called when the costume changes.

◆ onGraphicsEffectChanged()

virtual void libscratchcpp::IStageHandler::onGraphicsEffectChanged ( IGraphicsEffect * effect,
double value )
pure virtual

Called when the value of the given graphics effect changes.

Note
This method isn't called when all effects are cleared, use onGraphicsEffectsCleared() for this.

◆ onGraphicsEffectsCleared()

virtual void libscratchcpp::IStageHandler::onGraphicsEffectsCleared ( )
pure virtual

Called when all graphics effects are cleared.

◆ onTempoChanged()

virtual void libscratchcpp::IStageHandler::onTempoChanged ( int tempo)
pure virtual

Called when the tempo changes.

◆ onVideoStateChanged()

virtual void libscratchcpp::IStageHandler::onVideoStateChanged ( Stage::VideoState videoState)
pure virtual

Called when the video state changes.

◆ onVideoTransparencyChanged()

virtual void libscratchcpp::IStageHandler::onVideoTransparencyChanged ( int videoTransparency)
pure virtual

Called when the video transparency changes.

◆ touchingClones()

virtual bool libscratchcpp::IStageHandler::touchingClones ( const std::vector< Sprite * > & clones) const
pure virtual

Used to check whether the stage touches any of the given sprite clones.

◆ touchingColor() [1/2]

virtual bool libscratchcpp::IStageHandler::touchingColor ( Rgb color) const
pure virtual

Used to check whether the stage touches the given color.

◆ touchingColor() [2/2]

virtual bool libscratchcpp::IStageHandler::touchingColor ( Rgb color,
Rgb mask ) const
pure virtual

Used to check whether the mask part of the stage touches the given color.

◆ touchingPoint()

virtual bool libscratchcpp::IStageHandler::touchingPoint ( double x,
double y ) const
pure virtual

Used to check whether the stage touches the given point (in Scratch coordinates).


The documentation for this class was generated from the following file: