Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ThinSprite

ThinSprite Class used to represent a thin sprite This is the base class for sprites but can also directly be used with ThinEngine

see

https://doc.babylonjs.com/babylon101/sprites

Hierarchy

Index

Constructors

constructor

  • Creates a new Thin Sprite

    Returns ThinSprite

Properties

angleSearch playground for angle

angle: number

Gets or sets rotation angle

cellIndexSearch playground for cellIndex

cellIndex: number

Gets or sets the cell index in the sprite sheet

cellRefSearch playground for cellRef

cellRef: string

Gets or sets the cell reference in the sprite sheet, uses sprite's filename when added to sprite sheet

colorSearch playground for color

color: IColor4Like

Gets or sets the main color

heightSearch playground for height

height: number

Gets or sets the height

invertUSearch playground for invertU

invertU: boolean

Gets or sets a boolean indicating if UV coordinates should be inverted in U axis

invertVSearch playground for invertV

invertV: boolean

Gets or sets a boolean indicating if UV coordinates should be inverted in B axis

isVisibleSearch playground for isVisible

isVisible: boolean

Gets or sets a boolean indicating if the sprite is visible (renderable). Default is true

positionSearch playground for position

position: IVector3Like

Gets or sets the current world position

widthSearch playground for width

width: number

Gets or sets the width

Accessors

animationStarted

  • get animationStarted(): boolean
  • Returns a boolean indicating if the animation is started

    Returns boolean

delay

  • get delay(): number
  • Gets or sets the delay between cell changes (setting it will restart the animation)

    Returns number

fromIndex

  • get fromIndex(): number
  • Gets the initial key for the animation (setting it will restart the animation)

    Returns number

loopAnimation

  • get loopAnimation(): boolean
  • Gets or sets a boolean indicating if the animation is looping (setting it will restart the animation)

    Returns boolean

toIndex

  • get toIndex(): number
  • Gets or sets the end key for the animation (setting it will restart the animation)

    Returns number

Methods

playAnimationSearch playground for playAnimation

  • playAnimation(from: number, to: number, loop: boolean, delay: number, onAnimationEnd: Nullable<() => void>): void
  • Starts an animation

    Parameters

    • from: number

      defines the initial key

    • to: number

      defines the end key

    • loop: boolean

      defines if the animation must loop

    • delay: number

      defines the start delay (in ms)

    • onAnimationEnd: Nullable<() => void>

      defines a callback for when the animation ends

    Returns void

stopAnimationSearch playground for stopAnimation

  • stopAnimation(): void
  • Stops current animation (if any)

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method