Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Pixi TextInput: how to use

$
0
0

I have installed Pixi.TextInput (https://github.com/Mwni/PIXI.TextInput). 

npm install pixi-text-input

It seems that it doesn't contain Types definitions for typescript. And when I am trying to use it, it gives me errors.

 

 

In my index.ts I am importing it and I am trying to use it like this:

import TextInput from 'pixi-text-input';

...

var input = new TextInput({
                    input: {
                        fontSize: '25pt',
                        padding: '14px',
                        width: '500px',
                        color: '#26272E'
                    }, 
                    box: {default: {fill: 0xE8E9F3rounded: 16stroke: {color: 0xCBCEE0width: 4}},
                    focused: {fill: 0xE1E3EErounded: 16stroke: {color: 0xABAFC6width: 4}},
                    disabled: {fill: 0xDBDBDBrounded: 16}}
                });
                //input.placeholder = 'Enter your Text...';
                input.x = 500;
                input.y = 300;
                input.pivot.x = input.width/2;
                input.pivot.y = input.height/2;
                this.app.stage.addChild(input);

But when I run application it says that 
Uncaught TypeError: pixi_text_input_1.default is not a constructor
 


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>