Giter VIP home page Giter VIP logo

pixi.input's Issues

center text doesn't work in pixi v3

Hi SebastianNette,

Thanks for the great lib, I've used it extensively in a project but now realize the align: center option doesn't work for pixi v3 and I can't figure out why.

My code is simple enough, but whether I use 'left', 'right' or 'center', the display is always 'left'

newInputField = new PIXI.Input({width: 440, height: 30, padding: 5, backgroundColor: "#7B7B7B", borderWidth: 0, borderRadius: 9, outline: 0, align: "center", text: {font: "18px Helvetica", fill: "#fff", align: "center"}});

Please let me know what I might be doing wrong, or if there is some easy way to fix this, thank you!

what's the status of this?

Hey, I've just came across this as a solution for input text in pixi. doesnt work on latest pixi. what's the status? are you giving support? Is this deprecated?

focus out when clicked out of object

When I used this 'pixi.input.js', textbox of PIXI.Input doesn't work at 'focus out'.
If I click out of canvas(ex : javascript console), it works. but in the canvas, 'focus out' didn't happen.
So I added some codes, it is crude, but 'focus out' operates well.
insert these lines to pixi.input.js 1123 ("extend(PIXI.Input.prototype, { ~~~ onMouseDown")
(document's 'mousedown' is later than pixi object's 'mousedown'.)

        this.clicked = true;
        if (this.focused == undefined) {
            this.focused = true;
            var func = (e) => {
                if (this.clicked == false) {
                    this.blur();
                    this.focused = undefined;
                    document.removeEventListener('mousedown', func);
                }
                this.clicked = false;
            };
            document.addEventListener('mousedown', func);
        }

Input center

Hi !
Thanks for this amazing tool !

I have a probleme i can't center the text of an input.

Do you have code it ? or it's me who doing it wrong ?

var input = new PIXI.Input({
    align: "center",
    font:{
        align: "center",
    }
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.