-
Notifications
You must be signed in to change notification settings - Fork 53
03 Shapes
Milton Mamani Torres edited this page May 14, 2020
·
10 revisions
Roassal3 has some predefined shapes that can be used by developers.
Instances of RSBoundingShapes has a transformation matrix AthensAffineTransform
and a base Rectangle. Bounding shapes have their position on center, then the origin and the corner of this rectangle must be at the same distance.
Instances of RSBox can create a basic rectangle.
canvas := RSCanvas new.
canvas add: (RSBox new
width: 100;
height: 100;
color: Color blue;
position: 100@100).
"size sets the extent for red box"
canvas add: (RSBox new
size: 100;
color: Color red;
position: 0@0).
canvas

Use border:
to set the stroke for the shape, you will need to create an instance of RSBorder
.
canvas := RSCanvas new.
canvas add: (RSBox new
size: 100;
color: Color red;
border: (RSBorder new
color: Color blue;
width: 5);
position: 0@0).
canvas

Use cornerRadius:
and create corners around the box, you can use an instance of RSCornerRadius
or a number.
canvas := RSCanvas new.
canvas add: (RSBox new
extent: 300@200;
color: (Color blue alpha: 0.3);
border: (RSBorder new
color: (Color red alpha: 0.3);
width: 5);
cornerRadius: 20;
position: 0@0).
canvas

With an instance of RSCornerRadius you can modify the size of each corner.
...
cornerRadius: (RSCornerRadius new
topLeft: 50;
bottomRight:50);
...

Check examples of RSCornerRadius for more combinations.