
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
pixi-multistyle-text
Advanced tools
Add a MultiStyleText
object inside pixi.js to easily create text using different styles.
In the example below, we are defining 4 text styles.
default
is the default style for the text, and the others matches the tags inside the text.
let text = new MultiStyleText("Let's make some <ml>multiline</ml>\nand <ms>multistyle</ms> text for\n<pixi>Pixi.js!</pixi>",
{
"default": {
fontFamily: "Arial",
fontSize: "24px",
fill: "#cccccc",
align: "center"
},
"ml": {
fontStyle: "italic",
fill: "#ff8888"
},
"ms": {
fontStyle: "italic",
fill: "#4488ff"
},
"pixi": {
fontSize: "64px",
fill: "#efefef"
}
});
$ yarn install
$ yarn build
text = new MultiStyleText(text, textStyles)
Creates a new MultiStyleText
with the given text and styles.
textStyles
Type: { [key: string]: ExtendedTextStyle }
Each key of this dictionary should match with a tag in the text. Use the key default
for the default style.
Each ExtendedTextStyle
object can have any of the properties of a standard PIXI text style, in addition to a valign
property that allows you to specify where text is rendered relative to larger text on the same line ("top"
, "middle"
, or "bottom"
).
The align
, wordWrap
, wordWrapWidth
, and breakWord
properties are ignored on all styles except for the default
style, which controls those properties for the entire text object.
If text is rendered without any value assigned to a given parameter, Pixi's defaults are used.
$ yarn demo
MIT, see LICENSE.md for details.
0.10.0 (2020-02-28)
FAQs
Multi-Style Text for pixi.js
The npm package pixi-multistyle-text receives a total of 167 weekly downloads. As such, pixi-multistyle-text popularity was classified as not popular.
We found that pixi-multistyle-text demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.