Scratch for Java

Sprite::addCostumes()

Adds all tiles from a spritesheet as costumes. The costumes will be name by the prefix and the index in the spritesheet. For example if the prefix is "tile" and the spritesheet contains 4 tiles, the costumes will be named "tile0", "tile1", "tile2", and "tile3".

Syntax

Java

.addCostumes(prefix, spriteSheet, tileWidth, tileHeight)

Parameters

Name Data Type Description
prefix String a prefix for all generated costumes
spriteSheet String a path to a sprite sheet
tileWidth int the width of a single tile
tileHeight int the height of a single tile

Return

void

addCostumes()