AndEngine icon indicating copy to clipboard operation
AndEngine copied to clipboard

the problem of combination andengine and android-view

Open blissoft opened this issue 13 years ago • 5 comments

hi~ I'm the android -2d-game developer lived in Korea.

I have troble making game with andengine. And the game root-activity is LayoutGameActivity.

in MainActivity.java

@Override public void onClick(ButtonSprite pButtonSprite, float pTouchAreaLocalX, float pTouchAreaLocalY) { // TODO Auto-generated method stub

if(pButtonSprite.equals(btn)) { this.runOnUiThread(new Runnable(){

@Override public void run() { // TODO Auto-generated method stub EditText edit_text=(EditText)findViewById(R.id.edit_text); edit_text.setVisibility(View.VISIBLE); }

});

} }

in main.xml

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">

<org.andengine.opengl.view.RenderSurfaceView android:id="@+id/xmllayoutexample_rendersurfaceview" android:layout_width="fill_parent" android:layout_height="fill_parent"/>

<EditText android:id="@+id/edit_text" android:layout_width="fill_parent" android:gravity="bottom" android:layout_gravity="bottom" android:visibility="invisible" android:layout_height="wrap_content"/>

</FrameLayout>

and as you know, I added the 'EditText' in main.xml .And in game, I want to EditText to visible.

But the edittext is not visible.Though the virtual-keyboard pop-up, the edittext is not visible.

And I attach the video of this problem.

www.youtube.com/watch?v=gj8FmEUBvaY

blissoft avatar Jun 25 '12 05:06 blissoft

The problem is with your XML Layout.

See my post for the XML. To solve the wrapping (where its shifting everything up on the click)

http://www.andengine.org/forums/features/fragmentactivty-and-fixedstepmaxfpsengine-t8168.html

For the edit text change android:visibility="invisible" to android:visibility="visible"

Niffy avatar Jun 28 '12 12:06 Niffy

I do not think that invisible editbox problem is because of "android:visibility="invisible" as you comment.

I make editbox visible on "public void onClick()" that you can see code I write down on my post.

Thanks for your comment. However, I am using gles2 which does not support fragment things.

If you check movie what I linked, I related with little bit covered with keyboard which not visible things.

Cheers

blissoft avatar Jun 28 '12 12:06 blissoft

Fragments are supported in my branch (it gles 2) checkout my github bio or the link. In the link is some xml, that should help. Give the xml a try.

Niffy avatar Jun 28 '12 13:06 Niffy

ok..

Could you show me the simple-example?

thanks.

blissoft avatar Jul 04 '12 08:07 blissoft

@Niffy I can't seem to find the Fragment support in your repository or this one. AFAIK, it was available in 2011 in the "Fragment" branch on Google Code, but appears to be deleted on Github:

https://code.google.com/p/andengine/source/browse/src/org/anddev/andengine/ui/fragment/compat/BaseGameFragment.java?r=0d0d2bcda2941e5b6bf6b56a42dffbc4693fb96e

mkonecny avatar Jun 30 '15 01:06 mkonecny