The ISpriteHandler class provides a sprite interface for Scratch project players.
More...
#include <scratchcpp/ispritehandler.h>
The ISpriteHandler class provides a sprite interface for Scratch project players.
◆ ~ISpriteHandler()
| virtual libscratchcpp::ISpriteHandler::~ISpriteHandler |
( |
| ) |
|
|
inlinevirtual |
◆ boundingRect()
| virtual Rect libscratchcpp::ISpriteHandler::boundingRect |
( |
| ) |
const |
|
pure virtual |
Used to get the bounding rectangle of the sprite.
- Note
- The rectangle must be relative to the stage, so make sure to use the sprite's coordinates.
◆ costumeHeight()
| virtual int libscratchcpp::ISpriteHandler::costumeHeight |
( |
| ) |
const |
|
pure virtual |
Used to get the current costume height.
◆ costumeWidth()
| virtual int libscratchcpp::ISpriteHandler::costumeWidth |
( |
| ) |
const |
|
pure virtual |
Used to get the current costume width.
◆ deinitClone()
| virtual void libscratchcpp::ISpriteHandler::deinitClone |
( |
| ) |
|
|
pure virtual |
Called when the sprite is deinitialized (if it is a clone).
◆ fastBoundingRect()
| virtual Rect libscratchcpp::ISpriteHandler::fastBoundingRect |
( |
| ) |
const |
|
pure virtual |
Used to get a less accurate bounding rectangle of the sprite which is calculated by transforming the costume rectangle.
- Note
- The rectangle must be relative to the stage, so make sure to use the sprite's coordinates.
◆ init()
| virtual void libscratchcpp::ISpriteHandler::init |
( |
Sprite * | sprite | ) |
|
|
pure virtual |
Called when the interface is set on a sprite.
◆ onCloned()
| virtual void libscratchcpp::ISpriteHandler::onCloned |
( |
Sprite * | clone | ) |
|
|
pure virtual |
Called when the sprite clones.
◆ onCostumeChanged()
| virtual void libscratchcpp::ISpriteHandler::onCostumeChanged |
( |
Costume * | costume | ) |
|
|
pure virtual |
Called when the costume changes.
◆ onDirectionChanged()
| virtual void libscratchcpp::ISpriteHandler::onDirectionChanged |
( |
double | direction | ) |
|
|
pure virtual |
Called when the direction changes.
◆ onGraphicsEffectChanged()
| virtual void libscratchcpp::ISpriteHandler::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::ISpriteHandler::onGraphicsEffectsCleared |
( |
| ) |
|
|
pure virtual |
Called when all graphics effects are cleared.
◆ onLayerOrderChanged()
| virtual void libscratchcpp::ISpriteHandler::onLayerOrderChanged |
( |
int | layerOrder | ) |
|
|
pure virtual |
Called when the layer order changes.
◆ onMoved()
| virtual void libscratchcpp::ISpriteHandler::onMoved |
( |
double | oldX, |
|
|
double | oldY, |
|
|
double | newX, |
|
|
double | newY ) |
|
pure virtual |
Called when the sprite position changes.
◆ onRotationStyleChanged()
| virtual void libscratchcpp::ISpriteHandler::onRotationStyleChanged |
( |
Sprite::RotationStyle | rotationStyle | ) |
|
|
pure virtual |
Called when the rotation style changes.
◆ onSizeChanged()
| virtual void libscratchcpp::ISpriteHandler::onSizeChanged |
( |
double | size | ) |
|
|
pure virtual |
Called when the size changes.
◆ onVisibleChanged()
| virtual void libscratchcpp::ISpriteHandler::onVisibleChanged |
( |
bool | visible | ) |
|
|
pure virtual |
Called when the visibility changes.
◆ onXChanged()
| virtual void libscratchcpp::ISpriteHandler::onXChanged |
( |
double | x | ) |
|
|
pure virtual |
Called when the X-coordinate changes.
◆ onYChanged()
| virtual void libscratchcpp::ISpriteHandler::onYChanged |
( |
double | y | ) |
|
|
pure virtual |
Called when the Y-coordinate changes.
◆ touchingClones()
| virtual bool libscratchcpp::ISpriteHandler::touchingClones |
( |
const std::vector< Sprite * > & | clones | ) |
const |
|
pure virtual |
Used to check whether the sprite touches any of the given sprite clones.
◆ touchingColor() [1/2]
| virtual bool libscratchcpp::ISpriteHandler::touchingColor |
( |
Rgb | color | ) |
const |
|
pure virtual |
Used to check whether the sprite touches the given color.
◆ touchingColor() [2/2]
| virtual bool libscratchcpp::ISpriteHandler::touchingColor |
( |
Rgb | color, |
|
|
Rgb | mask ) const |
|
pure virtual |
Used to check whether the mask part of the sprite touches the given color.
◆ touchingPoint()
| virtual bool libscratchcpp::ISpriteHandler::touchingPoint |
( |
double | x, |
|
|
double | y ) const |
|
pure virtual |
Used to check whether the sprite touches the given point (in Scratch coordinates).
The documentation for this class was generated from the following file: