(Libgdx learning) TextInputListener

Source: Internet
Author: User
Tags libgdx


I. Application Example

MyTextInputListener

Package com. example. groupactiontest; import com. badlogic. gdx. input. textInputListener; public class MyTextInputListener implements TextInputListener {@ Overridepublic void canceled () {// call System when you press cancel. out. println ("-----------> cancel") ;}@ Overridepublic void input (String arg0) {// call System when you press OK. out. println ("--------> input ");}}


MyGame

Package com. example. groupactiontest; import com. badlogic. gdx. applicationListener; import com. badlogic. gdx. gdx; import com. badlogic. gdx. input. keys; import com. badlogic. gdx. input. peripheral; import com. badlogic. gdx. graphics. GL10; public class MyGame implements ApplicationListener {@ Overridepublic void create () {MyTextInputListener listener = new MyTextInputListener (); Gdx. input. getTextInput (listener, "zzt", "I love zzt"); // The second and third parameters are the title of the dialog box and the initialization content of the input box respectively.} @ Overridepublic void dispose () {// TODO Auto-generated method stub} @ Overridepublic void pause () {// TODO Auto-generated method stub} @ Overridepublic void render () {Gdx. gl. glClear (GL10.GL _ COLOR_BUFFER_BIT) ;}@ Overridepublic void resize (int arg0, int arg1) {// TODO Auto-generated method stub} @ Overridepublic void resume () {// TODO Auto-generated method stub }}

III,

Download

Http://download.csdn.net/detail/caihongshijie6/7041969

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.