Skip to content

Commit 6dd9dd7

Browse files
committed
Initial commit
0 parents  commit 6dd9dd7

34 files changed

+83329
-0
lines changed

.gitignore

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
# Created by https://www.gitignore.io/api/macos,node
3+
4+
### macOS ###
5+
*.DS_Store
6+
.AppleDouble
7+
.LSOverride
8+
9+
# Icon must end with two \r
10+
Icon
11+
12+
13+
# Thumbnails
14+
._*
15+
16+
# Files that might appear in the root of a volume
17+
.DocumentRevisions-V100
18+
.fseventsd
19+
.Spotlight-V100
20+
.TemporaryItems
21+
.Trashes
22+
.VolumeIcon.icns
23+
.com.apple.timemachine.donotpresent
24+
25+
# Directories potentially created on remote AFP share
26+
.AppleDB
27+
.AppleDesktop
28+
Network Trash Folder
29+
Temporary Items
30+
.apdisk
31+
32+
### Node ###
33+
# Logs
34+
logs
35+
*.log
36+
npm-debug.log*
37+
yarn-debug.log*
38+
yarn-error.log*
39+
40+
# Runtime data
41+
pids
42+
*.pid
43+
*.seed
44+
*.pid.lock
45+
46+
# Directory for instrumented libs generated by jscoverage/JSCover
47+
lib-cov
48+
49+
# Coverage directory used by tools like istanbul
50+
coverage
51+
52+
# nyc test coverage
53+
.nyc_output
54+
55+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
56+
.grunt
57+
58+
# Bower dependency directory (https://bower.io/)
59+
bower_components
60+
61+
# node-waf configuration
62+
.lock-wscript
63+
64+
# Compiled binary addons (http://nodejs.org/api/addons.html)
65+
build/Release
66+
67+
# Dependency directories
68+
node_modules/
69+
jspm_packages/
70+
71+
# Typescript v1 declaration files
72+
typings/
73+
74+
# Optional npm cache directory
75+
.npm
76+
77+
# Optional eslint cache
78+
.eslintcache
79+
80+
# Optional REPL history
81+
.node_repl_history
82+
83+
# Output of 'npm pack'
84+
*.tgz
85+
86+
# Yarn Integrity file
87+
.yarn-integrity
88+
89+
# dotenv environment variables file
90+
.env
91+
92+
93+
# End of https://www.gitignore.io/api/macos,node

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
## Description
2+
3+
This project is an additional drawing target to Pixi.js (pixijs.com) that adds pxscene drawing in addition to WebGL and Canvas2D.
4+
5+
6+
Pixi.js Patch apply
7+
==============
8+
### Build pixi
9+
10+
(1) Clone the pixi project
11+
```
12+
git clone https://github.com/pixijs/pixi.js.git
13+
cd pixi.js
14+
git checkout bed84b9ff04cf98c536401d36841d447b74917fe
15+
```
16+
17+
(2) Copy /pxscene_pixi.patch into the repository folder (pixi.js) and patch
18+
```
19+
git apply pxscene_pixi.patch
20+
```
21+
22+
(3) Install dependencies and build pixi
23+
```
24+
npm i
25+
npm run dist -- --exclude deprecation
26+
```
27+
28+
The pixi will be built and generated in pixi.js/dist
29+
30+
## Install pxscene
31+
32+
pxscene can be downloaded from http://pxscene.org
33+
34+
## Deployment
35+
36+
Two separate projects are available:
37+
- pxPixi: for hosting pixi.js and assets (https://github.com/topcoderinc/pxPixi)
38+
- pxPixi-examples: the other for hosting examples (https://github.com/topcoderinc/pxPixi-examples)
39+
40+
The deployment instructions are easy, switch to just type the following command:
41+
```
42+
git init
43+
git add .
44+
git commit -m "init"
45+
heroku create
46+
git push heroku master
47+
```
48+
49+
**Note**:
50+
(1) If you modified and built pixi.js, please copy pixi.js/dist/* to /pixi-server/dist/pixi and update it on Heroku.
51+
(2) When you have deployed <submission>/pixi-server to Heroku, you should replace `ASSET_URL` in /example-server/dist/.js (all the example files) to the host URL of pixi-server. And also note that use the protocol to `http://` instead of `https://`.
52+
53+
54+
## Heroku examples
55+
56+
- Basic: http://pxscene-pixi-examples.herokuapp.com//basic.js
57+
- Container: http://pxscene-pixi-examples.herokuapp.com/container.js
58+
- Container Pivot: http://pxscene-pixi-examples.herokuapp.com/container-pivot.js
59+
- Spritesheet Animation: http://pxscene-pixi-examples.herokuapp.com/spritesheet.js
60+
- Click: http://pxscene-pixi-examples.herokuapp.com/click.js
61+
- Tiling Sprite: http://pxscene-pixi-examples.herokuapp.com/tiling-sprite.js
62+
- Text: http://pxscene-pixi-examples.herokuapp.com/text.js
63+
64+
Local example files are located in /example-server/dist/
65+
66+
Open pxscene and enter the URL of each example to the input box and press return, you will see the results.
67+
68+
## Limitations
69+
70+
(1) When hover on clickable object, the cursor cannot be changed in pxscene.
71+
(2) Pxscene text doesn't support stroke and gradient color. The shadow doesn't support blue effect.
72+
(3) Pxscene text doesn't support to use font family name directly. Instead, we need to design a font URL to it. So we cannot assign `BOLD` or `ITALIC` style to the text.
73+
74+
For complying with the given text usage, I added a map to mapping fontFamily names to the font URL. Please check the pixi.js/text/TextV8.js
75+
76+
```
77+
// Map: font family name -> fontUrl
78+
// Set key lowercase
79+
const fontFamilyUrlMap = {
80+
dejavusans: 'http://www.pxscene.org/examples/px-reference/fonts/DejaVuSans.ttf',
81+
arial: 'http://www.pxscene.org/examples/px-reference/fonts/DejaVuSans.ttf',
82+
};
83+
```
84+
Currently, it only supports Arial and DejaVuSans.
85+
86+
87+
## Remarks
88+
(1) If you use the example in Heroku, you may need to wait several seconds for the resource downloading.
89+
(2) For showing text, you may still need to wait several seconds because the font URL is remote.
90+
(3) The updated pixi.js supports both browsers and pxscene.

config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
/**
3+
* Port
4+
*/
5+
PORT: process.env.PORT || 3000,
6+
};

dist/assets/basic/bunny.png

449 Bytes
Loading

0 commit comments

Comments
 (0)