APIs

Show:

Scene Editor Backbone view

Constructor

SceneEditorView

() Object

Returns:

Object:

instantiated the SceneEditorView

Methods

_blockSelected

(
  • i_block
)

Select a block object on the canvas

Parameters:

  • i_block Object

_canvasDiscardSelections

()

Deselect current group and or block selections

_createBlock

(
  • [i_blockIDs]
)

Create all the blocks that have been pre injected to m_blocks.blocksPre and after each block is created created the next block; thus creating blocks sequentially due to fabric bug. When no more blocks are to be created (m_blocks.blocksPre queue is empty) we _render the canvas

Parameters:

  • [i_blockIDs] Array optional

    optional array of block ids to render, or non if we render the entire canvas

_delegateSceneBlockModified

()

Announce to all that scene was re-rendered but do it via debounce

_disposeBlocks

(
  • [i_blockID]
)

Remove all block instances

Parameters:

  • [i_blockID] Number optional

    optional to remove only a single block

_initDimensionProps

()

Init the dimension props class

_initializeBlockFactory

()

Init block factory if it hasn't already been loaded

_initializeBlockFactory

()

Init block factory if it hasn't already been loaded

_initializeCanvas

(
  • w
  • h
)

Init a new canvas and listen to even changes on that new canvas

Parameters:

  • w Number

    width

  • h Number

    height

_initializeScene

()

Init a new scene and subclass off a standard Block

_listenAddBlockWizard

(
  • e
)

Listen to and add new component / resources to scene

Parameters:

  • e Event

_listenAppResized

()

Listen to when the app is resized so we can re-render

_listenBlockModified

()

Listen to changes in scale so we can reset back to non-zoom on any block object

_listenCanvasSelections

()

Listen to canvas user selections

_listenCanvasSelectionsFromToolbar

()

Listen to scene block / item selection initiated by user selection of toolbar dropdown

_listenContextMenu

()

Listen to any canvas right click

_listenGridMagnet

()

Listen grid magnet when dragging objects

_listenKeyboard

()

Listen to keyboard events

_listenMemento

()

Listen to undo and redo

_listenMouseEnterCanvas

()

Listen when mouse enters canvas wrapper and announce it

_listenPushToBottom

()

Listen to re-order of screen division, putting selected at bottom

_listenPushToTop

()

Listen to re-order of screen division, putting selected on top

_listenSceneBlockRemove

()

Listen to when a user selects to delete a block

_listenSceneChanged

()

Listen to the event of scene changes which normally comes from a block that modified its data and re-render all scene content

_listenSceneNew

()

Listen to user selection of new scene

_listenSceneRemove

()

Listen to when a user selects to delete a scene

_listenSceneSelection

()

Listen to changes in a new scene selection

_listenSceneViewStackSelected

()

Listen to when a new scene is selected via Slider View

_listenSelectNextDivision

()

Listen to selection of next block

_listenStackViewSelected

()

Anytime the containing StackView is selected, re-render removed while we were gone

_listenToCanvasScroll

()

Listen to canvas scrolling

_listenZoom

()

Listen to all zoom events via wiring the UI

_mementoAddState

()

Remember current memento state

_mementoInit

() Boolean

Init a undo / redo via memento pattern

Returns:

Boolean:

return true if memento created false if one already existed

_mementoLoadState

()

Remember current memento state

_onContentMenuSelection

(
  • i_command
)

On Scene right click context menu selection command

Parameters:

  • i_command String

_preRender

(
  • i_domPlayerData
  • [i_blockIDs]
)

Pre render creates all of the Fabric blocks that will later get added when we call _render This allows for smooth (non flickering) rendering since when we are ready to render, the blocks have already been instantiated and ready to be added to canvas

Parameters:

  • i_domPlayerData Object
  • [i_blockIDs] Object optional

    optionally render only a single block

_render

()

Render the pre created blocks (via _preRender) and add all blocks to fabric canvas

_renderContinue

()

Allow rendering of canvas to continue and add canvas listeners

_renderPause

()

Prevent rendering of canvas to continue and remove canvas listeners

_resetAllObjectScale

()

Reset all canvas objects to their scale is set to 1

_resetObjectScale

()

Reset a canvas object so its scale is set to 1

_sceneActive

()

Bring the scene into view

_sceneBlockMoving

(
  • i_options
)

Scene block moving

Parameters:

  • i_options Object

_sceneBlockScaled

(
  • e
)

Scene block scales via mouse UI

Parameters:

  • e Event

_sceneCanvasSelected

()

Set the scene (i.e.: Canvas) as the selected block

_sceneProcessing

()

_scrollTo

(
  • i_top
  • i_left
)

Scroll canvas to set position

Parameters:

  • i_top Number
  • i_left Number

_updateBlockCords

(
  • blockID
  • i_calcScale
  • x
  • y
  • w
  • h
)

Update the coordinates of a block in pepper db, don't allow below w/h MIN_SIZE

Parameters:

  • blockID String
  • i_calcScale Boolean
  • x Number
  • y Number
  • w Number
  • h Number

_updateZorder

(
  • i_pushDirection
  • i_block
)

Update the z-order index of an object

Parameters:

  • i_pushDirection String
  • i_block Object

_zoomIn

()

Zoom scene in

_zoomIn

()

Zoom scene in

_zoomOut

()

Zoom scene out

_zoomOut

()

Zoom scene out

_zoomReset

()

Zoom reset back to scale 1

_zoomTo

(
  • nZooms
)

Zoom to scale size

Parameters:

  • nZooms Number

_zoomTo

(
  • nZooms
)

Zoom to scale size

Parameters:

  • nZooms Number

createScene

(
  • i_scenePlayerData
)

Create a new scene based on player_data and strip injected IDs if arged

Parameters:

  • i_scenePlayerData String

disposeScene

()

Remove a Scene and cleanup after

getSelectedSceneID

() Number

Get currently selected scene id

Returns:

Number:

scene id

initialize

()

Constructor

self._updateBlockCount();

()

Announce that block count changed with block array of ids