【问题标题】:Can't scroll Background无法滚动背景
【发布时间】:2013-12-02 02:48:02
【问题描述】:

谁能告诉我如何制作动态壁纸滚动的背景?自 Android 4.1 更新以来,手机中的默认启动器不会滚动。但是,某些第三方启动器会滚动背景。关于我的动态壁纸;我添加了onOffsetchanged,但背景不滚动。谁能帮帮我?

这里是代码

final AutoParallaxBackground background = new AutoParallaxBackground(0, 0, 0, 5);
background.attachParallaxEntity(new ParallaxEntity(0f, new Sprite(0, 0, backgroundRegion, this.getVertexBufferObjectManager())));
    mScene.setBackground(background);

【问题讨论】:

    标签: android background scroll andengine live-wallpaper


    【解决方案1】:

    通过添加以下行来检查

    auto_background.setParallaxChangePerSecond(5.0f);
    

    【讨论】:

      【解决方案2】:
      new ParallaxEntity(5f or -5f, new Sprite(0, 0, backgroundRegion, this.getVertexBufferObjectManager()));
      

      ParallaxEntity的第一个参数必须大于0才能向右移动,负值向左移动

      【讨论】:

      • 感谢您的回答。但问题是当我在背景上添加前云的项目时,云不会移动
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-30
      • 2017-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-15
      相关资源
      最近更新 更多