Home

Awesome

CanvasInput

Description

CanvasInput recreates and improves a full DOM <input> element within HTML5 Canvas.

More documentation, examples and demos can be found at CanvasInput.

Features

Browser Compatibility

Tested in the following browsers/versions:

Documentation

Examples

Most basic, default text box:
<canvas id="canvas" width="200" height="50"></canvas>
var input = new CanvasInput({
  canvas: document.getElementById('canvas')
});
More styling options:
<canvas id="canvas" width="350" height="50"></canvas>
var input = new CanvasInput({
  canvas: document.getElementById('canvas'),
  fontSize: 18,
  fontFamily: 'Arial',
  fontColor: '#212121',
  fontWeight: 'bold',
  width: 300,
  padding: 8,
  borderWidth: 1,
  borderColor: '#000',
  borderRadius: 3,
  boxShadow: '1px 1px 0px #fff',
  innerShadow: '0px 0px 5px rgba(0, 0, 0, 0.5)',
  placeHolder: 'Enter message here...'
});

Properties

Methods

In addition to getter/setter methods for each of the above properties, the following methods have also been made available.

License

Copyright (c) 2013-2017 James Simpson and GoldFire Studios, Inc.

Released under the MIT License.