问题
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