Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CanvasRender

Class responsible for rendering the Canvas book

Hierarchy

Index

Constructors

constructor

Methods

clearShadow

  • clearShadow(): void

convertRectToGlobal

  • Casting the coordinates of the corners of the rectangle in the coordinates relative to the window

    Parameters

    • rect: RectPoints

      Coordinates of the corners of the rectangle relative to the work page

    • Optional direction: FlipDirection

      Current flipping direction

    Returns RectPoints

    Coordinates of the corners of the rectangle relative to the window

convertToBook

  • Coordinate conversion function. Window coordinates -> to book coordinates

    Parameters

    • pos: Point

      Global coordinates relative to the window

    Returns Point

    Coordinates relative to the book

convertToGlobal

  • Coordinate conversion function. Coordinates relative to the work page -> Window coordinates

    Parameters

    • pos: Point

      Coordinates relative to the work page

    • Optional direction: FlipDirection

      Current flipping direction

    Returns Point

    Global coordinates relative to the window

convertToPage

  • Coordinate conversion function. Window coordinates -> to current coordinates of the working page

    Parameters

    • pos: Point

      Global coordinates relative to the window

    • Optional direction: FlipDirection

      Current flipping direction

    Returns Point

    Coordinates relative to the work page

finishAnimation

  • finishAnimation(): void

getBlockHeight

  • getBlockHeight(): number

getBlockWidth

  • getBlockWidth(): number

getContext

  • getContext(): CanvasRenderingContext2D

getDirection

getOrientation

getRect

getSettings

isSafari

  • isSafari(): boolean

setBottomPage

  • setBottomPage(page: Page): void

setDirection

setFlippingPage

  • setFlippingPage(page: Page): void

setLeftPage

  • setLeftPage(page: Page): void

setPageRect

setRightPage

  • setRightPage(page: Page): void

setShadowData

  • setShadowData(pos: Point, angle: number, progress: number, direction: FlipDirection): void
  • Set the current parameters of the drop shadow

    Parameters

    • pos: Point

      Shadow Position Start Point

    • angle: number

      The angle of the shadows relative to the book

    • progress: number

      Flipping progress in percent (0 - 100)

    • direction: FlipDirection

      Flipping Direction, the direction of the shadow gradients

    Returns void

start

  • start(): void

startAnimation

update

  • update(): void

Generated using TypeDoc