PIXI AnimatedSprite 及打字爆炸动画(5)
效果 : 消除字母 当前位置出现爆炸效果 这里使用到了AnimatedSprite 动画
Members
An AnimatedSprite is a simple way to display an animation depicted by a list of textures.
let alienImages = ["image_sequence_01.png","image_sequence_02.png","image_sequence_03.png","image_sequence_04.png"];
let textureArray = []; for (let i=0; i < 4; i++)
{
let texture = PIXI.Texture.fromImage(alienImages[i]);
textureArray.push(texture);
}; let mc = new PIXI.AnimatedSprite(textureArray);
mc 对象加载了图片序列。
1、alpha
图片透明度(0 - 1)
2、anchor
The anchor sets the origin point of the texture. The default is 0,0 this means the texture's origin is the top left Setting the anchor to 0.5,0.5 means the texture's origin is centered Setting the anchor to 1,1 would mean the texture's origin point will be the bottom right corner
3、animationSpeed
默认值:1
4、buttonMode
If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive Setting this changes the 'cursor' property to 'pointer'.
const sprite = new PIXI.Sprite(texture);
sprite.interactive = true;
sprite.buttonMode = true;
5、loop
Whether or not the animate sprite repeats after playing.
- Default Value: true
6、onComplete 函数
Function to call when a AnimatedSprite finishes playing
Function to call when a AnimatedSprite changes which texture is being rendered
8、destroy
Stops the AnimatedSprite and destroys it
9、gotoAndPlay
Goes to a specific frame and begins playing the AnimatedSprite
10、gotoAndStop
Stops the AnimatedSprite and goes to a specific frame
11、play
Plays the AnimatedSprite
12、stop
Stops the AnimatedSprite
----------------------------------------------示例介绍-------------------------------------------------
1、字母下落获取坐标位置
2、字母消除位置,指定爆炸动画,执行完成调用 onComplete 对该动画销毁或隐藏操作。
PIXI AnimatedSprite 及打字爆炸动画(5)的更多相关文章
- 基于HTML5 SVG炫酷文字爆炸特效
这是一款使用html5 svg.css3和js制作的炫酷文字爆炸特效.该文字特效用SVG path属性将文字路径切割为很多小块,然后使用css3和js在鼠标滑过文字时制作文字爆炸分裂的炫酷效果. 在线 ...
- [一位菜鸟的COCOS-2D编程之路]打飞机中机种敌机和战机损毁时的爆炸效果
1.第一步,添加爆炸动画 //添加玩家飞机飞行动画 id _playerFlyAction; id _playerBlowupAnimation; //战机爆炸动画 id _enemyBlowupAn ...
- Android制作粒子爆炸特效
简介 最近在闲逛的时候,发现了一款粒子爆炸特效的控件,觉得比较有意思,效果也不错. 但是代码不好扩展,也就是说如果要提供不同的爆炸效果,需要修改的地方比较多.于是我对源代码进行了一些重构,将爆炸流程和 ...
- 11个超震撼的HTML5和纯CSS3动画源码
1.jQuery多功能手风琴个人信息菜单面板 这是一款基于jQuery的手风琴个人信息菜单面板,每一个菜单项展开后可以自定义布局,因此可以为每一个菜单项实现多功能.类似这样的多功能菜单还有jQuery ...
- 10款基于jquery的web前端动画特效
1.jQuery横向手风琴图片切换动画 之前我们为大家分享过很多款基于jQuery和CSS3的手风琴菜单和手风琴焦点图插件,比如CSS3响应式垂直手风琴菜单和jQuery横向手风琴图片展示插件.今天要 ...
- 16个富有创意的HTML5 Canvas动画特效集合
HTML5技术正在不断的发展和更新,越来越多的开发者也正在加入HTML5阵营,甚至在移动开发上HTML5的地位也是越来越重要了.HTML5中的大部分动画都是通过Canvas实现,因为Canvas就像一 ...
- 16个非常有趣的HTML5 Canvas动画特效集合
HTML5技术正在不断的发展和更新,越来越多的开发者也正在加入HTML5阵营,甚至在移动开发上HTML5的地位也是越来越重要了.HTML5中的大部分动画都是通过Canvas实现,因为Canvas就像一 ...
- 游戏编程算法与技巧 Game Programming Algorithms and Techniques (Sanjay Madhav 著)
http://gamealgorithms.net 第1章 游戏编程概述 (已看) 第2章 2D图形 (已看) 第3章 游戏中的线性代数 (已看) 第4章 3D图形 (已看) 第5章 游戏输入 (已看 ...
- 太阳系Demo(openGL)
这个是8年前写的demo,提交的一份作业,按照提出的需求点,以最快和最简单的方式完成功能,因此代码比较简单. 1)截图 2) 功能点描述: 1.公转,自传 2.基础的摄像机运动 3.正视和顶视 4.天 ...
随机推荐
- http请求和返回的head字段
一,http请求分请求首部字段,通用首部字段,实体首部字段.http响应包含响应首部字段,通用首部字段,实体首部字段. 二,http1.1定义了47种首部字段.1,通用首部字段:cache-contr ...
- ApplicationContex是干啥的
ApplicationContext就是一个百宝箱 ApplicationContext是Spring的核心,Context我们通常解释为上下文环境,我想用“容器”来表述它更容易理解一些,Applic ...
- MongoDB整理笔记の进程控制
查看活动进程 > db.currentOp(); > // 等同于: db.$cmd.sys.inprog.findOne() { inprog: [ { "opid" ...
- C# worksheet设置Excel样式
1.例子导出Excel的样式 样式代码 public void Exportdatagridviewtoexcel(string Textname) { SaveFileDialog savedial ...
- ping包,支持ip录入
@echo off ::等待用户输入需要监控IP set /p ip=Input the IP required to monitor: echo executing...... :start ech ...
- FTP文件上传以及获取ftp配置帮助类
帮助类: using QSProjectBase; using Reform.CommonLib; using System; using System.Collections.Generic; us ...
- .NET和C#的版本历史
维基百科页面:https://en.wikipedia.org/wiki/.NET_Framework_version_history Versionnumber CLRversion Release ...
- 复杂业务下向Mysql导入30万条数据代码优化的踩坑记录
从毕业到现在第一次接触到超过30万条数据导入MySQL的场景(有点low),就是在顺丰公司接入我司EMM产品时需要将AD中的员工数据导入MySQL中,因此楼主负责的模块connector就派上了用场. ...
- 最新cenos执行service httpd restart 报错Failed to restart httpd.service: Unit not found.
原来是需要将Apache注册到Linux服务里面啊!注册Apache到Linux服务在Linux下用源代码方式编译安装完Apache后,启动关闭Apache可以通过如下命令实现: /usr/local ...
- SpringMVC中静态文件的引用
1.在WebRoot目录下创建 resources文件,里面可以放入css文件 2.在SpringMVC中的配置文件dispatcherServlet-servlet.xml中加入 <!-- 将 ...