xiaohongshu
xiaohongshu
board-sdk
This skill should be used when the user asks about "touch input", "BoardInput", "BoardContact", "piece detection", "glyph", "glyph recognition", "simulator", "Board hardware", "contact phases", "Piece Set", "touch system", "Board SDK", "multi-touch", "noise rejection", or discusses Board hardware...
Full skill instructions
Expert knowledge of the Board SDK for Unity, enabling touch input, piece detection, and hardware integration for the Board multi-touch display.
Board is a specialized multi-touch display with:
| Type | Value | Description |
|---|---|---|
| Finger | 0 | Standard touch point from a finger |
| Glyph | 1 | Contact from a physical Piece with conductive pattern |
| Blob | 2 | Reserved for future use |
| Phase | Value | Description |
|---|---|---|
None | 0 | Default state, no activity |
Began | 1 | Contact started this frame |
Moved | 2 | Position or orientation changed |
Ended | 3 | Lifted from surface |
Canceled | 4 | Tracking interrupted |
Stationary | 5 | Held in place, no change |
IMPORTANT: Handle Stationary in addition to Began/Moved/Ended. A glyph placed directly without movement triggers Began then Stationary (not Moved). This is critical for piece placement detection.
.tflite ML file for recognizing a Piece SetPrimary input API for contacts and glyphs:
using Board.Input;
// Get all active contacts of a type
BoardContact[] fingers = BoardInput.GetActiveContacts(BoardContactType.Finger);
BoardContact[] pieces = BoardInput.GetActiveContacts(BoardContactType.Glyph);
// Get all contacts regardless of type
BoardContact[] all = BoardInput.GetActiveContacts();
| Property | Type | Description |
|---|---|---|
contactId | int | Unique contact ID (persistent during lifecycle) |
screenPosition | Vector2 | Current position in screen pixels (1920×1080) |
previousScreenPosition | Vector2 | Position in previous frame |
bounds | Rect | Screen-space bounding rect |
phase | BoardContactPhase | Current lifecycle state |
type | BoardContactType | Finger, Glyph, or Blob |
timestamp | double | When contact began/mutated (Time.realtimeSinceStartup) |
orientation | float | Rotation in radians clockwise from vertical (Glyph only) |
previousOrientation | float | Orientation in previous frame (Glyph only) |
isTouched | bool | Finger touching the Piece (Glyph only) |
glyphId | int | Piece index 0 to N-1 (Glyph only) |
isInProgress | bool | True for Began, Moved, Stationary |
isNoneEndedOrCanceled | bool | True for None, Ended, Canceled |
Note: Screen origin (0,0) is bottom-left. Convert orientation to degrees: float degrees = orientation * Mathf.Rad2Deg;
Manage player profiles and sessions:
using Board.Session;
// Get current players
var players = BoardSession.GetPlayers();
foreach (var player in players)
{
string name = player.Name;
Texture2D avatar = player.Avatar;
}
System integration features:
using Board.Core;
// Show pause screen
BoardApplication.ShowPauseScreen();
// Check if paused
bool isPaused = BoardApplication.IsPaused;
Persistent storage per player:
using Board.Save;
// Save game data
BoardSaveGameManager.Save("slot1", saveData);
// Load game data
var loaded = BoardSaveGameManager.Load("slot1");
InputManager.cs is the ONLY file that imports Board.Input:
namespace ZeroDayAttack.Input
{
using Board.Input;
public class InputManager : MonoBehaviour
{
public static InputManager Instance { get; private set; }
// Events for other systems
public event Action<BoardContact> OnContactBegan;
public event Action<BoardContact> OnContactMoved;
public event Action<BoardContact> OnContactEnded;
void Update()
{
var contacts = BoardInput.GetActiveContacts();
foreach (var contact in contacts)
{
switch (contact.phase)
{
case BoardContactPhase.Began:
OnContactBegan?.Invoke(contact);
break;
case BoardContactPhase.Moved:
OnContactMoved?.Invoke(contact);
break;
case BoardContactPhase.Stationary:
// IMPORTANT: Handle Stationary for pieces placed without movement
OnContactStationary?.Invoke(contact);
break;
case BoardContactPhase.Ended:
OnContactEnded?.Invoke(contact);
break;
}
}
}
}
}
TokenManager.cs subscribes to InputManager events:
void Start()
{
InputManager.Instance.OnContactBegan += HandleContactBegan;
}
void HandleContactBegan(BoardContact contact)
{
if (contact.type == BoardContactType.Glyph)
{
// Map glyph to token
var token = MapGlyphToToken(contact.glyphId);
// Convert screen to world position
Vector3 worldPos = Camera.main.ScreenToWorldPoint(
new Vector3(contact.screenPosition.x, contact.screenPosition.y, 10));
// Snap to nearest edge node
SnapTokenToNode(token, worldPos);
}
}
Test without hardware using Board's Simulator:
To test glyph/piece detection in the simulator:
Create Simulation Icons: For each piece type, create a BoardContactSimulationIcon ScriptableObject
Configure Palette: Add icons to the simulator palette
GlyphId Mapping: Ensure TokenDatabase GlyphIds match simulation icon GlyphIds
Token in TokenDatabase Simulation Icon GlyphId
───────────────────── ─────────────────────────
Red Attack (GlyphId: 1) → SimIcon_RedAttack (1)
Red Exploit (GlyphId: 2) → SimIcon_RedExploit (2)
...
Troubleshooting: If glyphs are not detected, verify GlyphId values match between TokenDatabase entries and simulation icons.
// Board SDK provides screen pixels (origin bottom-left)
Vector2 screenPos = contact.screenPosition;
// Convert to world coordinates
Vector3 worldPos = Camera.main.ScreenToWorldPoint(
new Vector3(screenPos.x, screenPos.y, 10));
// World position to grid coordinates
int gridX = Mathf.FloorToInt((worldPos.x - LayoutConfig.GridLeft) / LayoutConfig.TileSize);
int gridY = Mathf.FloorToInt((worldPos.y - LayoutConfig.GridBottom) / LayoutConfig.TileSize);
Map Board SDK glyph IDs to game tokens:
// In TokenDatabase or TokenManager
Dictionary<int, TokenData> glyphToToken = new()
{
{ 1, redAttack },
{ 2, redExploit },
{ 3, redGhost },
{ 4, blueAttack },
{ 5, blueExploit },
{ 6, blueGhost }
};
When using Unity UI on Board, you must use BoardUIInputModule instead of InputSystemUIInputModule:
Why Required: Board SDK intercepts touch input before Unity's standard input system. Without this, UI elements won't respond to touch.
Setup:
InputSystemUIInputModule componentBoardUIInputModule component// In scene hierarchy:
// EventSystem
// └─ BoardUIInputModule (instead of InputSystemUIInputModule)
See vendor-docs/reference/Board.Input.md for full API details.
Keep Board SDK imports isolated to InputManager:
Always convert coordinates:
Track contacts properly:
contactId on BeganMoved or StationaryEnded or CanceledisInProgress helper to check if contact is activeUse isTouched for gameplay:
true = piece being held/moved by playerfalse = piece resting on surfaceThis skill's references/ folder contains complete SDK documentation organized for efficient navigation.
| File | Contains | Read When |
|---|---|---|
contact-handling.md | BoardContact struct properties, phase enum values, lifecycle | Need exact property names or values |
glyph-detection.md | GlyphId mapping, TokenDatabase setup, .tflite model config | Setting up piece detection |
integration-patterns.md | Zero-Day Attack specific patterns, InputManager isolation | Implementing input handling |
sample-code-guide.md | SDK sample BoardInputManager walkthrough, Dictionary tracking | Learning contact lifecycle patterns |
save-system.md | BoardSaveGameManager usage, metadata, storage quotas | Implementing save/load functionality |
session-management.md | BoardSession player handling, profile vs guest modes | Working with player profiles |
simulator-setup.md | BoardContactSimulationIcon configuration, palette setup | Testing without hardware |
vendor-docs-index.md | Complete index of all 26 vendor docs with descriptions | Need to dive deeper into SDK API |
vendor-docs/)For complete SDK API details, see vendor-docs-index.md. Organized by category:
| Category | Files | Key Content |
|---|---|---|
| get-started/ | 4 | Installation, project-setup, build-deploy, sample-scene |
| learn/ | 5 | architecture, concepts, hardware, pieces, touch-system |
| guides/ | 6 | touch-input, simulator, pause-menu, player-management, profile-switcher, save-game-system |
| reference/ | 10 | Board.Input.md (575 lines), Board.Core.md, Board.Session.md, Board.Save.md, enums, delegates |
| Namespace | Reference File | Key Classes |
|---|---|---|
Board.Input | Board.Input.md | BoardInput, BoardContact, BoardInputSettings |
Board.Input.Debug | Board.Input.Debug.md | BoardInputDebugView, BoardContactDebugView |
Board.Input.Simulation | Board.Input.Simulation.md | BoardContactSimulation, BoardContactSimulationIcon |
Board.Core | Board.Core.md | BoardApplication, BoardLogger, BoardPlayer |
Board.Session | Board.Session.md | BoardSession, BoardSessionPlayer |
Board.Save | Board.Save.md | BoardSaveGameManager, BoardSaveGameMetadata |
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience