Scratch for Java

Sprite::setHitbox()

Sets the hitbox for the sprite using the provided points. The points should be provided in pairs representing the x and y coordinates.

Examples

View on GitHub

Syntax

Java

.setHitbox(points)
.setHitbox(shape)

Parameters

Name Data Type Description
points double[] an array of integers representing the x and y coordinates of the hitbox vertices. The length of the array should be even, with each pair of integers representing a point (x, y).
shape Shape the shape to be used for the hitbox

Return

void

setHitbox()

Create Shareable URL

Select Sections