36 lines
No EOL
2 KiB
HTML
36 lines
No EOL
2 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Screen.blend_mode — Ludic</title>
|
||
<meta name="description" content="Choose replace or additive pixel blending.">
|
||
<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> <a href="ns-screen.html">Screen — drawing</a> <span>›</span> <span class="here">Screen.blend_mode</span></div>
|
||
<div class="item-head">
|
||
<span class="kind-badge kind-method">method</span>
|
||
<h1 id="top">Screen.blend_mode</h1>
|
||
</div>
|
||
<code class="sig">Screen.blend_mode(mode)</code>
|
||
<div class="desc"><p>Selects how drawn pixels combine with the framebuffer: <code>0</code> replaces (the default), <code>1</code> adds colours channel-wise and clamps at 255. Additive blending is how you draw glows, fire, lasers, and light — stack several bright shapes and the overlaps brighten toward white. Set it back to <code>0</code> when done.</p></div>
|
||
|
||
<div class="examples"><h2>Example</h2><pre data-lang="ludic">program Demo {
|
||
handler DrawWorld phase Render {
|
||
Screen.blend_mode(1)
|
||
Screen.fill_circle(x: 150, y: 120, radius: 30, color: Color.rgb(80, 20, 0))
|
||
Screen.fill_circle(x: 170, y: 120, radius: 30, color: Color.rgb(80, 20, 0))
|
||
Screen.blend_mode(0)
|
||
Screen.show()
|
||
}
|
||
}</pre></div>
|
||
|
||
<a class="back" href="api.html">← All symbols</a>
|
||
</main>
|
||
<script src="ludic-highlight.js"></script>
|
||
<script>Ludic.highlightAll(); Ludic.installCards(); Ludic.flashTarget();</script>
|
||
</body></html> |