Scratch for Java

Sprite::setNineSlice()

Stretches only the middle of the costume when the sprite is drawn at its own width and height: the four corners keep their size (scaled with the sprite's size), the edges stretch along one side.

Examples

View on GitHub

Syntax

Java

.setNineSlice(top, right, bottom, left)

Parameters

Name Data Type Description
top int costume pixels at the top that keep their height
right int costume pixels at the right that keep their width
bottom int costume pixels at the bottom that keep their height
left int costume pixels at the left that keep their width

Return

void

setNineSlice()

Create Shareable URL

Select Sections