Home

Awesome

Phaser-FloatingNumbersPlugin

A Floating numbers plugin for Phaser v3 (Looking for the v2 plugin?)

sample

Initialize

On scene preload:

Call and create floating text (example)

this.floatingNumbers.createFloatingText({
    textOptions: {
        fontFamily: 'shrewsbury',
        fontSize: 42,
        color: "#ff0000",
        strokeThickness: 2,
        fontWeight: "bold",
        stroke: "#000000",
        shadow: {
            offsetX: 0,
            offsetY: 0,
            color: '#000',
            blur: 4,
            stroke: true,
            fill: false
        }
    },
    text: "10",
    align: "top-center",
    parentObject: <any-game-object>,
    animation: "smoke",
    animationEase: "Linear"

});

<br>

Options

{
    "align": "center", //left, right, center
    "textOptions": {},
    "offsetX": 0,
    "offsetY": 0,
    "animation": "up", // explode, smoke, custom, directional: updown, left, right, fade
    "timeToLive": 400,
    "animationDistance": 50,
    "animationEase": "Sine.easeOut",
    "fixedToCamera": false,
    "text": "",
    "store": false,
    "textType": "normal", // normal, bitmaptext
    "parentObject": null,
    "target": this.scene,
    "pointX": [], // for custom animation cubic bezier curve
    "pointY": [] // for custom animation cubic bezier curve
};

Todo