浏览代码

Adds SetWindowOpacity() implementation for PLATFORM_WEB (#4403)

pull/4408/head
Asdqwe 5 个月前
committed by GitHub
父节点
当前提交
9d0b1f0171
找不到此签名对应的密钥 GPG 密钥 ID: B5690EEEBB952194
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. +3
    -1
      src/platforms/rcore_web.c

+ 3
- 1
src/platforms/rcore_web.c 查看文件

@ -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

正在加载...
取消
保存