Using LibGdx without AndroidApplication?

ε祈祈猫儿з 提交于 2019-12-24 10:59:28

问题


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.

As I need to view 3D models in a RecyclerView.ViewHolder within a RecyclerView.Adapter

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

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

Any idea?


回答1:


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);


来源:https://stackoverflow.com/questions/52261140/using-libgdx-without-androidapplication

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!