Pen::setTransparency()
Sets the pen's transparency to the percentage.
Examples

import org.openpatch.scratch.*;
import org.openpatch.scratch.extensions.pen.*;
public class PenSetTransparency {
public PenSetTransparency() {
Stage myStage = new Stage(254, 100);
Pen myPen = new Pen();
myStage.add(myPen);
myPen.down();
myPen.setSize(10);
myPen.setTransparency(20);
myPen.setPosition(120, 45);
myStage.wait(500);
Window.getInstance().exit();
}
public static void main(String[] args) {
new PenSetTransparency();
}
}
Syntax
Java
.setTransparency(percentage)
Scratch
Parameters
Name | Data Type | Description |
---|---|---|
percentage | float | A value in percent in the range of 0 ... 255. |
Return
void