Skip to main content

AssetLayerDefinition

Properties common to groups, assets and layers

Those properties will be inherited by default from layer, to asset, to group. Defining it will override the parent's value altogether.

Hierarchy

Index

Properties

optionalAllowColorize

AllowColorize?: boolean = true Set to `true`, the target will be colorized when drawing. Set to `false`, the color will be used as part of the image file name. Mainly useful for inheriting the body color around.

Whether that layer is colorized

optionalAllowPose

AllowPose?: never

The poses that have pose-specific assets.

Used when building the file paths for the asset's layers.

If a pose is absent then the asset corresponding to the default pose will be used in its place. Note that a pose's absence from this list does not prevent its usage.

@deprecated
  • Superceded by PoseMapping

optionalAllowTypes

AllowTypes?: Definition

A record (or a list thereof) with all screen names + option indices that should make the layer visible

optionalAlpha

Alpha?: Definition[]

A list of alpha mask definitions.

optionalBlendingMode

BlendingMode?: GlobalCompositeOperation

Set canvas globalCompositeOperation for current layer. Use "destination-in" if you want to use layer as an alpha mask. Note that game uses WebGL when available, so you might need to implement similar blending mode if it's not done already (currently in GLDrawImage() in GLDraw.js).

optionalColorGroup

ColorGroup?: string

The color group that layer is part of. Layers part of the same color group get a selector in the Color Picker UI

optionalColorSuffix

ColorSuffix?: Record<string, string>

optionalCopyLayerColor

CopyLayerColor?: string

Uses the color of the named layer.

optionalCreateLayerTypes

CreateLayerTypes?: string[]

optionalFixedPosition

FixedPosition?: boolean

Whether the asset is drawn at an absolute position.

optionalHasImage

HasImage?: boolean

Whether the layer uses an image. Defaults to true.

optionalHideAs

HideAs?: { Asset?: string; Group: AssetGroupName }

Type declaration

optionalHideColoring

HideColoring?: boolean

Whether the layer is hidden in the Color Picker UI. Defaults to false.

optionalHideForAttribute

HideForAttribute?: AssetAttribute[]

optionalHideForPose

HideForPose?: never

A list of poses that hide the asset when they get set.

Note that this does not prevent usage of the pose (see AssetDefinition.AllowActivePose). Values are automatically added to Asset.AllowPose.

@deprecated

optionalInheritColor

InheritColor?: AssetGroupName

The group the target should inherit its color from.

optionalLeft

Left?: Definition

The left coordinate of the target draw rect or a record with pose-specific left coordinates.

@example
Left: {
[PoseType.Default]: 100,
Kneeling: 150,
},

optionalLockLayer

LockLayer?: boolean

Specify that this is (one of) the asset's lock layer.

Allows for the manual specification lock layers as opposed to AssetDefinition.AllowLock's automatic assignment.

optionalMaxOpacity

MaxOpacity?: number

optionalMinOpacity

MinOpacity?: number

optionalMirrorExpression

MirrorExpression?: AssetGroupName

optionalName

Name?: string

The layer's name

optionalOpacity

Opacity?: number

optionalParentGroup

ParentGroup?: AssetGroupName

A group identifier that will be used to inherit the body size

optionalPoseMapping

PoseMapping?: Partial<Record<AssetPoseName, AssetPoseName | PoseType>>

A record mapping pose names to the actually to-be drawn poses. Special values can be specified, via use of PoseType, for either hiding the asset or using pose-agnostic assets.

Poses that are absent from the mapping (or whose value is set to PoseType.DEFAULT) will use the default pose-agnostic path.

optionalPriority

Priority?: number

The drawing priority of the target

optionalShowForAttribute

ShowForAttribute?: AssetAttribute[]

optionalTop

The top coordinate of the target draw rect or a record with pose-specific top coordinates.

@example
Top: {
[PoseType.Default]: 100,
Kneeling: 150,
},

optionalVisibility

Visibility?: Player | AllExceptPlayerDialog | Others | OthersExceptDialog | Owner | Lovers | Mistresses

This can be used to make a layer invisible depending on certain conditions, provided the AssetDefinition.LayerVisibility is set correctly.

Here's what each option means:

  • Player: Invisible to the player.
  • AllExceptPlayerDialog: Invisible to the player when in a dialog.
  • Others: Invisible to others.
  • OthersExceptDialog: Invisible to others in a dialog.
  • Owner: Invisible to your owner.
  • Lovers: Invisible to your lovers.
  • Mistresses: Invisible to club mistresses.