Options
All
  • Public
  • Public/Protected
  • All
Menu

class representing a tex

Hierarchy

Index

Constructors

constructor

  • creates a tex object

    example

    example for creating TeX object:

    let tex = new TeX(
     '\\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}', 200, 300, 28);
    

    Parameters

    Returns TeX

Properties

_size

_size: number

_strokeWidth

_strokeWidth: number

fillColor

fillColor: Color

sentence

sentence: string

strokeColor

strokeColor: Color

svgEquation

svgEquation: string

writeElement

writeElement: Element

x

x: number = 10

y

y: number = 10

Methods

add

  • add(): void

fill

  • fill(fillColor?: any): undefined | Color
  • sets fill-color of text

    Parameters

    • fillColor: any = 'black'

    Returns undefined | Color

moveTo

  • moveTo(newX: any, newY: any, startTime: any, endTime: any): void

play

  • play(animationType?: string, startTime?: number, endTime?: number): void
  • play text animation

    Parameters

    • animationType: string = 'write'

      type of animation to be played

    • startTime: number = 0
    • endTime: number = 0

    Returns void

position

  • position(x?: number, y?: number): undefined | number[]
  • sets position of tex

    Parameters

    • x: number = 10
    • y: number = 10

    Returns undefined | number[]

remove

  • remove(): void

resizeTo

  • resizeTo(newSize: any, startTime: any, endTime: any): void

size

  • size(_size?: number): undefined | number
  • sets font-size of tex

    Parameters

    • _size: number = 28

    Returns undefined | number

stroke

  • stroke(strokeColor?: any): undefined | Color
  • sets stroke-color of tex

    Parameters

    • strokeColor: any = 'black'

    Returns undefined | Color

strokeWidth

  • strokeWidth(_strokeWidth?: number): undefined | number
  • sets stroke-width of tex

    Parameters

    • _strokeWidth: number = 8

    Returns undefined | number

style

  • style(property: any, value: any): void
  • Sets the given style (css) property (1st arg) of the element with the given value (2nd arg). If the single argument is given in css syntax ('text-align:center'), .style() sets the css appropriately.

    Parameters

    • property: any

      property to be set

    • value: any

      value

    Returns void

update

  • update(_tex: any): void

Generated using TypeDoc