mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-04 16:28:00 +01:00
utils: Set <body> background in SetBackgroundColor on Emscripten
This commit is contained in:
parent
ca1cbc19b7
commit
dd35960724
1 changed files with 6 additions and 0 deletions
|
@ -798,4 +798,10 @@ SYMBOL_EXPORT double GetGameSpeed(struct Game* game) {
|
|||
|
||||
SYMBOL_EXPORT void SetBackgroundColor(struct Game* game, ALLEGRO_COLOR bg) {
|
||||
game->_priv.bg = bg;
|
||||
#ifdef __EMSCRIPTEN__
|
||||
EM_ASM({
|
||||
document.body.style.backgroundColor = 'rgb(' + $0 + ',' + $1 + ',' + $2 + ')';
|
||||
},
|
||||
(int)(bg.r * 255), (int)(bg.g * 255), (int)(bg.b * 255));
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue