Commands
Learn All Commands in canvas-lang
Commands
Background
Set the background color for the canvas:
background "color";
Colors can be named colors like "red", "blue", "green", or hex colors like "#FF5733".
Circle
Draw a circle:
circle at (x, y) radius r fill "color";
x, y
: Coordinates for the center of the circler
: Radius of the circlecolor
: Fill color
Rectangle
Draw a rectangle:
rect at (x, y) width w height h fill "color";
x, y
: Coordinates for the top-left cornerw
: Width of the rectangleh
: Height of the rectanglecolor
: Fill color
Text
Display text:
text "Your text" at (x, y) size s color "color";
"Your text"
: The text to displayx, y
: Coordinates for the texts
: Text size (affects font selection - larger values use larger fonts)color
: Text color
Line
Draw a line:
line from (x1, y1) to (x2, y2) color "color";
x1, y1
: Starting coordinatesx2, y2
: Ending coordinatescolor
: Line color
Rainbow Text
Display animated rainbow text:
rainbow "Your text" at (x, y) duration 100;
"Your text"
: The text to display with rainbow animationx, y
: Coordinates for the textduration
: How long to run the animation (in cycles)
Variables
Define variables for reuse:
var name = value;
Wait
Pause execution:
wait 1000; // Waits for 1000ms
Frames and Animation
Create frame-based animations:
frame {
// Commands for this frame
}
frame {
// Commands for another frame
}
// Or use the animate block
animate {
frame {
// Frame 1
}
frame {
// Frame 2
}
} for 5000; // Animation runs for 5000ms
Last updated