Skip to content

Commit

Permalink
Add setSpriteColor(Rgba)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhasse committed Jul 17, 2024
1 parent ec83040 commit 17f3c0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/jngl/sprite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "Drawable.hpp"
#include "Rgb.hpp"
#include "Rgba.hpp"
#include "ShaderProgram.hpp"
#include "Vec2.hpp"

Expand Down Expand Up @@ -267,6 +268,9 @@ void setSpriteColor(unsigned char red, unsigned char green, unsigned char blue);
/// Sets the global color used for drawing Sprites, leaves the alpha value untouched
void setSpriteColor(Rgb);

/// Sets the global color used for drawing Sprites
void setSpriteColor(Rgba);

void setSpriteAlpha(unsigned char alpha);

void pushSpriteAlpha(unsigned char alpha = 255);
Expand Down
4 changes: 4 additions & 0 deletions src/spriteimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ void setSpriteColor(Rgb color) {
gSpriteColor.setRgb(color);
}

void setSpriteColor(Rgba color) {
gSpriteColor = color;
}

std::stack<float> spriteAlphas;

void pushSpriteAlpha(unsigned char alpha) {
Expand Down

0 comments on commit 17f3c0a

Please sign in to comment.