Atlas png on f3 gui

This commit is contained in:
2026-10-08 18:16:16 -03:00
parent 067fac270b
commit 2cd19f9764
2 changed files with 20 additions and 1 deletions
+6
View File
@@ -4,6 +4,7 @@ import { format_clock } from "$/common/time.ts";
import { profiler, type SectionStats } from "$/client/profiler.ts";
import { canvas, gpu_timer, render_debug, render_stats } from "$/client/renderer/mod.ts";
import { RENDER_LAYERS } from "$/common/everything_registry.ts";
import { atlas_png } from "$/client/atlas.ts";
// how often the totals that go through every chunk are worked out again, so the overlay doesn't slow the frames it's
// measuring
@@ -19,6 +20,11 @@ export class DebugOverlay {
DebugUI.begin("Entities", 10, 10, 300);
DebugUI.text(`${format_clock(client.level.time)} (tick ${client.level.time})`);
if (DebugUI.button("Copy texture atlas")) {
// the promise goes in as is, so the copy still counts as coming from the click while the png encodes
const png = atlas_png();
if (png) navigator.clipboard?.write([new ClipboardItem({ "image/png": png })]).catch(() => {});
}
DebugUI.separator();
for (const entity of client.level.entities.values()) {