SS14 Graphics SpriteSystem
БесплатноБез исполняемых скриптовНе проверенAn in-depth practical guide to SpriteSystem in Space Station 14: lifecycle, full API for groups of methods, working with layers and layer-map, practical…
от makura-games★ 74 звезды на GitHubОб этом скилле
#SpriteSystem in SS14
This skill only covers SpriteSystem and the practice of its application in the current SS14 architecture :)
Related topics (GenericVisualizer, Appearance, overlays, shaders, UI) are covered in separate skills.
When to use
Use SpriteSystem when you need:
- change the appearance of an entity in runtime on the client;
- manage layers, their visibility, color, offset, RSI/texture;
- dynamically add/remove layers;
- use layer map for stable addressing of layers by key;
- make accurate visual updates from visualizer systems.
Don’t bring logic here that can only be prototyped (static Sprite without dynamics), and don’t mix SpriteSystem with network business logic.
Source of truth
- Consider outdated examples on direct calls to
SpriteComponenthistorical.
SpriteSystem mental model
- The server and shared layer decide the state of the gameplay.
- The client receives state data (often via an appearance/visualizer).
- The client system calls
SpriteSystemand changes only the visual appearance. - The sprite is rendered from a set of layers (
Layer) with their parameters. - Layer map gives stable keys (
Enum/string) instead of "magic" indexes.
Idea: the visual changes locally, deterministically and cheaply over the network :)
API parsing (by groups)
1) Entity-level setters
Use for properties of the entire sprite:
SetScale,SetRotation,SetOffsetSetVisible,SetDrawDepth,SetColorSetBaseRsi,SetContainerOccludedSetSnapCardinals,SetGranularLayersRendering
2) Layer CRUD
Creating/deleting layers:
AddBlankLayerAddLayer(fromLayer,SpriteSpecifier,PrototypeLayerData)AddRsiLayerAddTextureLayerRemoveLayerTryGetLayerLayerExists
3) Layer map API
Key mapping operations:
LayerMapSet,LayerMapAddLayerMapRemoveLayerMapTryGet,LayerMapGetLayerMapReserve
The Enum and string keys are supported. For project code, usually choose Enum.
4) Layer mutators (main working set)
LayerSetDataLayerSetSpriteLayerSetTextureLayerSetRsiStateLayerSetRsiLayerSetScaleLayerSetRotationLayerSetOffsetLayerSetVisibleLayerSetColorLayerSetDirOffsetLayerSetAnimationTimeLayerSetAutoAnimatedLayerSetRenderingStrategy
5) Layer getters
LayerGetRsiStateLayerGetEffectiveRsiLayerGetDirectionsLayerGetDirectionCount
6) Bounds / Render / Helpers
GetLocalBounds(for the entire sprite and a separate layer)CalculateBoundsRenderSpriteGetFrameFrame0,RsiStateLikeGetIcon,GetPrototypeIcon,GetPrototypeTexturesGetFallbackState,GetFallbackTextureGetState,GetTextureGetSpriteWorldPosition,GetSpriteScreenCoordinates
7) Utility methods
ForceUpdateSetAutoAnimateSync(for sprite/layer)CopySpriteQueueUpdateIsInert/QueueUpdateInert
Overload pattern
Most layer methods have variants:
- by index
int; - by key
Enum; - by key
string; - by object
Layer.
Rule: in gameplay code, Enum keys via layer map are preferable.
Must know about obsolete wrappers
SpriteComponent has many deprecated proxy methods ([Obsolete]) that redirect to SpriteSystem.
Why is direct calls to SpriteComponent an anti-pattern:
- blurring the unified update API;
- complicate refactoring and auditing of visual changes;
- break consistency with the modern ECS style in the project;
- increase the risk of silent regressions when changing the engine ⚠
Briefly: new code is written through SpriteSystem, not through the old component methods.
Practical examples
Example 1: Basic entity sprite setup
public void ApplyMachineLook(EntityUid uid, SpriteComponent sprite, bool highlighted)
{
// We change only the visual properties of the entity.
_sprite.SetVisible((uid, sprite), true);
_sprite.SetDrawDepth((uid, sprite), (int)DrawDepth.Machines);
_sprite.SetColor((uid, sprite), highlighted ? Color.Cyan : Color.White);
}
Example 2: layer reserve by enum key and data filling
private enum MachineLayerKey : byte
{
Base,
Status
}
public void SetStatusLayer(EntityUid uid, SpriteComponent sprite, PrototypeLayerData data)
{
// We guarantee the presence of a layer under the key.
var index = _sprite.LayerMapReserve((uid, sprite), MachineLayerKey.Status);
// We update the entire layer via PrototypeLayerData.
_sprite.LayerSetData((uid, sprite), index, data);
_sprite.LayerSetVisible((uid, sprite), index, true);
}
Example 3: Safely deleting a layer by key
public void HideStatusLayer(EntityUid uid, SpriteComponent sprite)
{
// We don’t consider the absence of a layer an error: this is a normal idempotent flow.
_sprite.RemoveLayer((uid, sprite), MachineLayerKey.Status, logMissing: false);
}
Example 4: Dynamically generati
Установить SS14 Graphics SpriteSystem в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл SS14 Graphics SpriteSystem?
An in-depth practical guide to SpriteSystem in Space Station 14: lifecycle, full API for groups of methods, working with layers and layer-map, practical patterns and anti-patterns. Use it when developing dynamic sprites, visualizer systems and refactoring outdated SpriteComponent calls.
Как установить скилл SS14 Graphics SpriteSystem?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл SS14 Graphics SpriteSystem запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic