Options
All
  • Public
  • Public/Protected
  • All
Menu

Just a point/flag/marker or whatever pointy on the board

collboard-modules-sdk

Hierarchy

Implements

Index

Constructors

Properties

appearance: IAppearance

What colors and textures are applied to the art

artId: uuid

Unique identifier of each art

defaultZIndex: number

Default z-index of art

Needs to be between 1-9 (including), otherwise it can lead to undefined behavior.

When locked, decreases by one.

Note: This will be replaced with proper object ordering in the near future, however it is highly suggested to override use property until then.

locked: boolean

Marks, whether art is locked

TODO: [✨] Maybe add is prefix

opacity?: number

Opacity of an art

Value is automatically used by ArtShell when rendering

Note: only works on 2D arts

rotation: number

Object rotation

deprecated

Make it using BoundingBox

shape: IPointShape

How the art looks inside without the colors and textures This will be different for each art Class

shift: IVectorData

Translation vector of art

deprecated

use transform property instead

manifest: { deprecatedNames: string; name: string }

Type declaration

  • deprecatedNames: string
  • name: string
serializeName: string

Accessors

  • get acceptedAttributes(): string[]
  • Returns string[]

  • get bottomLeft(): IVectorData
  • Position of bottom left corner of art (absolute including shift)

    Value is used mostly when making selection

    deprecated

    Make it using BoundingBox

    Returns IVectorData

  • get bottomRight(): IVectorData
  • Returns IVectorData

  • get color(): string
  • set color(color: string): void
  • Get the color

    deprecated

    [🐀] this is only way how to support old attribute system with the new IArt

    Returns string

  • Set the color

    deprecated

    [🐀] this is only way how to support old attribute system with the new IArt

    Parameters

    • color: string

    Returns void

  • get moduleName(): string
  • Returns string

  • get size(): IVectorData
  • set size(newSize: IVectorData): void
  • Returns IVectorData

  • Parameters

    • newSize: IVectorData

    Returns void

  • get topLeft(): IVectorData
  • Returns IVectorData

  • get topRight(): IVectorData
  • Position of top right corner of art (absolute including shift)

    Value is used mostly when making selection

    deprecated

    Make it using BoundingBox

    Returns IVectorData

  • get transform(): Transform
  • set transform(transformData: ITransformData): void
  • Get the transform which is created from a deprecated shift

    Returns Transform

  • Set the transform which is converted and saved as a deprecated shift

    Parameters

    • transformData: ITransformData

    Returns void

  • get weight(): number
  • set weight(weight: number): void
  • Get the weight

    deprecated

    [🐀] this is only way how to support old attribute system with the new IArt

    Returns number

  • Set the weight

    deprecated

    [🐀] this is only way how to support old attribute system with the new IArt

    Parameters

    • weight: number

    Returns void

Methods

  • isNear(pointToTest: IVectorData): boolean
  • Function determining, whether a point is near the art

    Default implementation uses square bounding box

    Parameters

    • pointToTest: IVectorData

    Returns boolean

  • Move art to by vector (= relative)

    deprecated

    use transform property instead

    Parameters

    • shift: IVectorData

    Returns PointArt

  • render(isSelected: boolean): Element
  • Renders the art

    Note: This can be called many times a second when user is scrolling or not at all when art is out of screen so do not do a heavy stuff here

    Parameters

    • isSelected: boolean

    Returns Element

    JSX.Element which can be in Promise This render should contain: - Root element must be which has prop of transform - material and shape should be included - When you are rendering the material you can use utils like textureToSvg

  • Move art to certain vector (= absolute)

    deprecated

    use transform property instead

    Parameters

    • shift: IVectorData

    Returns PointArt