Skip to content

karasjs/karas-mars

Repository files navigation

karas-mars

Mars component for karas.


karas接入@alipay/mars组件。

NPM version

Install

tnpm install karas
tnpm install karas-mars

仅限蚂蚁内网使用。

Usage

import Mars from 'karas-mars';

karas.render(
  <canvas width="720" height="720">
    <Mars style={{
            position: 'absolute',
            left: '50%',
            top: '50%',
            width: 200,
            height: 200,
            translateX: '-50%',
            translateY: '-50%',
          }}
          url={'https://gw.alipayobjects.com/os/gltf-asset/mars-cli/ELCOQKVUKUIO/-994158386-08237.json'}
          playbackRate={1} // 播放速率
          autoPlay={true} // 自动播放
    />
  </canvas>
);

method

  • pause() 暂停
  • resume() 恢复
  • play() 从头播放

get/set

  • playbackRate 播放速率,默认1

event

License

[MIT License]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published