ProgressBar
Kind: global class
new ProgressBar(game, x, y, width, height, maxValue, borderColor, barColor)
Create a Progress Bar
| Param | Type | Description |
|---|---|---|
| game | Phaser.Scene |
|
| x | Number |
|
| y | Number |
|
| width | Number |
|
| height | Number |
|
| maxValue | Number |
|
| borderColor | string |
Must be of the format ‘0x123123’ |
| barColor | string |
Must be of the format ‘0x123123’ |
Example
const progressBar = new ProgressBar(scene, 100, 100, 400, 50, 2000, '0x000000', '0xeeeeee')
progressBar.setValue(value)
Set the value of the progress bar
Kind: instance method of ProgressBar
| Param | Type |
|---|---|
| value | Number |
Example
progressBar.setValue(500)
progressBar.setText(text, textColor, fontFamily)
Set text for the progress bar
Kind: instance method of ProgressBar
| Param | Type | Description |
|---|---|---|
| text | string |
|
| textColor | string |
must be of the format ‘#abcd12’ |
| fontFamily | string |
css font family value |
Example
progressBar.setText("HP", "#ff5666", "Roboto")
progressBar.move(x, y)
moves progress bar
Kind: instance method of ProgressBar
| Param | Type |
|---|---|
| x | Number |
| y | Number |
progressBar.destroy()
destroys progress bar
Kind: instance method of ProgressBar