API Reference › Screen
namespace

Screen

The 2D drawing surface. Every call takes named arguments; draw during the Render phase, then Screen.show().

Screen.clear(color)Fill the whole framebuffer with one color to start a fresh frame.Screen.fill_rectangle(x, y, width, height, color)Draw a solid, filled rectangle at a pixel position.Screen.draw_rectangle(x, y, width, height, color)Draw a one-pixel-thick rectangle outline (not filled).Screen.put_pixel(x, y, color)Set a single pixel at a pixel coordinate to one color.Screen.draw_text(x, y, text, color, scale)Draw a string with the built-in font at an integer scale.Screen.draw_number(x, y, value, color, scale)Draw an integer directly, with no string allocation or conversion.Screen.show()Present the finished frame — copy everything drawn this frame to the window.Screen.width() -> intThe framebuffer width in pixels.Screen.height() -> intThe framebuffer height in pixels.Screen.status(text)Set the persistent one-line status/HUD string shown by the runtime.Screen.line(x1, y1, x2, y2, color)Draw a straight line between two points.Screen.circle(x, y, radius, color)Draw a circle outline.Screen.fill_circle(x, y, radius, color)Draw a filled disc.Screen.triangle(x1, y1, x2, y2, x3, y3, color)Draw a triangle outline.Screen.fill_triangle(x1, y1, x2, y2, x3, y3, color)Draw a filled triangle.Screen.sprite(id, x, y)Blit a sprite at its natural size.Screen.sprite_scaled(id, x, y, scale)Blit a sprite at an integer scale.Screen.oval(x, y, rx, ry, color)Draw an axis-aligned ellipse outline.Screen.camera(x, y)Set the world-space camera offset for the draw path.Screen.clip(x, y, width, height)Restrict drawing to a screen-space rectangle.Screen.clip_reset()Lift the clip rectangle (draw to the whole screen again).Screen.blend_mode(mode)Choose replace or additive pixel blending.Screen.measure_text(text) -> intThe pixel advance width of text in the built-in font.Screen.pixel(x, y) -> intRead a framebuffer pixel (0x00RRGGBB), or 0 if off-screen.Screen.bar(x:, y:, width:, height:, value:, max:, color:, back:)A filled meter: value of max over a track.
← All symbols