在没有AndroidApplication的情况下使用LibGdx?

编程入门 行业动态 更新时间:2024-10-27 22:19:21
本文介绍了在没有AndroidApplication的情况下使用LibGdx?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的项目中,我只对LibGDX的特定部分感兴趣,即查看3D模型并对其进行动画处理,不需要任何输入或其他功能.

In my project, I am interested only in a particular part of LibGDX, that is viewing 3D model and animating it, no inputs or other functionality is needed.

我需要在RecyclerView.Adapter

经过搜索,我发现需要在AndroidGraphics类中获取view,例如:GLSurfaceView

As I have searched, I found that I need to get the view at AndroidGraphics class, ex: GLSurfaceView

但是,我不知道如何在没有AndroidApplication的情况下进行初始化,这有可能吗?

However, I have no idea how to do the initialization without AndroidApplication, would this be possible?

有什么主意吗?

推荐答案

您可以在android中创建libgdx视图并将其添加到布局中.方法如下:

You can create a libgdx view in android and add it to your layout. Here's how:

AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); View gameView = initializeForView(new Game(this), config); // Game is your libgdx Mainclass layout = new RelativeLayout(this); // or your custom layout layout.addView(gameView); setContentView(layout);

更多推荐

在没有AndroidApplication的情况下使用LibGdx?

本文发布于:2023-11-16 21:23:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1607516.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:情况下   AndroidApplication   LibGdx

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!