{
"id": "fn-kanvas-create",
"dataComponent": "kanvas",
"heading": {
"title": "create",
"badges": ["Kanvas", "PARTIAL"]
},
"synopsis": "Creates a new window for drawing graphics, with configurable size, title, and flags.",
"codeBlocks": [
"extend(\"kanvas\")\n\nwin = kanvas:create([\n title: \"Hello, Lava + minifb\",\n width: 800,\n height: 600,\n borderless: false,\n resize: false,\n scale: \"X1\", # options: X1, X2, X4, X8\n scaleMode: \"UpperLeft\", # options: Stretch, Center, UpperLeft\n topmost: false,\n transparency: false\n])\n"
],
"notes": [
"The function takes a single keyed array with window options:",
"- `title`: Window title (string)",
"- `width`, `height`: Dimensions in pixels (int)",
"- `borderless`, `resize`, `topmost`, `transparency`: Boolean flags",
"- `scale`: String, controls upscaling ('X1', 'X2', etc.)",
"- `scaleMode`: Placement/scaling style ('UpperLeft', 'Stretch', etc.)",
"Returns a window handle to be used in later Kanvas calls.",
"Partial usage may be available if not all options are supplied (implementation-dependent)."
]
}