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

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

        将 libgdx 添​​加到 Android 原生应用程序

        时间:2023-05-20
          <bdo id='QboOQ'></bdo><ul id='QboOQ'></ul>

          <legend id='QboOQ'><style id='QboOQ'><dir id='QboOQ'><q id='QboOQ'></q></dir></style></legend>
            <tbody id='QboOQ'></tbody>

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

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

                2. <tfoot id='QboOQ'></tfoot>
                  本文介绍了将 libgdx 添​​加到 Android 原生应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我有一个简单的儿童应用程序,可以教授颜色、数字等内容,我目前正在开发中.它使用我认为的标准 android java 编程(单 Xml/java 类)".我还有一个简单的恐龙游戏,它使用 libgdx 跳过字母.

                  I have a simple kids app which teaches things such as colors, numbers, etc... which I am currently developing. It uses what I would consider "standard android java programming (Single Xml/java class)." I also have a simple game with a Dinosaur that jumps over letters using libgdx.

                  我的问题是,我希望将游戏作为整体"应用的一部分.我想知道是否可以将 libgdx 游戏添加到 android 本机应用程序中.我尝试将适当的文件添加到我的应用程序中,但这会导致编译错误,有人可以指出我可以在此问题上找到帮助的地方,或者让我知道我想要做的事情是否可能?谢谢.

                  My question is, I would like to have the game as part of the "overall" app. I would like to know if it is even possible to add a libgdx game to an android native application. I tried adding the appropriate files to my app, but this caused a compile error, could someone point me to a place where I could find help on this issue, or perhaps let me know if what I am wanting to do is even possible? Thanks.

                  ---澄清一下,我的主应用程序有一个菜单,可以带您进行活动.我希望 libgdx 游戏成为其中一项活动.

                  ---To clairify, my main app has a menu which takes you to activities. I would like the libgdx game to be one of the activities.

                  ---编辑响应---我使用 Gradle 进行编译并且出现的错误多得我数不清.我已经从应用程序中删除了 libgdx 游戏,所以我不确定具体的错误,但 iirc 有超过 100 个,其中许多是 R 问题,我本可以弄清楚,但我在任何一个上都找不到任何东西所以或者网络上说甚至可以将 libgdx 添​​加到非 libgdx 应用程序中.

                  ---Edit to response---I compile using Gradle and have more errors than I can count. I've since removed the libgdx game from the app so I am not sure of specific errors, but iirc there were over 100, many of which were R issues, which I could have figured out, but I couldn't find anything on either S.O. or the web saying it was even possible to add libgdx to a non-libgdx app.

                  推荐答案

                  您可以将您的应用程序与您的 libgdx 游戏集成.
                  AndroidLauncher.java 是您的 libgdx Activity,您可以使用 Intent 从一个 Activity 移动到另一个.

                  You can integrate your App with your libgdx game.
                  AndroidLauncher.java is your libgdx Activity and you can move from one activity to another using Intent.

                  intent = new Intent(this, AndroidLauncher.class);
                  startActivity(intent);
                  

                  并从 libgdx AndroidLauncher.java 移动,您需要从核心项目类中调用它.您需要使用接口.

                  and movement from libgdx AndroidLauncher.java, you need to call it from inside the core project classes. You need to use an interface.

                  https://github.com/libgdx/libgdx/wiki/Interfacing-with-platform-specific-code

                  如果您的游戏是您的应用程序的子视图.
                  AndroidApplication 类(它扩展了活动)有一个名为 initializeForView(ApplicationListener, AndroidApplicationConfiguration) 的方法,该方法将返回一个您可以添加到的视图你的布局.

                  If your game is sub view of your App.
                  The AndroidApplication class (which extends activity) has a method named initializeForView(ApplicationListener, AndroidApplicationConfiguration) that will return a View you can add to your layout.

                  优点-您已经拥有代码,只需要集成即可.
                  缺点-您需要维护 OpenGL Context Loss.Libgdx 为你做的.

                  Pros.-Code is already you have,only you need to integrate.
                  Cons.-you need to maintain OpenGL Context Loss. Libgdx do for you.

                  这篇关于将 libgdx 添​​加到 Android 原生应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 LibGdx 中缩放标签 下一篇:box2d中不正确的碰撞

                  相关文章

                  最新文章

                  • <bdo id='A5Gg5'></bdo><ul id='A5Gg5'></ul>

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

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

                      <tfoot id='A5Gg5'></tfoot>
                    1. <small id='A5Gg5'></small><noframes id='A5Gg5'>