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

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

    1. <legend id='NgKEm'><style id='NgKEm'><dir id='NgKEm'><q id='NgKEm'></q></dir></style></legend>

        libgdx 和安卓应用程序.图像作为背景

        时间:2023-05-19
          • <tfoot id='uJVo8'></tfoot>
          • <small id='uJVo8'></small><noframes id='uJVo8'>

              <tbody id='uJVo8'></tbody>

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

              • <legend id='uJVo8'><style id='uJVo8'><dir id='uJVo8'><q id='uJVo8'></q></dir></style></legend>

                  本文介绍了libgdx 和安卓应用程序.图像作为背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我是新手,刚开始使用 libgdx.我想知道如何在我的游戏中将分辨率为 960x640 的 image.png 作为背景?这个有可能?感谢您的建议和宽容.也许你有一个简单的教程?这是我的渲染类:

                  I am new and I just start my journey with libgdx. I would like to know how I can do image.png in resolution 960x640 as background in my game? This is possible? Thx for advices and forbearance. Maybe you hava a simply tutorial? This is my render class:

                  public void render() {
                  
                       texture = new Texture(Gdx.files.internal("E:/background.png"));
                  
                       Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); 
                       batch.begin();
                       batch.draw(texture, 0, 0);
                       batch.end();
                  }
                  

                  第二个问题.我需要插入两个活动图像,活动意味着当我单击该图像时,下一个图像会显示在屏幕上.我想在点击该图片时执行操作.

                  Second question. I need to insert two active images, active means when I click on that image, the next image show me on the screen. I want to implement action when I click on that picture.

                  推荐答案

                  在你的 create() 方法中,创建一个引用你的 image.png 的新纹理,然后使用你现有的 SpriteBatch 在 render() 循环中渲染它.在您调用 GL.clear() 之后,立即执行 batch.draw(backgroundTexture, 0. 0) 并确保您的相机处于 OrthographicProjection 模式.

                  In your create() method, create a new Texture referencing your image.png, and then use your existing SpriteBatch to render it in the render() loop. Immediately after your GL.clear() call, go your batch.draw(backgroundTexture, 0. 0) and make sure you're in OrthographicProjection mode for your camera.

                  这篇关于libgdx 和安卓应用程序.图像作为背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Libgdx 和 Google 应用内购买结果 下一篇:Libgdx 第一人称相机控制

                  相关文章

                  最新文章

                  <legend id='Zr7AC'><style id='Zr7AC'><dir id='Zr7AC'><q id='Zr7AC'></q></dir></style></legend>
                  <tfoot id='Zr7AC'></tfoot>

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

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

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