Class: Scrollable

DKTools.Window.Scrollable

new DKTools.Window.Scrollable ()

Since:
  • 1.1.5

Extends

  • Window_Scrollable

Mixes In

Classes

Scrollable
Selectable

Methods

_clearAll () private

Clears all data

_createArrowSprites ()

_refreshArrows ()

Refreshes arrows

_updateArrows () private

initialize (object, y, width, height)

Initializes a window
Name Type Description
object Number | Graphics | Object optional The X coordinate or Graphics or object with parameters
y Number optional The Y coordinate (if object is Number)
width Number optional Width of the window (if object is Number)
height Number | String optional Height of the window or number of lines (String) (if object is Number)
object.x Number optional The X coordinate
object.y Number optional The Y coordinate
object.width Number optional Width of the window
object.height Number | String optional Height of the window or number of lines (String)
Examples
const window = new DKTools.Window.Scrollable(0, 0, 100, 100);
const window = new DKTools.Window.Scrollable(Graphics);
const window = new DKTools.Window.Scrollable({ x: 0, y: 0, width: 200, height: 200 });
const window = new DKTools.Window.Scrollable(50, 50, 400, '2');

isHorizontal ()Boolean

Returns true if the horizontal scrolling
Returns:
Type Description
Boolean Horizontal scrolling

itemHeight ()Number

Returns the height of the item
Returns:
Type Description
Number Height of the item

itemWidth ()Number

Returns the width of the item
Returns:
Type Description
Number Width of the item

onItemChange (item, lastItem)

Handles item change
Name Type Description
item * Item
lastItem * Last item

overallHeight ()Number

Returns:
Type Description
Number

overallWidth ()Number

Returns:
Type Description
Number

processPageScroll ()

Processes page scroll

processWheelScroll ()

Processes wheel scroll

setupAll (object)

Sets all parameters
Name Type Default Description
object Object {} optional Parameters
Name Type Description
itemWidth function | Number optional Width of the item
itemHeight function | Number optional Height of the item
scrollBlockWidth function | Number optional Width of the scroll block
scrollBlockHeight function | Number optional Height of the scroll block

setupItemHeight (height)

Sets the height of the item
Name Type Description
height function | Number optional Height of the item

setupItemWidth (width)

Sets the width of the item
Name Type Description
width function | Number optional Width of the item

smoothScrollLeft (cols)

Smooth scrolls to left
Name Type Description
cols Number Cols to scroll

smoothScrollRight (cols)

Smooth scrolls to right
Name Type Description
cols Number Cols to scroll

update ()

Updates the window

updateArrows ()

Updates the arrows

updateOrigin ()

Updates the origin