简体   繁体   中英

How to add libgdx rendered object into current layout.xml view

How to add libgdx rendered view into current android xml layout

eg

LinearLayout>

        <com.libgdxView.obj
            android:id="@+id/sheet"
            android:layout_width="1152dp"
            android:layout_height="576dp"
            android:layout_centerInParent="true" 
            />

/LinearLayout>

Thanks.

<com.libgdxView.obj.**YourClassName**
        android:id="@+id/sheet"
        android:layout_width="1152dp"
        android:layout_height="576dp"
        android:layout_centerInParent="true" 
        />

try this

Finally got the solution...

// Create the layout RelativeLayout layout = new RelativeLayout(this);

    // Do the stuff that initialize() would do for you
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

    // Create the libgdx View
    View gameView = initializeForView(new YouSpinMeRound(), false);
    // Add the libgdx view
    layout.addView(gameView);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM