Added API functions for modulating the colour and alpha of a texture
This commit is contained in:
1 parent
b95cff5f0c
commit
24a86ba6e3
4 files changed
+41
No files matched your search
@@ -326,6 +326,34 @@ void render_texture_asset(AssetID id, RenderRect *src, RenderRect *dest) {
|
||||
render_texture(GameEngine.window.renderer, texture, src, dest);
|
||||
}
|
||||
|
||||
void modulate_texture_color(AssetID id, SDL_Color color) {
|
||||
if (id < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_Texture *texture = get_texture(GameEngine.asset_manager, id);
|
||||
|
||||
if (!texture) {
|
||||
return;
|
||||
}
|
||||
|
||||
set_texture_color_modulation(texture, color);
|
||||
}
|
||||
|
||||
void modulate_texture_alpha(AssetID id, u8 alpha) {
|
||||
if (id < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_Texture *texture = get_texture(GameEngine.asset_manager, id);
|
||||
|
||||
if (!texture) {
|
||||
return;
|
||||
}
|
||||
|
||||
set_texture_alpha_modulation(texture, alpha);
|
||||
}
|
||||
|
||||
TextSize get_text_size_from_font_asset(AssetID id, const char *text) {
|
||||
TextSize output = {};
|
||||
|
||||
|
||||
Reference in new issue
Block a user