Autotiles are a new asset type with a tab that shows every tile of the floor (2x3) or wall (2x2) block and an animated sample pattern (#118)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c17b2b5426
commit
1a9f07c4ac
24 files changed
+1797
-18
No files matched your search
@@ -20,6 +20,7 @@ import {
|
||||
type VariableKind,
|
||||
} from './kinds';
|
||||
import { findAssetOf, type Project } from '../model/Project';
|
||||
import { AUTOTILE_FPS_KEY, AUTOTILE_KIND_KEY, AUTOTILE_PLAYBACK_KEY } from '../model/autotile';
|
||||
import { SLICE_SCALE_KEY } from '../model/texture';
|
||||
import type { SceneObject } from '../model/SceneObject';
|
||||
import { flatListOf, listItemOf } from './listItems';
|
||||
@@ -217,6 +218,32 @@ const ASSET_SCHEMAS: Record<AssetType, PropertySchema> = {
|
||||
],
|
||||
},
|
||||
],
|
||||
// The pictures are intrinsic data on the asset (see AutotileAsset); these three say what the
|
||||
// block holds and how its steps run. There is no tile size: a block is two tiles wide, so the
|
||||
// picture already says it (see `readAutotile`).
|
||||
autotile: [
|
||||
{
|
||||
key: AUTOTILE_KIND_KEY,
|
||||
label: 'Kind',
|
||||
kind: 'enum',
|
||||
default: 'floor',
|
||||
options: [
|
||||
{ value: 'floor', label: 'Floor (2 × 3)' },
|
||||
{ value: 'wall', label: 'Wall (2 × 2)' },
|
||||
],
|
||||
},
|
||||
{ key: AUTOTILE_FPS_KEY, label: 'Frames per second', kind: 'number', default: 4, min: 0.1, max: 120 },
|
||||
{
|
||||
key: AUTOTILE_PLAYBACK_KEY,
|
||||
label: 'Playback',
|
||||
kind: 'enum',
|
||||
default: 'loop',
|
||||
options: [
|
||||
{ value: 'loop', label: 'Loop' },
|
||||
{ value: 'pingpong', label: 'Ping-pong' },
|
||||
],
|
||||
},
|
||||
],
|
||||
// Behaviors declare their own properties (variables) per asset too – see `schemaForAsset`.
|
||||
behavior: [{ key: 'runInEditor', label: 'Run in editor', kind: 'boolean', default: false }],
|
||||
// Every row is declared on the asset itself – see `schemaForBag`.
|
||||
|
||||
Reference in new issue
Block a user