Sprite::addCostume()
Add a costume to the sprite. If a costume with the received name already exists do nothing.
Syntax
Java
.addCostume(name, imagePath)
.addCostume(name, spriteSheetPath, x, y, width, height)
Parameters
| Name | Data Type | Description |
|---|---|---|
| name | String | a unique name |
| imagePath | String | a image path |
| spriteSheetPath | String | The path to the sprite sheet image file. |
| x | int | The x-coordinate of the top-left corner of the costume in the sprite sheet. |
| y | int | The y-coordinate of the top-left corner of the costume in the sprite sheet. |
| width | int | The width of the costume in the sprite sheet. |
| height | int | The height of the costume in the sprite sheet. |
Return
void
