Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SnapPuzzleGame

Puzzle game

Hierarchy

  • SnapPuzzleGame

Index

Properties

Protected disabled

disabled: boolean

Disabled state

Protected element

element: JQuery

Root element of the plugin

Protected imageHeight

imageHeight: number

Height of the image

Protected imageWidth

imageWidth: number

Width of the image

Protected options

Current options

Protected pendingPieces

pendingPieces: SnapPuzzlePiece[]

Pending pieces

Protected pieceHeight

pieceHeight: number

Height for each piece

Protected pieceWidth

pieceWidth: number

Width for each piece

Protected pieces

pieces: SnapPuzzlePiece[]

All the SnapPuzzlePieces that conforms the puzzle

Protected piecesContainerEl

piecesContainerEl: JQuery

Jquery element that will contain all the pieces

Protected piecesEls

piecesEls: JQuery

Jquery object with all the pieces

Protected piecesMatrix

piecesMatrix: SnapPuzzlePiece[][]

All the SnapPuzzlePieces as matrix

Protected resizeTimeout

resizeTimeout: any

Control of the resize event

Protected slotsContainerEl

slotsContainerEl: JQuery

Jquery element that will contain all the slots

Protected slotsEls

slotsEls: JQuery

Jquery object with all the slots

Protected src

src: string

Source of the image

Protected wrapperEl

wrapperEl: JQuery

Wrapper element for the widget.

Methods

Protected _applyClassModifiers

  • _applyClassModifiers(): void

Private _complete

  • _complete(): void
  • Mark the widget as completed Triggers the [[SnapPuzzleEvents.end]] event

    Returns void

Private _construct

  • _construct(): void

Protected _constructPiece

Protected _create

  • _create(): void

Protected _createPiece

  • _createPiece(x: any, y: any): JQuery

Protected _createPiecesContainer

  • _createPiecesContainer(): JQuery

Protected _createSlot

  • _createSlot(x: any, y: any): JQuery

Protected _createSlotsContainer

  • _createSlotsContainer(): JQuery

Protected _createWrapper

  • _createWrapper(): JQuery

Protected _destroy

  • _destroy(): void
  • Internal destroy. Only destroys the markup and events, the instance of the widget still remains. Used to recreate the widget

    Returns void

Protected _getCreateOptions

Protected _onDrop

  • _onDrop(e: any, ui: any): void
  • Invoked when a piece is dropped inside of the pieces container. Resets the classes

    Parameters

    • e: any
    • ui: any

    Returns void

Protected _onNativeResize

  • _onNativeResize(): void

Protected _onPieceDrop

  • Invoked when a piece is placed. If the piece is correct, increment the completed counter. When all the pieces are placed correctly, triggers the [[SnapPuzzleEvents.end]] event

    Parameters

    Returns void

Protected _onResize

  • _onResize(): void
  • Invoked when the wrapper dimensions changes. Updates the pieces and slots

    Returns void

Protected _resolveDimensions

  • _resolveDimensions(): void

Protected _setOptions

  • _setOptions(options: any): void

Protected _throttleResize

  • _throttleResize(): void

destroy

  • destroy(): void

disable

  • disable(): void

enable

  • enable(): void

refresh

  • refresh(): void

reset

  • reset(trigger?: boolean): void

solve

Generated using TypeDoc