MakeCode Games!

A fan-made community library of MakeCode Arcade games. Visit MakeCode Arcade to make a game!

← Back to extensions

Sprite Utils

A grab-bag of sprite math and rendering helpers for MakeCode Arcade: distances, angles, movement, timers, and simple drawing.

draw circle

Problem it solves

You want to draw a circle outline—for a radar ping, a target reticle, or a simple UI element—without doing the math yourself.

What this block does

Draws the outline of a circle onto an image at the given center and radius.

The block

Block ID: spriteutilextdrawcircle

draw circle in $to at cx $cx cy $cy radius $r color $col block

Parameters

NameTypeDefaultMeaning
toImagemyImageThe image to draw onto
cxnumber80Center x (0-160)
cynumber60Center y (0-120)
rnumber5Radius (0-40)
colcolor index3The color to draw with

Example

let myImage = image.create(160, 120)
spriteutils.drawCircle(myImage, 80, 60, 5, 3)

Add the extension

Add github:jwunderl/arcade-sprite-util to your project, or open: Import arcade-sprite-util.