TinyGPU
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SpriteInfoWithoutBackground< RGB_T, SurfaceT > Struct Template Reference

#include <SpriteInfo.h>

Inheritance diagram for SpriteInfoWithoutBackground< RGB_T, SurfaceT >:
Inheritance graph
[legend]
Collaboration diagram for SpriteInfoWithoutBackground< RGB_T, SurfaceT >:
Collaboration graph
[legend]

Public Member Functions

 SpriteInfoWithoutBackground (size_t startX, size_t startY, const ISurface< RGB_T > &sourceSprite, RGB_T transparentColor, IFont< RGB_T > &font)
 
void saveOriginalPixels (ISurface< RGB_T > &) override
 Saves the background pixels currently covered by the sprite.
 
- Public Member Functions inherited from SpriteInfo< RGB_T, SurfaceT >
 SpriteInfo (size_t startX, size_t startY, const ISurface< RGB_T > &sourceSprite, RGB_T transparentColor, IFont< RGB_T > &font)
 
virtual ~SpriteInfo ()
 
Rect getRect () const
 
Rect clampedSize (size_t rawWidth, size_t rawHeight) const
 
const ISurface< RGB_T > & currentSprite () const
 Returns the sprite image currently used for drawing.
 
virtual void saveOriginalPixels (ISurface< RGB_T > &framebuffer)
 Saves the background pixels currently covered by the sprite.
 
void onTouch (Point point)
 
void setMaxSize (size_t maxX, size_t maxY)
 Set the maximum buffer size for transformedSprite and allocate buffer.
 
void setTransformedSprite (SurfaceT &&newSprite)
 

Additional Inherited Members

- Public Attributes inherited from SpriteInfo< RGB_T, SurfaceT >
size_t x = 0
 
size_t y = 0
 
size_t maxWidth = 0
 
size_t maxHeight = 0
 
RGB_T invisibleColor = RGB_T(0)
 
const ISurface< RGB_T > * sprite = nullptr
 
bool isSurfaceAutoDelete = false
 
std::unique_ptr< SurfaceT > transformedSprite
 
bool hasTransformedContent = false
 
float currentScale = 1.0f
 
float currentAngleDegrees = 0.0f
 
SurfaceT originalPixels
 
IFont< RGB_T > & fontRef
 
void(* onTouchCallback )(SpriteInfo &, Point) = nullptr
 

Detailed Description

template<typename RGB_T = RGB565, typename SurfaceT = Surface<RGB_T>>
struct tinygpu::SpriteInfoWithoutBackground< RGB_T, SurfaceT >

A specialized SpriteInfo that does not save the background pixels.

This is useful for sprites that do not need to restore the background, such as those that are always drawn on a solid color or when the background is managed separately.

Constructor & Destructor Documentation

◆ SpriteInfoWithoutBackground()

SpriteInfoWithoutBackground ( size_t  startX,
size_t  startY,
const ISurface< RGB_T > &  sourceSprite,
RGB_T  transparentColor,
IFont< RGB_T > &  font 
)
inline

Member Function Documentation

◆ saveOriginalPixels()

void saveOriginalPixels ( ISurface< RGB_T > &  framebuffer)
inlineoverridevirtual

Saves the background pixels currently covered by the sprite.

Reimplemented from SpriteInfo< RGB_T, SurfaceT >.


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