<bdo id='ZK6ae'></bdo><ul id='ZK6ae'></ul>
<i id='ZK6ae'><tr id='ZK6ae'><dt id='ZK6ae'><q id='ZK6ae'><span id='ZK6ae'><b id='ZK6ae'><form id='ZK6ae'><ins id='ZK6ae'></ins><ul id='ZK6ae'></ul><sub id='ZK6ae'></sub></form><legend id='ZK6ae'></legend><bdo id='ZK6ae'><pre id='ZK6ae'><center id='ZK6ae'></center></pre></bdo></b><th id='ZK6ae'></th></span></q></dt></tr></i><div id='ZK6ae'><tfoot id='ZK6ae'></tfoot><dl id='ZK6ae'><fieldset id='ZK6ae'></fieldset></dl></div>

<legend id='ZK6ae'><style id='ZK6ae'><dir id='ZK6ae'><q id='ZK6ae'></q></dir></style></legend>

<small id='ZK6ae'></small><noframes id='ZK6ae'>

<tfoot id='ZK6ae'></tfoot>

      1. 如何在 libgdx scene2d 上拖放演员?

        时间:2023-05-18
        <i id='E0AeI'><tr id='E0AeI'><dt id='E0AeI'><q id='E0AeI'><span id='E0AeI'><b id='E0AeI'><form id='E0AeI'><ins id='E0AeI'></ins><ul id='E0AeI'></ul><sub id='E0AeI'></sub></form><legend id='E0AeI'></legend><bdo id='E0AeI'><pre id='E0AeI'><center id='E0AeI'></center></pre></bdo></b><th id='E0AeI'></th></span></q></dt></tr></i><div id='E0AeI'><tfoot id='E0AeI'></tfoot><dl id='E0AeI'><fieldset id='E0AeI'></fieldset></dl></div>
        <legend id='E0AeI'><style id='E0AeI'><dir id='E0AeI'><q id='E0AeI'></q></dir></style></legend>

            <tbody id='E0AeI'></tbody>
            1. <tfoot id='E0AeI'></tfoot>

              <small id='E0AeI'></small><noframes id='E0AeI'>

                <bdo id='E0AeI'></bdo><ul id='E0AeI'></ul>
                • 本文介绍了如何在 libgdx scene2d 上拖放演员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在使用 libGDX 开发游戏,我想知道如何拖放 Actor.我已经搭建好舞台并画好了演员,但我不知道如何触发该事件.

                  I'm developing a game using libGDX and I would like to know how I can drag and drop an Actor. I've made my stage and drawn the actor, but I don't know how to trigger that event.

                  请尝试帮助我使用我自己的架构.

                  Please try to help me using my own architecture.

                  public class MyGame implements ApplicationListener 
                  {
                      Stage stage;
                      Texture texture;
                      Image actor;
                  
                      @Override
                      public void create() 
                      {       
                          texture = new Texture(Gdx.files.internal("actor.png"));
                          Gdx.input.setInputProcessor(stage);
                          stage = new Stage(512f,512f,true);
                  
                          actor = new Image(texture);
                          stage.addActor(actor);
                      }
                  
                      @Override
                      public void render() 
                      {       
                          Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
                          stage.draw();
                      }
                  }
                  

                  推荐答案

                  看看 libgdx 示例中的示例.这是来自 libgdx 测试类的拖放测试:DragAndDropTest

                  Take a look at the Example in the libgdx examples. Here is the drag and drop test from the libgdx test classes: DragAndDropTest

                  如果您只想拖动/滑动您的 Actor,您需要向其添加一个 GestureListener 并将您的 Stage 传递给 Inputprocessor,如下所示:Gdx.input.setInputProcessor(stage);.这是 来自 libgdx 的 GestureDetectorTest.对于拖动事件,它是 Flinglistener.

                  If you just want to drag/slide your Actor around you need to add a GestureListener to it and pass your Stage to the Inputprocessor like this:Gdx.input.setInputProcessor(stage);. Here is the GestureDetectorTest from libgdx. For drag events its the Flinglistener.

                  这篇关于如何在 libgdx scene2d 上拖放演员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:粒子系统 libGDX 下一篇:语义分析期间的一般错误:不支持的类文件主要版

                  相关文章

                  最新文章

                  1. <small id='sc70f'></small><noframes id='sc70f'>

                    1. <tfoot id='sc70f'></tfoot>

                      <legend id='sc70f'><style id='sc70f'><dir id='sc70f'><q id='sc70f'></q></dir></style></legend>
                      <i id='sc70f'><tr id='sc70f'><dt id='sc70f'><q id='sc70f'><span id='sc70f'><b id='sc70f'><form id='sc70f'><ins id='sc70f'></ins><ul id='sc70f'></ul><sub id='sc70f'></sub></form><legend id='sc70f'></legend><bdo id='sc70f'><pre id='sc70f'><center id='sc70f'></center></pre></bdo></b><th id='sc70f'></th></span></q></dt></tr></i><div id='sc70f'><tfoot id='sc70f'></tfoot><dl id='sc70f'><fieldset id='sc70f'></fieldset></dl></div>

                        <bdo id='sc70f'></bdo><ul id='sc70f'></ul>