HTMLText
Renders text with support for styling via HTML tags. The rendering can vary across browsers and platforms.
Usage
<script>
import { HTMLText } from 'svelte-pixi'
</script>
<HTMLText
text="<strong>Hello</strong> <em>World</em>"
anchor={0.5}
style={{
fill: 'white',
}}
/>API
Props
| Name | Description |
|---|---|
anchor | PointLikeThe anchor sets the origin point of the text. |
blendMode | The blend mode to be applied to the sprite. Apply a value of PIXI.BLEND_MODES.NORMAL to reset the blend mode. |
instance | PIXI.HTMLTextThe PIXI.Text instance. Can be set or bound to. |
pluginName | stringPlugin that is responsible for rendering this element. |
roundPixels | booleanIf true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. Advantages can include sharper image quality (like text) and faster rendering on canvas. The main disadvantage is movement of objects may appear less smooth. |
style | PIXI.HTMLTextStyleSets the style of the text |
text | stringThe text to display |
Additional props are passed on to Container
Slots
| Name | Props | Fallback |
|---|---|---|
| default | {} |
Events
| Name | Type | Detail |
|---|---|---|
| added | forwarded | |
| click | forwarded | |
| create | forwarded | |
| globalmousemove | forwarded | |
| globalpointermove | forwarded | |
| globaltouchmove | forwarded | |
| mousedown | forwarded | |
| mousemove | forwarded | |
| mouseout | forwarded | |
| mouseover | forwarded | |
| mouseup | forwarded | |
| mouseupoutside | forwarded | |
| pointercancel | forwarded | |
| pointerdown | forwarded | |
| pointermove | forwarded | |
| pointerout | forwarded | |
| pointerover | forwarded | |
| pointertap | forwarded | |
| pointerup | forwarded | |
| pointerupoutside | forwarded | |
| removed | forwarded | |
| removedFrom | forwarded | |
| rightclick | forwarded | |
| rightdown | forwarded | |
| rightup | forwarded | |
| rightupoutside | forwarded | |
| tap | forwarded | |
| touchcancel | forwarded | |
| touchend | forwarded | |
| touchendoutside | forwarded | |
| touchmove | forwarded | |
| touchstart | forwarded |