mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 02:36:04 +10:00
Initial commit
moved from private version control
This commit is contained in:
31
scripts/nodes/library/graphics/fillp.js
Normal file
31
scripts/nodes/library/graphics/fillp.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { createNodeModule } from "../../nodeTypes.js";
|
||||
|
||||
/**
|
||||
* Configures the active fill pattern.
|
||||
*/
|
||||
export const fillpNode = createNodeModule(
|
||||
{
|
||||
id: "graphics_fillp",
|
||||
title: "Set Fill Pattern",
|
||||
category: "Graphics",
|
||||
description: "Set the 4x4 fill pattern bitfield used by many draw calls.",
|
||||
searchTags: ["fillp", "pattern", "fill", "hatch"],
|
||||
inputs: [
|
||||
{ id: "exec_in", name: "Exec", direction: "input", kind: "exec" },
|
||||
{ id: "pattern", name: "Pattern", direction: "input", kind: "number" },
|
||||
],
|
||||
outputs: [
|
||||
{ id: "exec_out", name: "Exec", direction: "output", kind: "exec" },
|
||||
],
|
||||
properties: [],
|
||||
},
|
||||
{
|
||||
emitExec: ({ indent, indentLevel, resolveValueInput, emitNextExec }) => {
|
||||
const pattern = resolveValueInput("pattern", "__pg_omit__");
|
||||
const call = pattern === "__pg_omit__" ? "fillp()" : `fillp(${pattern})`;
|
||||
const lines = [`${indent(indentLevel)}${call}`];
|
||||
lines.push(...emitNextExec("exec_out"));
|
||||
return lines;
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user