Skip to content

Commit

Permalink
Adds SetWindowOpacity() implementation for PLATFORM_WEB (#4403)
Browse files Browse the repository at this point in the history
  • Loading branch information
asdqwe authored Oct 21, 2024
1 parent cb21fe8 commit 9d0b1f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/platforms/rcore_web.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,9 @@ void SetWindowSize(int width, int height)
// Set window opacity, value opacity is between 0.0 and 1.0
void SetWindowOpacity(float opacity)
{
TRACELOG(LOG_WARNING, "SetWindowOpacity() not available on target platform");
if (opacity >= 1.0f) opacity = 1.0f;
else if (opacity <= 0.0f) opacity = 0.0f;
EM_ASM({ document.getElementById('canvas').style.opacity = $0; }, opacity);
}

// Set window focused
Expand Down

0 comments on commit 9d0b1f0

Please sign in to comment.