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

The Costume class represents a Scratch costume. More...

#include <scratchcpp/costume.h>

Inheritance diagram for libscratchcpp::Costume:
Collaboration diagram for libscratchcpp::Costume:

Public Member Functions

 Costume (const std::string &name, const std::string &id, const std::string &format)
 
 Costume (const Costume &)=delete
 
double bitmapResolution () const
 
void setBitmapResolution (double newBitmapResolution)
 
int rotationCenterX () const
 
void setRotationCenterX (int newRotationCenterX)
 
int rotationCenterY () const
 
void setRotationCenterY (int newRotationCenterY)
 
Broadcastbroadcast ()
 
void setId (const std::string &id)
 
const std::string & name () const
 
const std::string & fileName () const
 
const std::string & dataFormat () const
 
const void * data () const
 
unsigned int dataSize () const
 
void setData (unsigned int size, void *data)
 
Targettarget () const
 
void setTarget (Target *target)
 
const std::string & id () const
 

Protected Member Functions

virtual void processData (unsigned int size, void *data)
 
virtual bool isClone () const
 

Detailed Description

The Costume class represents a Scratch costume.

Constructor & Destructor Documentation

◆ Costume() [1/2]

Costume::Costume ( const std::string & name,
const std::string & id,
const std::string & format )

Constructs Costume.

◆ Costume() [2/2]

libscratchcpp::Costume::Costume ( const Costume & )
delete

Member Function Documentation

◆ bitmapResolution()

double Costume::bitmapResolution ( ) const

Returns the reciprocal of the costume scaling factor for bitmap costumes.

◆ broadcast()

Broadcast * Costume::broadcast ( )

Returns the Broadcast linked with this costume.

Note
This is used by the "switch backdrop to and wait" block.

◆ data()

const void * Asset::data ( ) const
inherited

Returns the asset data.

◆ dataFormat()

const std::string & Asset::dataFormat ( ) const
inherited

Returns the name of the format of the asset file.

◆ dataSize()

unsigned int Asset::dataSize ( ) const
inherited

Returns the size of the asset data.

◆ fileName()

const std::string & Asset::fileName ( ) const
inherited

Returns the name of the asset file.

◆ id()

const std::string & Entity::id ( ) const
inherited

Returns the ID.

◆ isClone()

virtual bool libscratchcpp::Asset::isClone ( ) const
inlineprotectedvirtualinherited

Reimplemented in libscratchcpp::Sound.

◆ name()

const std::string & Asset::name ( ) const
inherited

Returns the name of the asset.

◆ processData()

virtual void libscratchcpp::Asset::processData ( unsigned int size,
void * data )
inlineprotectedvirtualinherited

Reimplemented in libscratchcpp::Sound.

◆ rotationCenterX()

int Costume::rotationCenterX ( ) const

Returns the x-coordinate of the rotation center.

◆ rotationCenterY()

int Costume::rotationCenterY ( ) const

Returns the y-coordinate of the rotation center.

◆ setBitmapResolution()

void Costume::setBitmapResolution ( double newBitmapResolution)

Sets the reciprocal of the costume scaling factor for bitmap costumes.

◆ setData()

void Asset::setData ( unsigned int size,
void * data )
inherited

Sets the asset data (will be deallocated when the object is destroyed).

◆ setId()

void Asset::setId ( const std::string & id)
inherited

Sets the ID (MD5 hash) of the asset file.

◆ setRotationCenterX()

void Costume::setRotationCenterX ( int newRotationCenterX)

Sets the x-coordinate of the rotation center.

◆ setRotationCenterY()

void Costume::setRotationCenterY ( int newRotationCenterY)

Returns the y-coordinate of the rotation center.

◆ setTarget()

void Asset::setTarget ( Target * target)
inherited

Sets the sprite or stage this asset belongs to.

◆ target()

Target * Asset::target ( ) const
inherited

Returns the sprite or stage this asset belongs to.


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