Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Question about alpha channels.

A topic by Mayedl10 created Nov 10, 2023 Views: 73
Viewing posts 1 to 1
(5 edits)

If I have my background a colour A, and a second colour B, can I render text with colour A and then add a "shade" with colour A, but A's alpha channel is halved?

example

// background colour is #292b30
auto fontS = new Font(win, "res/gameFont.ttf", 12, {0xCF, 0xAB, 0x4A, 0xFF});
auto fontT = new Font(win, "res/gameFont.ttf", 12, {0xCF, 0xAB, 0x4A, 0x7F});

fontS->renderAt({10, 10}, msg.c_str());
fontT->renderAt({11, 11}, msg.c_str());