phaser-input
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -12,4 +12,2 @@ declare module Fabrique { | ||
borderRadius?: number; | ||
boxShadow?: string; | ||
innerShadow?: string; | ||
placeHolderColor?: string; | ||
@@ -25,3 +23,2 @@ type?: InputType; | ||
box: Phaser.Graphics; | ||
boxShadow: Phaser.Graphics; | ||
private focus; | ||
@@ -39,3 +36,2 @@ private cursor; | ||
private createBox(inputOptions); | ||
private createBoxShadow(inputOptions); | ||
/** | ||
@@ -42,0 +38,0 @@ * This is a generic input down handler for the game. |
@@ -19,3 +19,2 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
this.box = null; | ||
this.boxShadow = null; | ||
this.focus = false; | ||
@@ -33,3 +32,2 @@ this.type = InputType.text; | ||
this.padding = inputOptions.padding || 0; | ||
//this.createBoxShadow(inputOptions); | ||
this.createBox(inputOptions); | ||
@@ -81,18 +79,2 @@ if (inputOptions.placeHolder && inputOptions.placeHolder.length > 0) { | ||
}; | ||
InputField.prototype.createBoxShadow = function (inputOptions) { | ||
var bgColor = (inputOptions.backgroundColor) ? parseInt(inputOptions.backgroundColor.slice(1), 16) : 0xffffff; | ||
var borderColor = (inputOptions.borderColor) ? parseInt(inputOptions.borderColor.slice(1), 16) : 0x959595; | ||
var height = inputOptions.height || 14; | ||
if (inputOptions.font) { | ||
//fetch height from font; | ||
height = Math.max(parseInt(inputOptions.font.substr(0, inputOptions.font.indexOf('px')), 10), height); | ||
} | ||
height = this.padding * 2 + height; | ||
var width = inputOptions.width || 150; | ||
width = this.padding * 2 + width; | ||
this.boxShadow = new Phaser.Graphics(this.game, 0, 0); | ||
this.boxShadow.beginFill(bgColor, 1) | ||
.drawRoundedRect(0, 0, width, height, inputOptions.borderRadius || 3); | ||
this.addChild(this.boxShadow); | ||
}; | ||
/** | ||
@@ -99,0 +81,0 @@ * This is a generic input down handler for the game. |
{ | ||
"name": "phaser-input", | ||
"author": "OrangeGames", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Adds input boxes to Phaser like CanvasInput, but also works for WebGL.", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25325
327