Sprite::addCostume()
Add a costume to the sprite. The costume can either be an image or a part of a spritesheet.
Examples
Syntax
Java
Scratch
add costume (name) (file path)
Parameters
Name | Data Type | Description |
---|---|---|
name | String | Name of the costume |
filePath | String | Path to an image file. |
x | int | x-Coordinate in a Spritesheet. |
y | int | y-Coordinate in a Spritesheet. |
width | int | Width of the image at the x- and y-coordinate in the Spritesheet. |
height | int | Height of the image at the x- and y-coordinate in the Spritesheet. |
Return
void