【问题标题】:Phaser (3.24.1) How to tween a TileSprite?Phaser (3.24.1) 如何补间 TileSprite?
【发布时间】:2020-08-28 11:53:00
【问题描述】:

我想通过 tilePositionX 和 tilePositionY 补间 TileSprite。

scene.load.image('sky', 'assets/images/sky.png');
const sky = scene.add.tileSprite(0, 0, 1000, 600, 'sky');
scene.add.tween(sky); // "Uncaught TypeError: n is null"

【问题讨论】:

    标签: javascript phaser-framework tween


    【解决方案1】:

    示例12

    scene.tweens.add({
        targets: sky,
        tilePositionY: { from: 0, to: -180 },
        ease: 'Linear',
        duration: 5000,
        repeat: 0,
        yoyo: false
    });
    

    【讨论】:

    • 您应该能够将自己的答案标记为已接受的答案,仅供参考。
    猜你喜欢
    • 2015-07-26
    • 1970-01-01
    • 2021-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-22
    • 1970-01-01
    相关资源
    最近更新 更多