cocos-engine
cocos-engine copied to clipboard
Unify splash screen rendering
Cocos Creator version
3.8.2
System information
MacOS
Issue description
wechatgame:
const defaultRatio = 200 / image.height;
const widthRatio = image.width / canvas.width * 1.35 * defaultRatio * displayRatio;
const heightRatio = image.height / canvas.height * 1.35 * defaultRatio * displayRatio;
const heightOffset = 1/6; // canvas:(-1,1) -> (button, top); heightOffset = (5/12) * (-2) + 1 = 1/6
const vertices = new Float32Array([
widthRatio, heightOffset - heightRatio, 1.0, 1.0,
widthRatio, heightOffset + heightRatio, 1.0, 0.0,
-widthRatio, heightOffset - heightRatio, 0.0, 1.0,
-widthRatio, heightOffset + heightRatio, 0.0, 0.0,
]);
gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
splash-screen.ts:
this.logoYTrans = 1 / 6 + 2.5 / 6;// Percent
I reproduce the rendering position and size of the logo on the start scene because we may need to make a special transition effect.
However, the rendering codes of different platforms are different and cannot be easily reproduced.
so: Can you provide an example to help us reproduce splash screen rendering? Or unify the rendering code so that we can reproduce it more easily.
Relevant error log output
No response
Steps to reproduce
.
Minimal reproduction project
No response