Skip to content

ryohey/EaselJS-ScrollContainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EaselJS-ScrollContainer

2016-05-07 18 38 56

EaselJS extension adds ScrollContainer to CreateJS.

ScrollContainer provides scroll bars and you can use as normal Container.

Usage

  1. instantiate ScrollContainer with canvas element
  2. set contentSize and bounds to calculate bar size
  3. add to stage
  4. add object to ScrollContainer by calling addChild
const scroll = new createjs.ScrollContainer(canvas)
scroll.setBounds(0, 0, 520, 300)
scroll.contentSize = {
  width: 1200,
  height: 960
}
stage.addChild(scroll)

const circle = new createjs.Shape()
circle.graphics.beginFill("DeepSkyBlue").drawCircle(0, 0, 50)
circle.x = 100
circle.y = 100
scroll.addChild(circle)

Features

  • Shows scroll bar like Windows 10
  • Scroll by the mouse wheel
  • Scroll by bar dragging