Skip to content

bagyoni/phaser3-pixelinput

Repository files navigation

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.

About

Pixel art style input box for Phaser 3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published