ge211  2021.5.1
A student game engine
Rectangle_sprite Class Reference

Detailed Description

A Sprite that renders as a solid rectangle.

Definition at line 178 of file ge211_sprites.hxx.

+ Inheritance diagram for Rectangle_sprite:
+ Collaboration diagram for Rectangle_sprite:

Public Member Functions

 Rectangle_sprite (Dims< int >, Color=Color::white())
 Constructs a rectangle sprite from required Dims and an optional Color, which defaults to white. More...
 
void recolor (Color)
 Changes the color of this rectangle sprite.
 

Additional Inherited Members

- Protected Member Functions inherited from Render_sprite
 Render_sprite (Dims< int >)
 Constructs a Render_sprite with the given pixel dimensions. More...
 
bool can_paint () const
 Returns whether we can paint to this Render_sprite. More...
 
void fill_surface (Color)
 Fills the whole surface with the given color. More...
 
void fill_rectangle (Rect< int >, Color)
 Fills the given rectangle in the given color. More...
 
void set_pixel (Posn< int >, Color)
 Sets one pixel to the given color. More...
 
Borrowed< SDL_Surface > raw_surface ()
 Gains access to the underlying SDL_Surface. More...
 

Constructor & Destructor Documentation

◆ Rectangle_sprite()

Rectangle_sprite ( Dims< int >  dims,
Color  color = Color::white() 
)
explicit

Constructs a rectangle sprite from required Dims and an optional Color, which defaults to white.

Preconditions

  • both dimensions must be positive

Definition at line 139 of file ge211_sprites.cxx.


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