sebastiannette / pixi.input Goto Github PK
View Code? Open in Web Editor NEWCanvas Input Elements
Canvas Input Elements
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",
}
});
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!
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?
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);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.