Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ryohey/easeljs-scrollcontainer

Scrollable Container in CreateJS
https://github.com/ryohey/easeljs-scrollcontainer

Last synced: about 1 month ago
JSON representation

Scrollable Container in CreateJS

Awesome Lists containing this project

README

        

# EaselJS-ScrollContainer

![2016-05-07 18 38 56](https://cloud.githubusercontent.com/assets/5355966/15091406/45bd814c-1483-11e6-8ca8-24e80be7efeb.png)

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`

```js
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