-
Notifications
You must be signed in to change notification settings - Fork 0
Simple text input
If an application needs to ask the user for a string, e.g a user name or a password, it can do so by using a simple dialog box that is customizable to some extent.
On the desktop a Swing dialog will be opened, prompting the user to enter a string.
On Android a standard Android dialog will be opened, again prompting the user for input.
To receive the input or a notification that the user canceled the input, one has to implement the TextInputListener
interface:
public class MyTextInputListener implements TextInputListener {
@Override
public void input (String text) {
}
@Override
public void canceled () {
}
}
The input()
method will be called when the user enters a text string. The canceled()
method will be called if the user closed the dialog on the desktop or pressed the back button on Android.
To bring up the dialog, simple invoke the following method with your listener:
MyTextInputListener listener = new MyTextInputListener();
Gdx.input.getTextInput(listener, "Dialog Title", "Initial Textfield Value");
The methods of the listener will be called on the rendering thread, right before the ApplicationListener.render()
method is called.
- Wiki Style Guide
-
Developer's Guide
- Introduction
- Setting up your Development Environment (Eclipse, Android Studio, Intellij IDEA, NetBeans)
- Creating, Running, Debugging and Packaging Your Project
- Working From Source
- The Application Framework
- A Simple Game
- File Handling
- Networking
- Preferences
- Input Handling
- Memory Management
- Audio
-
Graphics
- Querying & configuring graphics (monitors, display modes, vsync)
- Continuous & Non-Continuous Rendering
- Clearing the Screen
- Taking a Screenshot
- Profiling
- Viewports
- OpenGL ES Support * Configuration & Querying OpenGL ?? * Direct Access ?? * Utility Classes * Rendering Shapes * Textures & TextureRegions * Meshes * Shaders * Frame Buffer Objects
- 2D Graphics * SpriteBatch, TextureRegions, and Sprites * 2D Animation * Clipping, With the Use of ScissorStack * Orthographic Camera * Mapping Touch Coordinates ?? * NinePatches * Bitmap Fonts * Distance Field Fonts * Color Markup Language * Using TextureAtlases * Pixmaps * Packing Atlases Offline * Packing Atlases at Runtime * Texture Compression * 2D ParticleEffects * Tile Maps * scene2d * scene2d.ui * Table * Skin
- 3D Graphics * Quick Start * Models * Material and Environment * ModelBatch * ModelCache * ModelBuilder, MeshBuilder and MeshPartBuilder * 3D Animations and Skinning * Importing Blender Models in libGDX * 3D Particle Effects * Perspective Camera ?? * Picking ??
- Managing Your Assets
- Internationalization and Localization
- Utilities
-
Math Utilities
- Interpolation
- Vectors, Matrices, Quaternions
- Circles, Planes, Rays, etc.
- Path Interface & Splines
- Bounding Volumes ??
- Intersection & Overlap Testing ??
- Tools
- Extensions
- Artificial Intelligence
- gdx-freetype
- gdx-pay: cross-platform In-App-Purchasing API
-
Physics
* Box2D
* Bullet Physics * Setup * Using the Wrapper * Using Models * Contact Callbacks * Custom Classes * Debugging
- Using libGDX With Other JVM Languages
- Third Party Extensions
- Third Party Services
- Articles