小编Lok*_*are的帖子

LibGDX有一个动画的演员吗?

在LibGDX中是否存在动画的动画(采用动画),当添加到舞台动画时,或者您是否必须自己实现自己的Image类并为其设置动画?

java libgdx

11
推荐指数
2
解决办法
8412
查看次数

你如何在libgdx阶段对Actors进行排序?

我在LibGdx Stage对象中排序Actors时遇到问题.舞台渲染后,图像按照添加顺序渲染.Stage使用Array来保存Actors.我已经尝试设置每个Actor的ZIndex,但它仍然没有排序.然后我尝试创建一个像这样的比较器对象:

public class ActorComparator implements Comparator < Actor > {
    @Override
    public int compare(Actor arg0, Actor arg1) {
        if (arg0.getZIndex() < arg1.getZIndex()) {
            return -1;
        } else if (arg0.getZIndex() == arg1.getZIndex()) {
            return 0;
        } else {
            return 1;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

然后当我想做我做的实际比较时:

Collections.sort(Stage.getActors(), new ActorComparator());
Run Code Online (Sandbox Code Playgroud)

它给我以下错误,不会编译:

The method sort(List<T>, Comparator<? super T>) in the type Collections 
is not applicable for the arguments (Array<Actor>, ActorComparator)
Run Code Online (Sandbox Code Playgroud)

我不知道我做错了什么.谁可以给我解释一下这个?

java libgdx

8
推荐指数
2
解决办法
9732
查看次数

您如何将 Dropzone.js 与分块文件上传一起使用(仅限 PHP)?

我可以找到大量关于如何使用带有各种 API 和库的分块文件上传的文档,但我无法找到如何仅通过普通 PHP 使用 Dropzone.js 分块文件上传。

文档非常少。我无法在客户端 (JavaScript) 添加除 jQuery 之外的任何库或 API。

我的问题是如何仅在服务器端使用 Dropzone.js 新的分块文件上传功能与 PHP。(客户端代码被赞赏用于设置)。

这是我到目前为止尝试过的代码:客户端 .js 文件:

    var myDropzone = new Dropzone("div#formDiv", 
    {
        url: "uploadform.php",
        params: function (files, xhr, chunk)
        {
            if (chunk)
            {
                return
                {
                    dzUuid=chunk.file.upload.uuid,
                    dzChunkIndex=chunk.index,
                    dzTotalFileSize=chunk.file.size,
                    dzCurrentChunkSize=chunk.dataBlock.data.size,
                    dzTotalChunkCount=chunk.file.upload.totalChunkCount,
                    dzChunkByteOffset=chunk.index * this.options.chunkSize,
                    dzChunkSize=this.options.chunkSize,
                    dzFilename=chunk.file.name;
                };
            }
        },
        method: "post",
        timeout: 600000,
        maxFileSize: 1024,
        parallelUploads: 1,
        chunking: true,
        forceChunking: true,
        chunkSize: 1000000,
        parallelChunkUploads: true,
        retryChunks: true,
        retryChunksLimit: 3,
        chunksUploaded: function (file, done)
        {
            // All chunks …
Run Code Online (Sandbox Code Playgroud)

javascript php jquery dropzone.js dropzone

6
推荐指数
1
解决办法
5630
查看次数

是否存在类似于红宝石的lua中的别名

您能否以类似于Ruby的方式为LUA中的函数(不在类中)设置别名?在ruby中你会做这样的事情:

alias new_name_for_method method()
def method()
  new_name_for_method() # Call original method then do custom code
  i = 12 # New code
end
Run Code Online (Sandbox Code Playgroud)

我问,因为我正在开发一个使用LUA脚本的程序,我需要覆盖在默认文件中声明的函数.

lua

2
推荐指数
1
解决办法
1610
查看次数

标签 统计

java ×2

libgdx ×2

dropzone ×1

dropzone.js ×1

javascript ×1

jquery ×1

lua ×1

php ×1