Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

i am learning 3d game development on android , i was wondering is it possible to add text areas or any thing that allows a user to enter a text in a 3d world ? and how ?

share|improve this question
    
it seems may seems a bit difficult and i'm not sure if it's possible but you can try using input service of android but the text it returns to the 3d world. –  Ali.S Jun 14 '11 at 10:02
add comment

2 Answers

up vote 2 down vote accepted

Your problem have a two part answer :

1 : First you have the problem of letting the user input some text. This can be easily done using the virtual keyboard available in Android. Something like this should do the trick.

    InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
    imm.showSoftInput(v, InputMethodManager.SHOW_FORCED);

Of course if you want something with your own look and feel you can create your own input service (look here for more info http://developer.android.com/resources/articles/creating-input-method.html)

2 : Then, you need to give the user some kind of feedback, meaning write the text the user is typing in 3D. To do this, the basic idea is to create one quad per character, and map it to a texture containing your font, and place the quads in 3D where you wan't them to be.

share|improve this answer
add comment

On android, there are many ways to read strings input:

  • As gameloft, develop your own widget and code your own Virtual Keyboard; that is probably the better to way for an immersive experience
  • Or use the Android Libraries to do it.

About the second solution:

  • in your Layout, there is probably a GLSurfaceView but you can add others views. So you can use an EditText to read input. Just show or hide it when you need it.
  • otherwise you don't want use Android View because you have your own GUI. Use only the Virtual Keyboard when needed.

You can read my old tutorial with code and the phil hassey blogs about porting its game from IOS to Android.

we're talking about JNI (Java bridge with C) because our engines are C/C++ code...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.