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

     

  • 相关阅读:
    【服务器】【Windows】【3】开放服务器端口
    【服务器】【Windows】【2】把jar包做成服务,在Service中管理
    FZU 1753
    poj 1017
    poj 1666
    poj 1132
    ZOJ 2562 More Divisors
    POJ 2992 Divisors
    poj 2773 happy 2006
    poj 2407 Relatives
  • 原文地址:https://www.cnblogs.com/congxueda/p/9349539.html
Copyright © 2011-2022 走看看