老哥,看看动画:
https://jasonchen1982.github.io/jcc2d/examples/demo_animation_keyFrames2/index.html
有没有什么问题?
SHARING BY JC
const JC = require('jcc2d');
const stage = new JC.Stage({
dom: 'canvas-stage',
});
const coinImg = 'https://jasonchen1982.github.io/jcc2d/examples/demo_animation_keyFrames2/images/img_3.png';
const coin = new JC.Sprite({
texture: new JC.Texture(coinImg),
});
const timeline = coin.runners({
runners: [
{ to: { x: 100, y: 200, rotation: 0, alpha: 0 }, ease: 'elasticIn' },
{ to: { x: -210, y: 300, rotation: 360, alpha: 1 }, ease: 'linear' },
{ to: { x: 99, y: -200, rotation: 200, }, ease: 'backIn' },
{ to: { x: 70, y: 140, rotation: -30, }, ease: 'linear' },
{ to: { x: 300, y: -10, rotation: 120, }, ease: 'bounceOut' },
{ to: { x: 150, y: -102, rotation:310, }, ease: 'elasticIn' },
{ to: { x: 70, y: 80, rotation: 700, }, ease: 'backIn' },
{ to: { x: 134, y: 12, rotation: 100, }, ease: 'bounceOut' },
{ to: { x: 210, y: 155, rotation: 0, alpha: 0 }, ease: 'backOut' },
],
wait: 800,
});
stage.adds(coin);
stage.startEngine();
这几个地方我觉得要再往右调根号2个像素,旋转再加0.03个弧度,注意是弧度。
为什么呢?...
就是感觉好看一些。
我感觉这样就挺好看的啊!
我要对我的设计负责,少了这根号2个像素我唧几都说服不了我唧几个。
好吧 T_T
我可是会js的人
const data = require('./animation/data.json');
const JC = require('jcc2d');
const stage = new JC.Stage({
dom: 'canvas-stage',
});
var ani = new JC.ParserAnimation({
keyframes: data,
// fr: 30,
// infinite: true,
// alternate: true,
});
stage.adds(ani.doc);
stage.startEngine();
这个地方我觉得要再往右调 3又2分之根号3个像素,旋转再加0.03个弧度。
注意是弧度。
好啊,没问题。
随便改~~~
你调整完重新导个数据给我就可以了。
。。。
3又2分之根号3是多少个像素来着?
3 * Math.pow(3, 0.5);
0.03个弧度等于0.03 * 180 / Math.PI角度
我考虑下是不是有必要调整先。
是的,很多种的
不停的追赶行业的发展
这是一个长期的过程
除非它发展的很慢
thanks for listen