Scratch for Java

TiledMap::getTileCollisionShapes()

Returns collision outlines defined in a tile's tileset object group. Coordinates start at the tile's top-left; x points right and y points up. Shapes are independent copies and do not modify the map when transformed.

Examples

File /src/examples/java/reference//TiledMapData.java is missing.

View on GitHub

Syntax

Java

.getTileCollisionShapes(tileId)
.getTileCollisionShapes(layerName, column, row)

Parameters

Name Data Type Description
tileId int global tile ID (zero and unknown IDs have no shapes)
layerName String tile layer name
column int column index, starting at zero
row int row index, starting at zero

Return

Shape[]

getTileCollisionShapes()

Create Shareable URL

Select Sections