3.0.0 • Published 2 years ago

a3-phaser-functionality-extension v3.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
2 years ago

A3-Phaser-Object-ext

version npm version

Basic phaser functionality extension that add additional function to phaser components.

Documentation is scarce as i myself still learning and hope to get some feedback

jsdoc should serve enough docs for now

Installation:

# git
npm install git+https://gategit.agate.id/billy.firman/a3-phaser-object-ext
# npm registry
npm install a3-phaser-functionality-extension

Usage

Extension

import {SizeExtension} from "a3-phaser-object-ext";
// global Scope (applied to entire game)
Object.assign(Phaser.GameObjects.Image.prototype, SizeExtension);
// object scope (only applied to assigned object)
const image = new Image(30, 20);
Object.assign(image, SizeExtension);
// example use
image.setMaxPreferredDisplaySize(200, 300);

Graphic Fill

const img = this.add.sprite(0, 0, UIAsset.result_home_button.key)
img.setPosition(this.scale.width * .5)

const radialFill = new RadialFill(this);

radialFill.assignFillAnchor(img, img.displayWidth, -90, true)
radialFill.setVisible(false)
img.setMask(radialFill.createGeometryMask());

radialFill.fillValue = .15;
3.0.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.3.0

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago