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.天 ...
随机推荐
- Responsive设计——meta标签
media-queries.js(http://code.google.com/p/css3-mediaqueries-js/) respond.js(https://github.com/scott ...
- Android学习笔记 Toast屏幕提示组件的使用方法
activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android&qu ...
- 重拾C,一天一点点_7
标准库,atof()函数包含在头文件<stdlib.h>中 /******把字符串s转换为相应的双精度浮点数*******/ #include <stdio.h> #inclu ...
- 「BZOJ 5188」「Usaco2018 Jan」MooTube
题目链接 luogu bzoj \(Describe\) 有一个\(n\)个节点的树,边有权值,定义两个节点之间的距离为两点之间的路径上的最小边权 给你\(Q\)个询问,问你与点\(v\)的距离大于等 ...
- day7学python 初识简单模板
初识简单模板 模块与包 1.模块:用来从逻辑上组织python代码(变量,函数,类,逻辑:实现功能),本质是.py结尾的文件 但导入的模块名,无.py 2.包:从逻辑上组织模块,本质就是目录(含有_i ...
- Spring AOP的实现机制
AOP(Aspect Orient Programming),一般称为面向切面编程,作为面向对象的一种补充,用于处理系统中分布于各个模块的横切关注点,比如事务管理,日志,缓存等等.AOP 实现的关键在 ...
- 【转】C#、面向对象、设计模式学习
源地址:http://www.cnblogs.com/cj723/archive/2007/04/02/697431.html
- win10+anaconda环境下pyqt5+qt tools+eric6.18安装及汉化过程
最近需要用python编写一个小程序的界面,选择了pyqt5+eric6的配套组合,安装过程中遇到一些坑,特此记录.参考书籍是电子工业出版社的<PyQt5快速开发与实战>. 因为我使用an ...
- BI中的报表业务功能授权使用"自定义主题"
- NAND NOR Flash 和MTD
来自:http://blog.sina.com.cn/s/blog_6b489d5e0102xm62.html 一.NAND和NOR Flash 一般来说,快闪记忆体可分为两大规格,一个是NAND, ...