Git Product home page Git Product logo

defold-textinput's Introduction

Defold TextInput

This extension brings Native TextInput to game engine. Currently only supports Android. iOS and HTML5 are underway...

Example:

local id = textinput.create(false, function(self, ev, data)
  if ev == textinput.EVENT_ON_TEXT_CHANGED then
    print(data)
  elseif ev == textinput.EVENT_ON_SUBMIT then
    print(data)
  end
end)
textinput.set_hint(id, "Enter here...")
textinput.set_hint_text_color(id, "#ff0000")
textinput.set_text_color(id, "#ffff00")
textinput.set_position(id, 300, 400)
textinput.set_size(id, 500, 150)
textinput.set_auto_capitalize(id, textinput.CAPITALIZE_SENTENCES)
textinput.set_visible(id, true)

Exposed APIs:

  • textinput.create(is_hidden, listener)
  • textinput.set_visible(id, visible)
  • textinput.set_position(id, x, y)
  • textinput.set_size(id, width, height)
  • textinput.set_text(id, text)
  • textinput.set_text_color(id, color)
  • textinput.set_text_size(id, text_size)
  • textinput.set_hint(id, hint)
  • textinput.set_hint_text_color(id, color)
  • textinput.set_max_length(id, max_length)
  • textinput.set_keyboard_type(id, keyboard_type)
  • textinput.set_auto_capitalize(id, capitalize)
  • textinput.set_return_key_type(id, return_key_type)
  • textinput.get_text(id)
  • textinput.focus(id)
  • textinput.clear_focus(id)
  • textinput.destroy(id)

Exposed Constants:

  • KeyboardType: textinput.KEYBOARD_TYPE_DEFAULT, textinput.KEYBOARD_TYPE_NUMBER_PAD, textinput.KEYBOARD_TYPE_EMAIL, textinput.KEYBOARD_TYPE_PASSWORD
  • Capitalize: textinput.CAPITALIZE_NONE, textinput.CAPITALIZE_SENTENCES, textinput.CAPITALIZE_WORDS, textinput.CAPITALIZE_CHARACTERS
  • ReturnKeyType: textinput.RETURN_KEY_TYPE_DONE, textinput.RETURN_KEY_TYPE_GO, textinput.RETURN_KEY_TYPE_NEXT, textinput.RETURN_KEY_TYPE_SEARCH, textinput.RETURN_KEY_TYPE_SEND
  • Event: textinput.EVENT_ON_SUBMIT, textinput.EVENT_ON_TEXT_CHANGED, textinput.EVENT_ON_FOCUS_CHANGE

defold-textinput's People

Contributors

baochungit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.