All examples · Sprites and 2D · As Markdown, for AIs

Shapes

What this example shows

Shapes drawn by the graphics card as they are each frame: createShapes takes a list of rectangles, rounded or not, circles, ellipses and slices of them, outlines of any number of corners and lines as wide as asked for, each filled, outlined or both.

They are plain data: the bar's width, the pie's end, the trail's points are changed every frame and drawn as they are. A line turns as its join says and ends as its cap says; align puts an outline inside or outside what it goes round. All of one object are drawn in one go, and a filter takes them as it takes a sprite.

Starting
Starting
—