Options
All
  • Public
  • Public/Protected
  • All
Menu

Art rendering a given HTML content

Warning: HTML is dangerously set inside a div element, please sanitize the content of any malicious scripts before creating art!

collboard-modules-sdk

Hierarchy

Index

Constructors

  • new HTMLArt(content: string, scale?: number): HTMLArt
  • Parameters

    • content: string

      HTML content as string

    • Optional scale: number

      rescale after measuring

    Returns HTMLArt

Properties

artId: uuid

Unique identifier of each art

content: string
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

originalSize: Vector

Readonly property containing information about object's original size

rotation: number

Object rotation

deprecated

Make it using BoundingBox

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(): Vector
  • Returns Vector

  • get measured(): boolean
  • Was the art already measured?

    Returns boolean

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

  • Parameters

    • size: 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

Methods

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

    Default implementation uses square bounding box

    deprecated

    Make it using BoundingBox - just only provide BoundingBoxand the calling will look like art.boundingBox.isNear(...)

    Parameters

    • pointToTest: IVectorData

    Returns boolean

  • measure(element: null | HTMLElement, update?: () => void): Promise<void>
  • Measure the object and set privateSize and originalSize

    Parameters

    • element: null | HTMLElement
    • Optional update: () => void
        • (): void
        • Returns void

    Returns Promise<void>

  • Move art to by vector (= relative)

    deprecated

    use transform property instead

    Parameters

    • shift: IVectorData

    Returns HTMLArt

  • render(isSelected: boolean, systems: ISystemsExtended): Element
  • Function called when object needs to be rendered on screen

    Parameters

    • isSelected: boolean
    • systems: ISystemsExtended

    Returns Element

  • renderBox(): Element
  • Function called when object needs to be rendered on screen This is an abstract wrapper over Abstract2dArt's render

    Returns Element

  • setShift(shift: IVectorData): HTMLArt
  • Move art to certain vector (= absolute)

    deprecated

    use transform property instead

    Parameters

    • shift: IVectorData

    Returns HTMLArt