zoukankan      html  css  js  c++  java
  • 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

     7、onFrameChange

    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  对该动画销毁或隐藏操作。

     

  • 相关阅读:
    javascript中数据类型转换那些事
    CSS布局奇淫技巧之高度自适应
    用innerHTML插入html代码中有样式表时需注意的地方
    详解ASP.NET Core API 的Get和Post请求使用方式
    Speex 一个开源的声学回声消除器(Acoustic Echo Cancellation)(转)
    c# int byte转换
    Linux操作系统内核源码目录结构详解
    Linux/Ubuntu sudo不用输入密码的方法
    DirectX简介
    在VC工程中添加多语言支持
  • 原文地址:https://www.cnblogs.com/congxueda/p/9349539.html
Copyright © 2011-2022 走看看