小编MAG*_*S94的帖子

更新Gradle(Android Studio 3.0)后,LibGdx无法正常工作

我最近更新了android studio和gradle到版本3.0.0,按照此链接中的说明https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html

执行此操作后,libgdx桌面项目不起作用.

它给了我这个错误

java.lang.NoClassDefFoundError: com/badlogic/gdx/ApplicationListener
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.badlogic.gdx.ApplicationListener
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 7 more
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
Run Code Online (Sandbox Code Playgroud)

这是build.gradle文件

buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
    }
Run Code Online (Sandbox Code Playgroud)

我只添加google()到存储库并编辑gradle版本3.0.0

gradle-wrapper.properties …

android gradle libgdx android-studio

5
推荐指数
1
解决办法
5712
查看次数

libgdx 中的淡出动作

我正在尝试为舞台中的所有演员设置动画,但淡出动作不起作用,尽管其他动作工作正常

我有以下代码

getRoot().setPosition(Gdx.graphics.getWidth(), 0);
getRoot().getColor().a = 0;
SequenceAction sequenceAction = new SequenceAction();
sequenceAction.addAction(Actions.moveTo(0, 0, 3.0f));
sequenceAction.addAction(Actions.fadeOut(3.0f));
getRoot().addAction(sequenceAction);
Run Code Online (Sandbox Code Playgroud)

我还尝试了另一种通过 TweenEngine 为它们设置动画的方法,class GroupAccessor implements TweenAccessor<Group>除了操作 alpha 值外,所有工作都很好

public class GroupAccessor implements TweenAccessor<Group> {

    public static final int ALPHA = 0;
    public static final int POS_XY = 1;

    @Override
    public int getValues(Group target, int tweenType, float[] returnValues) {
        switch (tweenType) {
            case ALPHA :
                returnValues[0] = target.getColor().a;
                return 1;
            case POS_XY :
                returnValues[0] = target.getX();
                returnValues[1] = target.getY();
                return 2;
            default: …
Run Code Online (Sandbox Code Playgroud)

android tween libgdx scene2d

0
推荐指数
1
解决办法
837
查看次数

Jupyter Notebook没有显示新环境

我在Windows上安装了anaconda python 2.7,最近我为python 3.5创建了一个新环境(使用conda create -n py35 python=3.5)。

当我activate py35运行时jupyter notebook,它不会显示py35环境。它只有python根(py27)。

如何通过jupyter使用此环境?

python python-2.7 python-3.x anaconda jupyter-notebook

0
推荐指数
2
解决办法
1599
查看次数