eva-engine / eva.js

Eva.js is a front-end game engine specifically for creating interactive game projects.
https://eva.js.org
MIT License
1.75k stars 108 forks source link

GameObjects同时使用spine&image spine被覆盖 #63

Closed chenyuliang-star closed 3 years ago

chenyuliang-star commented 3 years ago

GameObjects同时使用spine&image spine被覆盖


export default function createBg() {
  const bgObject = new GameObject('bg', {
    size: { width: 1024, height: 576 },
    position: {
      x: 0,
      y: 0,
    },
  });
  const img = new Img({ resource: 'bg_image' });
  const spine = new Spine({ resource: 'bg_spine', animationName: 'bg_loop' });

  spine.play('bg_loop', true);
  bgObject.addComponent(img);
  bgObject.addComponent(spine);

  return bgObject;
}

只显示了image,spine动画看不见。有什么方式能解决组件的显示层级关系嘛?