Skip to content

Commit 7996ee9

Browse files
committed
published 2.0.0
1 parent 0c7cb06 commit 7996ee9

24 files changed

+1676
-49847
lines changed

README.md

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,50 +13,64 @@ Features:
1313
## Rationale
1414
I needed a scrollbox for the UI of my game and since I had this nifty pixi-viewport, I figured it wouldn't be much work to create it. Five hours later and I realized I was a bit off on my estimates. Hopefully others will find it useful.
1515

16+
## Migration from v1 to v2
17+
Scrollbox no longer exports a default object. Instead you need to use:
18+
19+
```js
20+
const Scrollbox = require('pixi-scrollbox').Scrollbox
21+
```
22+
or
23+
```js
24+
import { Scrollbox } from 'pixi-scrollbox'
25+
```
26+
There were some minor name changes to the fade options. See documentation.
27+
1628
## Simple Example
1729
```js
18-
var PIXI = require('pixi.js');
19-
var Viewport = require('pixi-scrollbox');
30+
const PIXI = require('pixi.js')
31+
const Scrollbox = require('pixi-scrollbox').Scrollbox
2032

2133
// create the scrollbox
22-
var scrollbox = new Scrollbox({ boxWidth: 200, boxHeight: 200});
34+
const scrollbox = new Scrollbox({ boxWidth: 200, boxHeight: 200})
2335

2436
// add a sprite to the scrollbox's content
25-
var sprite = scrollbox.content.addChild(new PIXI.Sprite(PIXI.Texture.WHITE));
26-
sprite.width = sprite.height = 500;
27-
sprite.tint = 0xff0000;
37+
const sprite = scrollbox.content.addChild(new PIXI.Sprite(PIXI.Texture.WHITE))
38+
sprite.width = sprite.height = 500
39+
sprite.tint = 0xff0000
2840

2941
// add the viewport to the stage
30-
var app = new PIXI.Application();
31-
document.body.appendChild(app.view);
32-
app.stage.addChild(scrollbox);
42+
const app = new PIXI.Application()
43+
document.body.appendChild(app.view)
44+
app.stage.addChild(scrollbox)
3345
```
3446

35-
## Usage
36-
47+
## Installation
3748
```
38-
npm i pixi-scrollbox pixi-viewport
49+
npm i pixi-scrollbox pixi-viewport pixi.js
3950
```
4051
or
4152
```
42-
yarn add pixi-scrollbox pixi-viewport
53+
yarn add pixi-scrollbox pixi-viewport pixi.js
4354
```
4455

45-
Note: pixi-viewport and pixi.js are listed as peerDependency, which means you will need to manually install them if they're not already installed (this is to ensure you don't have two versions of these libraries). My instructions above assume you have pixi.js installed (otherwise why would you be looking at this library).
56+
Note: pixi-viewport and pixi.js are listed as peerDependency, which means you will need to manually install them if they're not already installed (this is to ensure you don't have two versions of these libraries).
4657

4758
or [download the latest build from github](https://github.com/davidfig/pixi-scrollbox/releases)
4859
```html
4960
<script src="/external-directory/pixi.js"></script>
50-
<script src="/external-directory/pixi-viewport.min.js"></script>
51-
<script src="/external-directory/scrollbox.min.js"></script>
61+
<script src="/external-directory/pixi-viewport.js"></script>
62+
<script src="/external-directory/scrollbox.js"></script>
5263
<script>
53-
var Scrollbox = new PIXI.extras.Scrollbox(options);
64+
const Scrollbox = new Scrollbox(options)
5465
</script>
5566
```
5667

5768
## API Documentation
5869
[https://davidfig.github.io/pixi-scrollbox/jsdoc/](https://davidfig.github.io/pixi-scrollbox/jsdoc/)
5970

71+
## Buy me Coffee
72+
If you use my open source libraries, please consider supporting my efforts at https://patreon.com/davidfig. Even small amounts help!
73+
6074
## license
6175
MIT License
62-
(c) 2018 [YOPEY YOPEY LLC](https://yopeyopey.com/) by [David Figatner](https://twitter.com/yopey_yopey/)
76+
(c) 2019 [YOPEY YOPEY LLC](https://yopeyopey.com/) by [David Figatner](https://twitter.com/yopey_yopey/)

0 commit comments

Comments
 (0)