Class: Scroller

Scroller

Scroller

new GOWN.Scroller()

Allows horizontal and vertical scrolling of a view port. Not meant to be used as a standalone container or component. Generally meant to be the super class of another component that needs to support scrolling. To put components in a generic scrollable container (with optional layout), see ScrollContainer. To scroll long passages of text, see ScrollText.

Extends

Members

staticGOWN.Scroller.INTERACTION_MOUSE

The user may only interact with the scroll bars to scroll.

staticGOWN.Scroller.INTERACTION_TOUCH

The user may touch anywhere on the scroller and drag to scroll. The scroll bars will be visual indicator of position, but they will not be interactive.

staticGOWN.Scroller.INTERACTION_TOUCH_AND_SCROLL_BARS

Allow touch and use the Scrollbars

staticGOWN.Scroller.SCROLL_POLICY_AUTO

The scroller may scroll if the view port is larger than the scroller's bounds. Only than the scroll bar will be visible.

staticGOWN.Scroller.SCROLL_POLICY_OFF

The scroller does not scroll at all, the scroll bar will never be visible.

staticGOWN.Scroller.SCROLL_POLICY_ON

The scroller will always scroll, the scroll bar will always be visible.

_clipContent

use mask to clip content

_interactionMode

the default interaction mode is drag-and-drop OR use the scrollbars

_scrollPosition

calculated horizontal and vertical scroll positions

_startScrollPosition

scroll positions at the start of an interaction (changed on touchstart/mousedown)

_startTouch

start touch/mouse position (changed on touchstart/mousedown)

_verticalScrollPolicy

scroll policy for vertical and horizontal ScrollBar (translates to x/y position of the viewport and scroll positions)

_viewPortOffset

offsets for the mask of the viewport (see this._viewport.mask)

enabledBoolean

Enables/Disables the control. (not implemented yet)

scrollInvalid

scrollInvalid will force viewport to set its x/y position according to horizontal/vertical Scroll Position next redraw

Methods

_throwToTween(targetPosition, direction, duration)

manage tween to throw to horizontal or vertical position call finishScrolling when tween reaches the end position
Name Type Description
targetPosition number target position in pixel
direction String direction ('horizontal' or 'vertical')
duration number time needed to reach target position (in ms)

createScrollBars()

Creates and adds the horizontalScrollBar and verticalScrollBar sub-components and removes the old instances, if they exist.

Meant for internal use, and subclasses may override this function with a custom implementation.

See:

inherited mousePos(){PIXI.Point}

Get the local mouse position from PIXI.InteractionData
Returns:
Type Description
PIXI.Point
update before draw call
update the rectangle that defines the clipping area

inherited setTheme(theme)

Change the theme (every control can have a theme, even if it does not inherit Skinable, e.g. if there is only some color in the skin that will be taken or if it has some skinable components as children)
Name Type Description
theme GOWN.Theme the new theme

throwTo(targetHorizontalScrollPosition, targetVerticalScrollPosition, duration)

throw the scroller to the specified position
Name Type Description
targetHorizontalScrollPosition as PIXI.Point
targetVerticalScrollPosition as PIXI.Point
duration