Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » GRAPHEX documentation _ 1.0
- -GamesTester-
-
Scratcher
3 posts
GRAPHEX documentation _ 1.0
This is my GRAPHEX project's documentation :
go to main project _ GRAPHEX : https://scratch.mit.edu/projects/1326958939/
The goal of graphex is to simplify pen use to draw forms with custum blocks :
For color you need to put a hexa one, are accepted : #000000 or 000000 (an # will be automaticaly add)
And an information before an input who ends with a “?” means it need a boolean as input
- set background:
this gonna erase everything in the screen to set the background a the {color} (in hexa look at the beginning of the docu)
because it's erase everything
I advise you to create a custom block (without screen refresh) that starts with a set background at: and then your elements
- draw rect
{x} and {y} 2.int: int values +/- | .default=0
{w} and {h} 2.int+: need to be positive values from 0 to +.. | .default=0
{color} .hexa: need to be an hexa value (look at the beginning) | .default=0 => black
{center?} .bool: it's a bool by default set to false, to get a true input use : look below, because {not (false)} is true | .default=false
{border_radius} .int: need to be : look below | .default=0
- “max” it use the smaller value btw {w} and {h} and divide it by 2
- an int between 0 and a value (if the value exceed “max”, “max” will be used)
{margin} .int: between 0 and min(w,h)/2, else rect isn't drawn | .default=0
{ratio} .float: between 0 and 1, it allows easy animations, use center?=true or not the create a apparition or a sliding animation | .default=0
go to main project _ GRAPHEX : https://scratch.mit.edu/projects/1326958939/
The goal of graphex is to simplify pen use to draw forms with custum blocks :
For color you need to put a hexa one, are accepted : #000000 or 000000 (an # will be automaticaly add)
And an information before an input who ends with a “?” means it need a boolean as input
- set background:
define set background at: (color)
this gonna erase everything in the screen to set the background a the {color} (in hexa look at the beginning of the docu)
because it's erase everything
I advise you to create a custom block (without screen refresh) that starts with a set background at: and then your elements
- draw rect
define draw rect from x,y: (x) (y) w,h: (w) (h) color: (color) *, center? <center?> border_radius: (border_radius) margin: (margin) ratio: (ratio)
{x} and {y} 2.int: int values +/- | .default=0
{w} and {h} 2.int+: need to be positive values from 0 to +.. | .default=0
{color} .hexa: need to be an hexa value (look at the beginning) | .default=0 => black
{center?} .bool: it's a bool by default set to false, to get a true input use : look below, because {not (false)} is true | .default=false
<not <>>
{border_radius} .int: need to be : look below | .default=0
- “max” it use the smaller value btw {w} and {h} and divide it by 2
- an int between 0 and a value (if the value exceed “max”, “max” will be used)
{margin} .int: between 0 and min(w,h)/2, else rect isn't drawn | .default=0
{ratio} .float: between 0 and 1, it allows easy animations, use center?=true or not the create a apparition or a sliding animation | .default=0
Last edited by -GamesTester- (June 16, 2026 14:29:24)
- Discussion Forums
- » Developing Scratch Extensions
-
» GRAPHEX documentation _ 1.0