LyaAir引擎(JavaScript)实现图片的翻转一半

图片4.png位于bin/开场过渡 文件夹下,图片大小150*30(根据实际情况做调整)

var button;
var scale1 = 1; button = new laya.display.Sprite()
button.pos(100,100);
button.pivot(75,15);
button.loadImage("开场过渡/4.png");
Laya.stage.addChild(button); //实现图片X轴翻转一半
Laya.timer.frameLoop(1,this,animateX);
//实现图片Y轴翻转一半
//Laya.timer.frameLoop(1,this,animateY); function animateX() { if ( (scale1 - 0.02) < -0.04) {
Laya.timer.clear(this,animateX);
}else{
button.scale(scale1,1);
scale1 -= 0.02;
}
} function animateY() { if ( (scale1 - 0.02) < -0.04) {
Laya.timer.clear(this,animateY);
}else{
button.scale(1,scale1);
scale1 -= 0.02;
}
}

最新文章

  1. Java中Sting类型对象内容不可改变
  2. 2. Transcribing DNA into RNA
  3. iOS block 声明时和定义时的不同格式
  4. c++ static及const(开发者在线)
  5. JS函数创建的具体过程
  6. 求和问题总结(leetcode 2Sum, 3Sum, 4Sum, K Sum)
  7. javascript 面向对象技术
  8. android中画文字的换行 办法(对于遇到canvas.drawText(String s )无法实现换行问题的解决)
  9. node.js入门(二) 第一个程序 Hello World
  10. 【科研论文】基于文件解析的飞行器模拟系统软件设计(应用W5300)
  11. ionic2 tabs使用自定义图标
  12. 【SpringMVC】XML配置说明
  13. HDU 1068 Girls and Boys(模板——二分图最大匹配)
  14. Vue第一个自定义组件:数字输入框(number-input)
  15. txn.go
  16. 使用react全家桶制作博客后台管理系统
  17. Google Protocol Buffer项目无法加载解决方案
  18. ISCC:Please give me username and password!
  19. NoSQL&amp;Redis
  20. windows下vc编译和debug nginx

热门文章

  1. 学习iOS
  2. git clone error: RPC failed; result=22, HTTP code = 502
  3. Spring AOP基本概念
  4. 转 : Hibernate懒加载深入分析
  5. IE下new Date不支持传参数的解决
  6. mongo virtual
  7. 关于ZendFramework环境的配置
  8. Easy51RTOS入门级初略分析
  9. php序列化和反序列化
  10. Wen前端性能优化