Skip to main content
Version: 4.3.1

Renderer

class Renderer

A component that manages Panel and its elements

Constructor

new Renderer(options, options.align)
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
optionsobject✔️{}An options object
options.alignConstants.ALIGN | string | number✔️An align value that will be applied to all panels

Properties

panels

readonly

Array of panels

Type: Array<Panel>

See:

panelCount

readonly

Count of panels

Type: number

align

A Panel's align value that applied to all panels

Type: Constants.ALIGN | string | number

Methods

render

Render panel elements inside the camera element

Returns: this

init

Initialize Renderer

Returns: this

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
flickingFlickingAn instance of Flicking

destroy

Destroy Renderer and return to initial state

Returns: void

getPanel

Return the Panel at the given index. null if it doesn't exists.

Returns: Panel | null

  • Panel at the given index
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
indexnumber

See:

updatePanelSize

Update all panel sizes

Returns: this

batchInsert

Insert new panels at given index
This will increase index of panels after by the number of panels added

Returns: Array<Panel>

  • An array of prepended panels
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
indexnumberIndex to insert new panels at
elementsArray<any>An array of element or framework component with element in it

batchRemove

Remove the panel at the given index
This will decrease index of panels after by the number of panels removed

Returns: Panel[]

  • An array of removed panels
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
indexnumberIndex of panel to remove
deleteCountnumber✔️1Number of panels to remove from index

checkPanelContentsReady

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
checkingPanelsPanel[]
⚠️ This function is for internal use only.