nasal-canvas
БесплатноБез исполняемых скриптовНе проверенProvides practical guidance for creating, populating, styling, transforming, updating, and troubleshooting FlightGear Canvas interfaces with Nasal, including…
от container32152 установки в других каталогахОб этом скилле
Nasal Canvas
FlightGear Canvas is a 2D, OpenGL-backed rendering system exposed to Nasal. A Canvas is an off-screen texture/rendering context; a placement makes that texture visible in the FlightGear scene. Its scene graph is hierarchical:
- A Canvas owns a root group.
- Groups contain child elements and other groups.
- Common element types are
group,text,path,image, andmap. - Element properties control rendering and behavior through the FlightGear property tree.
- Canvas uses Nasal, not JavaScript.
- The SVG parser translates a supported subset of SVG/XML into Canvas elements; it is not a browser-grade SVG renderer.
When a task involves placing a Canvas in an aircraft or scene, consult the relevant FlightGear Canvas placement/how-to documentation and the current source API. Scenery-object placement has special requirements and uses the scenery object's _module_id in its load handler; do not assume ordinary placement parameters are sufficient.
Choosing how to populate a Canvas
There are two main approaches:
- Load SVG when the artwork is primarily static, is easier to author in a vector editor such as Inkscape, or needs named elements that Nasal can later modify.
- Build elements in Nasal when geometry is dynamic, generated from simulation data, or benefits from programmatic control.
- Use
canvas.drawfor common higher-level shapes, scales, marks, and transforms instead of manually assembling every primitive. - Use raster images for artwork that does not need vector-level dynamic editing. For frequent pixel changes, use image pixel operations rather than creating a very large number of path elements.
Choose based on maintainability and update cost. A large collection of individual vector elements may be slower than rendering a single image because elements need geometry processing and rendering when the Canvas updates.
Creating and managing a Canvas
The usual workflow is:
- Create the Canvas using the relevant Canvas/window or aircraft-instrument setup API.
- Configure its dimensions, view, rendering options, and background as needed.
- Create a root or named group.
- Add child elements or parse an SVG into a group.
- Retain handles to elements that will be updated later.
- Attach a placement so the Canvas is visible.
- Update only the parts that need to change, and delete objects when their lifecycle ends.
Useful Canvas-level operations documented in the source include:
createGroup([name]): create a group under the Canvas.setColorBackground(r, g, b, a): set the Canvas background.set(setting, value): configure settings such asname,size,view,mipmapping,additive-blend,coverage-samples,color-samples,freeze,render-always, andupdate.get(name): retrieve a Canvas by name.getPath(): obtain its property path for use as an image source.parsesvg(group, file[, font-mapper]): parse SVG into a target group.del(): delete the Canvas.
The source documentation marks some methods/settings as uncertain or incompletely documented (for example wrapCanvas, getPath details, and whether every Canvas setting can be changed after initialization). Do not invent behavior for these; check the current implementation when they matter.
Shared Element behavior
Most Canvas element types inherit common Element operations.
Visibility and lifecycle
getVisible()returns visibility state.setVisible([visible]),show(),hide(), andtoggleVisibility()control visibility.update()requests an update in the current frame; ordinarily changes are reflected in the next frame. Visibility changes are documented as taking effect in the current frame.del()deletes the element.
Geometry and transforms
The documented element transform model has two transformation matrices: the first is applied before the second.
createTransform([matrix])adds a transform; the optional matrix is a six-value affine transform[a, b, c, d, e, f].setRotation(x, y)rotates around the element's configured center and uses the first transform.setTranslation(x, y)translates using the second transform.setScale(x, y)scales using the second transform.getScale()returns[x, y].setCenter(x, y),getCenter(), andupdateCenter()manage the rotation center.getBoundingBox()returns[minX, minY, maxX, maxY].
Rotation is around the local origin unless a center is established. For rotation around an arbitrary point, account for the center explicitly. SVG rotation centers authored in Inkscape may be imported and used by setRotation. Keep transform order in mind: for example, a roll rotation and pitch translation often need to be applied in a deliberate order.
Draw order
Canvas normally uses element creation/storage order: later elements are drawn on top. The z-index property can explicitly control ordering; higher values draw later and cover lower values. When sibling path
Установить nasal-canvas в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл nasal-canvas?
Provides practical guidance for creating, populating, styling, transforming, updating, and troubleshooting FlightGear Canvas interfaces with Nasal, including native Canvas elements, canvas.draw helpers, maps, raster images, and SVG parsing.
Как установить скилл nasal-canvas?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nasal-canvas запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic