import { RES } from "../../../module/RES";

//只是为了魔力鸟背后的
export class MagicLionBgAni extends FYGE.Container {
    showImage: FYGE.Sprite;
    constructor() {
        super()

        //不交互
        this.mouseEnable = false;
        this.mouseChildren = false;



        var texture: FYGE.Texture = RES.getRes("magicLionBg.png")
        this.showImage = new FYGE.Sprite(texture);
        this.showImage.anchorTexture.set(0.5, 0.5);
        // this.showImage.anchorOffsetX = texture.textureWidth / 2;
        // this.showImage.anchorOffsetY = texture.textureHeight / 2;
        this.showImage.scaleX = this.showImage.scaleY = 0.7
        this.addChild(this.showImage);
        this.addEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);

        let other = new FYGE.Sprite(texture);
        other.anchorTexture.set(0.5, 0.5);
        // other.anchorOffsetX = texture.textureWidth / 2;
        // other.anchorOffsetY = texture.textureHeight / 2;
        other.scaleX = other.scaleY = 0.7
        this.addChild(other);
        this.addEventListener(FYGE.Event.ENTER_FRAME, () => {
            other.rotation -= 5;
        }, this);

        var upTexture: FYGE.Texture = RES.getRes("magicLion.png")
        let up = new FYGE.Sprite(upTexture);
        up.anchorTexture.set(0.5, 0.5);
        // up.anchorOffsetX = upTexture.textureWidth / 2;
        // up.anchorOffsetY = upTexture.textureHeight / 2;
        this.addChild(up);
        this.addEventListener(FYGE.Event.ENTER_FRAME, () => {
            up.rotation += 2;
        }, this);

    }
    private onEnterFrame() {
        this.showImage.rotation += 5;
    }
    /**
     * 重置
     */
    reset() {
        // this.showImage.scaleX = this.showImage.scaleY = 0.7;
        // this.showImage.alpha = 1;
    }
}