Skip to content

Conversation

@joranbeasley
Copy link

made the setters actually setters (maybe it was my webpack... but it did not like having those without set)

fixed type for substituteText (it is a boolean flag)

MyClass.ts

import {TextInput} from 'pixi-textinput-v5'
import * as PIXI from 'pixi.js'

const app = new PIXI.Application({width:400,height:100})
const te = new TextInput({
    input: {
        fontSize: '12px',
        padding: '5px',
        width: '150px',
        color: '#26272E'
    },
    box: {
        default: {fill: 0xE8E9F3, rounded: 1, stroke: {color: 0xCBCEE0, width: 4}},
        focused: {fill: 0xE1E3EE, rounded: 2, stroke: {color: 0x8B8FD6, width: 4}},
        disabled: {fill: 0xDBDBDB, rounded: 2}
    }
});
te.placeholder = "Hello World"
te.substituteText = false;
te.position.x = 25;
te.position.y = 45;
app.stage.addChild(te);
document.body.onload = ()=> {
    document.body.appendChild(app.view)
}

made the setters actually setters (maybe it was my webpack... but it did not like having those without set)

fixed type for substituteText (it is a boolean flag)

MyClass.ts
```typescript
import {TextInput} from 'pixi-textinput-v5'
import * as PIXI from 'pixi.js'

const app = new PIXI.Application({width:400,height:100})
const te = new TextInput({
    input: {
        fontSize: '12px',
        padding: '5px',
        width: '150px',
        color: '#26272E'
    },
    box: {
        default: {fill: 0xE8E9F3, rounded: 1, stroke: {color: 0xCBCEE0, width: 4}},
        focused: {fill: 0xE1E3EE, rounded: 2, stroke: {color: 0x8B8FD6, width: 4}},
        disabled: {fill: 0xDBDBDB, rounded: 2}
    }
});
te.placeholder = "Hello World"
te.substituteText = false;
te.position.x = 25;
te.position.y = 45;
app.stage.addChild(te);
document.body.onload = ()=> {
    document.body.appendChild(app.view)
}
```
specified type for _dom_input and htmlInput, so that i would not have to do `te._dom_input as HTMLInputElement).type = "number"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant