Fill test
Example apps / fill-test / v0.1.0
Overlay app
A see-through page that covers the whole game view at any aspect ratio, with "fill": "screen": a frame on its four edges, its size in the middle, and a panel kept at the right edge.
The preview is a browser window, so the page takes the preview's size rather than a game view's.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fill test</title>
<script src="rednode://ui/rednode-ui.js"></script>
<style>
/* "fill": "screen" in the manifest: the page covers the whole game view, 1080 high and
as wide as the view. Only the frame and the panel are drawn; the rest is see-through
and lets clicks through to the game. */
html, body { margin: 0; width: 100vw; height: 100vh; overflow: hidden; background: transparent; }
.edge { position: fixed; background: var(--rn-accent); }
.top { left: 0; right: 0; top: 0; height: 4px; }
.bottom { left: 0; right: 0; bottom: 0; height: 4px; }
.left { top: 0; bottom: 0; left: 0; width: 4px; }
.right { top: 0; bottom: 0; right: 0; width: 4px; }
.size { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 18px;
background: var(--rn-bg); border: 1px solid var(--rn-line); font: 600 22px var(--rn-mono); color: var(--rn-fg); }
.panel { position: fixed; right: 16px; top: 16px; bottom: 16px; width: 320px; }
.panel rn-window { position: absolute; inset: 0; }
.log { font: 12px var(--rn-mono); color: var(--rn-dim); white-space: pre-wrap; }
</style>
</head>
<body theme="hud">
<div class="edge top"></div><div class="edge bottom"></div><div class="edge left"></div><div class="edge right"></div>
<div class="size" id="size">-</div>
<div class="panel">
<rn-window title="Fill test">
<p>This panel keeps to the right edge of the screen. The accent lines mark the page's four edges: each should touch the screen's edge.</p>
<div class="log" id="log"></div>
</rn-window>
</div>
<script>
const lines = [];
function show(why) {
const text = `${innerWidth} x ${innerHeight}`;
document.getElementById('size').textContent = text;
lines.push(`${new Date().toLocaleTimeString()} ${why}: ${text}`);
document.getElementById('log').textContent = lines.slice(-12).join('\n');
console.log(`[fill-test] ${why}: ${text}`);
}
show('opened');
addEventListener('resize', () => show('resized'));
</script>
</body>
</html>
const lines = [];
function show(why) {
const text = `${innerWidth} x ${innerHeight}`;
document.getElementById('size').textContent = text;
lines.push(`${new Date().toLocaleTimeString()} ${why}: ${text}`);
document.getElementById('log').textContent = lines.slice(-12).join('\n');
console.log(`[fill-test] ${why}: ${text}`);
}
show('opened');
addEventListener('resize', () => show('resized'));
REDnode runs JavaScript. The rednode package also has TypeScript types, so an editor checks these calls; compile TypeScript to .mjs first.
{
"id": "fill-test",
"name": "Fill test",
"version": "0.1.0",
"author": "Edgemodders",
"description": "Checks \"fill\": \"screen\" (#32): a see-through page over the whole game view, with a frame on its four edges, its size, and a panel kept at the right edge. Every screen shape should be covered edge to edge.",
"entry": "index.html",
"width": 1920,
"height": 1080,
"fill": "screen",
"open": false
}
The manifest names the package and says how REDnode runs it. Its fields are in Overlay apps.
How it works
The manifest says "fill": "screen". REDnode makes the page 1080 high and as wide as the game view in the same scale: 1920 at 16:9, 2580 at 21:9, 3840 at 32:9. It sits at the top-left, cannot be dragged or resized, and keeps no saved place.
The page lays out from innerWidth and follows resize, which comes when the game's resolution changes. Only the frame, the size and the panel are drawn, so clicks elsewhere reach the game.
What it uses
"fill": "screen" innerWidth resize event
Try this
- Open it from the launcher and check that the four accent lines touch the screen's edges.
- Change the game's resolution or window size and watch the size follow.
Use it
Copy the files into red4ext/plugins/REDnode/apps/fill-test/ in the game folder, or start your own package from them: change id and name in the manifest first. The whole folder is on GitHub.