phaser3-pixelinput

1.3.3 • Public • Published

Input field for Phaser 3 using BitmapText.

Demo

Has:

  • typing
  • multiline support
  • navigation with arrow keys
  • text overflow handling (horizontal and vertical)
  • text selection
  • copy-paste
  • undo-redo

Doesn't have:

  • mouse interaction
  • resizing
  • mobile support

Usage:

In the game config, put

plugins: {
  global: [PixelInputPlugin.DEFAULT_CFG]
}

Then use it like this:

let input_config = {
  x: 25,
  y: 50,
  font: "atari-classic",
  font_size: 8,
  width: 250,
  height: 12,
  allowed_characters: Phaser.GameObjects.RetroFont.TEXT_SET1
};
let input = this.add.pixelInput(input_config);
input.text = "Hello world!";

For a multiline input field, include "\n" in allowed_characters.

Readme

Keywords

Package Sidebar

Install

npm i phaser3-pixelinput

Weekly Downloads

2

Version

1.3.3

License

MIT

Unpacked Size

25.6 kB

Total Files

8

Last publish

Collaborators

  • bsza