Feature/tilemap editor (#237)
* feat: 添加 Tilemap 编辑器插件和组件生命周期支持 * feat(editor-core): 添加声明式插件注册 API * feat(editor-core): 改进tiledmap结构合并tileset进tiledmapeditor * feat: 添加 editor-runtime SDK 和插件系统改进 * fix(ci): 修复SceneResourceManager里变量未使用问题
This commit is contained in:
@@ -331,14 +331,15 @@ impl SpriteBatch {
|
||||
(-ox, -oy), // Bottom-left | 左下
|
||||
];
|
||||
|
||||
// UV coordinates match OpenGL/WebGL convention
|
||||
// UV坐标匹配OpenGL/WebGL约定
|
||||
// (0,0) = bottom-left of texture, (1,1) = top-right
|
||||
// UV coordinates use image coordinate system (top-left origin, Y-down)
|
||||
// UV坐标使用图像坐标系(左上角为原点,Y轴向下)
|
||||
// Incoming UV: [u0, v0, u1, v1] where v0 < v1
|
||||
// 传入的 UV:[u0, v0, u1, v1] 其中 v0 < v1
|
||||
let tex_coords = [
|
||||
[u0, v1], // Top-left (texture top)
|
||||
[u1, v1], // Top-right (texture top)
|
||||
[u1, v0], // Bottom-right (texture bottom)
|
||||
[u0, v0], // Bottom-left (texture bottom)
|
||||
[u0, v0], // Top-left
|
||||
[u1, v0], // Top-right
|
||||
[u1, v1], // Bottom-right
|
||||
[u0, v1], // Bottom-left
|
||||
];
|
||||
|
||||
// Transform and add each vertex | 变换并添加每个顶点
|
||||
|
||||
@@ -135,10 +135,6 @@ impl TextureManager {
|
||||
let onload = Closure::wrap(Box::new(move || {
|
||||
gl.bind_texture(WebGl2RenderingContext::TEXTURE_2D, Some(&texture_for_closure));
|
||||
|
||||
// Flip Y axis for correct orientation (image coords vs WebGL coords)
|
||||
// 翻转Y轴以获得正确的方向(图像坐标系 vs WebGL坐标系)
|
||||
gl.pixel_storei(WebGl2RenderingContext::UNPACK_FLIP_Y_WEBGL, 1);
|
||||
|
||||
// Use the captured image element | 使用捕获的图片元素
|
||||
let result = gl.tex_image_2d_with_u32_and_u32_and_html_image_element(
|
||||
WebGl2RenderingContext::TEXTURE_2D,
|
||||
|
||||
Reference in New Issue
Block a user