ludic/ns-screen.html
2026-09-17 22:10:03 +00:00

22 lines
No EOL
5.9 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Screen — Ludic</title>
<meta name="description" content="The 2D drawing surface.">
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="docs.css">
</head>
<body>
<header class="nav"><div class="wrap nav-in"><a class="brand" href="index.html"><span class="logo">L</span> Ludic</a><button class="nav-toggle" aria-label="Toggle menu" aria-expanded="false">☰</button><nav class="nav-links"><a href="index.html">Home</a><a href="api.html">API Reference</a><a class="nav-cta" href="https://git.workshopsoft.io/workshopsoft/ludic">Source ↗</a></nav></div></header>
<main class="wrap item">
<div class="crumbs"><a href="api.html">API Reference</a> <span>›</span> <span class="here">Screen</span></div>
<div class="item-head"><span class="kind-badge kind-namespace">namespace</span><h1 id="top">Screen</h1></div>
<p class="ns-blurb">The 2D drawing surface. Every call takes named arguments; draw during the <code>Render</code> phase, then <code>Screen.show()</code>.</p>
<div class="ns-methods"><a class="ns-method" href="screen-clear.html"><code class="nm-sig">Screen.clear(color)</code><span class="nm-tip">Fill the whole framebuffer with one color to start a fresh frame.</span></a><a class="ns-method" href="screen-fill_rectangle.html"><code class="nm-sig">Screen.fill_rectangle(x, y, width, height, color)</code><span class="nm-tip">Draw a solid, filled rectangle at a pixel position.</span></a><a class="ns-method" href="screen-draw_rectangle.html"><code class="nm-sig">Screen.draw_rectangle(x, y, width, height, color)</code><span class="nm-tip">Draw a one-pixel-thick rectangle outline (not filled).</span></a><a class="ns-method" href="screen-put_pixel.html"><code class="nm-sig">Screen.put_pixel(x, y, color)</code><span class="nm-tip">Set a single pixel at a pixel coordinate to one color.</span></a><a class="ns-method" href="screen-draw_text.html"><code class="nm-sig">Screen.draw_text(x, y, text, color, scale)</code><span class="nm-tip">Draw a string with the built-in font at an integer scale.</span></a><a class="ns-method" href="screen-draw_number.html"><code class="nm-sig">Screen.draw_number(x, y, value, color, scale)</code><span class="nm-tip">Draw an integer directly, with no string allocation or conversion.</span></a><a class="ns-method" href="screen-show.html"><code class="nm-sig">Screen.show()</code><span class="nm-tip">Present the finished frame — copy everything drawn this frame to the window.</span></a><a class="ns-method" href="screen-width.html"><code class="nm-sig">Screen.width() -&gt; int</code><span class="nm-tip">The framebuffer width in pixels.</span></a><a class="ns-method" href="screen-height.html"><code class="nm-sig">Screen.height() -&gt; int</code><span class="nm-tip">The framebuffer height in pixels.</span></a><a class="ns-method" href="screen-status.html"><code class="nm-sig">Screen.status(text)</code><span class="nm-tip">Set the persistent one-line status/HUD string shown by the runtime.</span></a><a class="ns-method" href="screen-line.html"><code class="nm-sig">Screen.line(x1, y1, x2, y2, color)</code><span class="nm-tip">Draw a straight line between two points.</span></a><a class="ns-method" href="screen-circle.html"><code class="nm-sig">Screen.circle(x, y, radius, color)</code><span class="nm-tip">Draw a circle outline.</span></a><a class="ns-method" href="screen-fill_circle.html"><code class="nm-sig">Screen.fill_circle(x, y, radius, color)</code><span class="nm-tip">Draw a filled disc.</span></a><a class="ns-method" href="screen-triangle.html"><code class="nm-sig">Screen.triangle(x1, y1, x2, y2, x3, y3, color)</code><span class="nm-tip">Draw a triangle outline.</span></a><a class="ns-method" href="screen-fill_triangle.html"><code class="nm-sig">Screen.fill_triangle(x1, y1, x2, y2, x3, y3, color)</code><span class="nm-tip">Draw a filled triangle.</span></a><a class="ns-method" href="screen-sprite.html"><code class="nm-sig">Screen.sprite(id, x, y)</code><span class="nm-tip">Blit a sprite at its natural size.</span></a><a class="ns-method" href="screen-sprite_scaled.html"><code class="nm-sig">Screen.sprite_scaled(id, x, y, scale)</code><span class="nm-tip">Blit a sprite at an integer scale.</span></a><a class="ns-method" href="screen-oval.html"><code class="nm-sig">Screen.oval(x, y, rx, ry, color)</code><span class="nm-tip">Draw an axis-aligned ellipse outline.</span></a><a class="ns-method" href="screen-camera.html"><code class="nm-sig">Screen.camera(x, y)</code><span class="nm-tip">Set the world-space camera offset for the draw path.</span></a><a class="ns-method" href="screen-clip.html"><code class="nm-sig">Screen.clip(x, y, width, height)</code><span class="nm-tip">Restrict drawing to a screen-space rectangle.</span></a><a class="ns-method" href="screen-clip_reset.html"><code class="nm-sig">Screen.clip_reset()</code><span class="nm-tip">Lift the clip rectangle (draw to the whole screen again).</span></a><a class="ns-method" href="screen-blend_mode.html"><code class="nm-sig">Screen.blend_mode(mode)</code><span class="nm-tip">Choose replace or additive pixel blending.</span></a><a class="ns-method" href="screen-measure_text.html"><code class="nm-sig">Screen.measure_text(text) -&gt; int</code><span class="nm-tip">The pixel advance width of text in the built-in font.</span></a><a class="ns-method" href="screen-pixel.html"><code class="nm-sig">Screen.pixel(x, y) -&gt; int</code><span class="nm-tip">Read a framebuffer pixel (0x00RRGGBB), or 0 if off-screen.</span></a><a class="ns-method" href="screen-bar.html"><code class="nm-sig">Screen.bar(x:, y:, width:, height:, value:, max:, color:, back:)</code><span class="nm-tip">A filled meter: value of max over a track.</span></a></div>
<a class="back" href="api.html">← All symbols</a>
</main>
<script src="ludic-highlight.js"></script>
<script>Ludic.installCards(); Ludic.flashTarget();</script>
</body></html>