Skip to content

Draw API (hyperion.draw.*)

Drawing functions

Function Return Throws Description
hyperion.draw.rect(x, y, w, h, color, rounding?) void No Draw rectangle outline.
hyperion.draw.filledRect(x, y, w, h, color, rounding?) void No Draw filled rectangle.
hyperion.draw.outlinedRect(x, y, w, h, color, outline, rounding?) void No Draw rectangle with outline.
hyperion.draw.line(x1, y1, x2, y2, color, thickness?) void No Draw line (default thickness 1).
hyperion.draw.circle(x, y, radius, color, thickness?, segments?) void No Draw circle outline.
hyperion.draw.filledCircle(x, y, radius, color, segments?) void No Draw filled circle.
hyperion.draw.text(x, y, text, color, flags?) void No Draw text.

Screen information

Function Return Throws Description
hyperion.draw.screenWidth() number No Screen width in pixels.
hyperion.draw.screenHeight() number No Screen height in pixels.
hyperion.draw.screenSize() { w, h } No Screen size table.

Text flags

hyperion.draw.TEXT_LEFT, hyperion.draw.TEXT_RIGHT, hyperion.draw.TEXT_CENTERED_X, hyperion.draw.TEXT_CENTERED_Y, hyperion.draw.TEXT_CENTERED, hyperion.draw.TEXT_SHADOW.