Scratch for Java

UISprite::setNineSlice()

Keeps the corners and edges of the costume from stretching when the sprite is resized, so that a button costume can be made any size.

Syntax

Java

.setNineSlice(top, right, bottom, left)

Parameters

Name Data Type Description
top int how many pixels of the costume belong to the top edge
right int how many pixels of the costume belong to the right edge
bottom int how many pixels of the costume belong to the bottom edge
left int how many pixels of the costume belong to the left edge

Return

void

setNineSlice()

Create Shareable URL

Select Sections