@along94/visual-engine

可视化引擎

Usage no npm install needed!

<script type="module">
  import along94VisualEngine from 'https://cdn.skypack.dev/@along94/visual-engine';
</script>

README

可视化引擎

目录接构

lib

core 核心代码
stage 舞台业务组件类
utils 辅助函数

example

const src = [{
  id: 'base',
   src: 'images/base.png'
}]
const visual = new Visual('app')
visual.loadSrc(src).then(res => {
  if(res) {
    const options = {
      id: '123',
      name: '赵公子',
      hp: 100,
      rotation: 0,
      size: 20,
      texture: visual.getBitmapById('base') ,
      visualDistance: 40,
      visualAngle: 124,
      visualRotation: -62,
      color: 'rgb(255,0,0)',
      position: {
        x: 300,
        y: 300
      }
    }  
    visual.characterFactory(options)
  }
})