|
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 |
| -## Heroku examples |
54 |
| - |
55 |
| -- Basic: http://pxscene-pixi-examples.herokuapp.com/basics/basic.js |
56 |
| -- Container: http://pxscene-pixi-examples.herokuapp.com/basics/container.js |
57 |
| -- Container Pivot: http://pxscene-pixi-examples.herokuapp.com/basics/container-pivot.js |
58 |
| -- Spritesheet Animation: http://pxscene-pixi-examples.herokuapp.com/basics/spritesheet.js |
59 |
| -- Click: http://pxscene-pixi-examples.herokuapp.com/basics/click.js |
60 |
| -- Tiling Sprite: http://pxscene-pixi-examples.herokuapp.com/basics/tiling-sprite.js |
61 |
| -- Text: http://pxscene-pixi-examples.herokuapp.com/basics/text.js |
62 |
| -- Textured Mesh: http://pxscene-pixi-examples.herokuapp.com/basics/textured-mesh.js |
63 |
| -- Graphics: http://pxscene-pixi-examples.herokuapp.com/basics/graphics.js |
64 |
| -- Render Texture: http://pxscene-pixi-examples.herokuapp.com/basics/render-texture.js |
65 |
| -- Display Z Order: http://shrouded-castle-71808.herokuapp.com/display/z-order.js |
66 |
| -- Layers Z Order: http://shrouded-castle-71808.herokuapp.com/layers/z-order.js |
67 |
| -- Layers Lighting: http://shrouded-castle-71808.herokuapp.com/layers/lighting.js |
68 |
| -- Spine Dragon: http://shrouded-castle-71808.herokuapp.com/spine/dragon.js |
69 |
| -- Spine Goblin: http://shrouded-castle-71808.herokuapp.com/spine/goblins.js |
70 |
| -- Spine Dragon: http://shrouded-castle-71808.herokuapp.com/spine/pixie.js |
71 |
| -- Spine Spineboy: http://shrouded-castle-71808.herokuapp.com/spine/spineboy.js |
72 |
| - |
73 |
| -Open pxscene and enter the URL of each example to the input box and press return, you will see the results. |
74 |
| - |
75 |
| -## Plugins |
76 |
| -Some examples need extra plugins' support, and there're extra patchs for these plugins to work with pxscene. |
77 |
| - |
78 |
| -Examples|plugin|plugin source|patch file|patch base |
79 |
| ---------|------|-------------|----------|---------- |
80 |
| -Display Z Order |pixi-display |https://github.com/pixijs/pixi-display/tree/master |pixi-display.patch | branch master and commit b0898bf208431badfd2448cf2dc965a24de39ef8 |
81 |
| -Layers Z Order and Layers Lighting |pixi-layers |https://github.com/pixijs/pixi-display/tree/layers |pixi-layers.patch | branch layers and commit 0f812e3e6a16c6883c278aae6f1d719f12052862 |
82 |
| -All Spine examples |pixi-spine |https://github.com/pixijs/pixi-spine |pixi-spine.patch |branch master and commit bc64e3e6f3784f5eda1094ddc283561eb63ab3d3 |
83 |
| - |
84 |
| -## Limitations |
85 |
| - |
86 |
| -(1) When hover on clickable object, the cursor cannot be changed in pxscene. |
87 |
| -(2) Pxscene text doesn't support stroke and gradient color. The shadow doesn't support blue effect. |
88 |
| -(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. |
89 |
| - |
90 |
| -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 |
91 |
| - |
92 |
| -``` |
93 |
| -// Map: font family name -> fontUrl |
94 |
| -// Set key lowercase |
95 |
| -const fontFamilyUrlMap = { |
96 |
| - dejavusans: 'http://www.pxscene.org/examples/px-reference/fonts/DejaVuSans.ttf', |
97 |
| - arial: 'http://www.pxscene.org/examples/px-reference/fonts/DejaVuSans.ttf', |
98 |
| -}; |
99 |
| -``` |
100 |
| -Currently, it only supports Arial and DejaVuSans. |
101 |
| - |
102 |
| -(4) Layers Lighting example lack of lighting effect, because PXScene does not support filter yet. |
103 |
| - |
104 |
| -## Remarks |
105 |
| -(1) If you use the example in Heroku, you may need to wait several seconds for the resource downloading. |
106 |
| -(2) For showing text, you may still need to wait several seconds because the font URL is remote. |
107 |
| -(3) The updated pixi.js supports both browsers and pxscene. |
| 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 | +## Local Deployment |
| 35 | + |
| 36 | +you don't need wait network if you deployment examples on local , sometimes Heroku return timeout if your network not very good. |
| 37 | + |
| 38 | +```javascript |
| 39 | +npm install -g http-server |
| 40 | +cd pxPixi |
| 41 | +node update_assets_url.js http://127.0.0.1:8081 |
| 42 | +cd dist |
| 43 | +http-server -p 8081 |
| 44 | +``` |
| 45 | + |
| 46 | +## Deployment |
| 47 | +- pxPixi: for hosting pixi.js,assets and examples (https://github.com/topcoderinc/pxPixi) |
| 48 | +- The deployment instructions are easy, switch to just type the following command: |
| 49 | + |
| 50 | +```shell |
| 51 | +git init |
| 52 | +git add . |
| 53 | +git commit -m "init" |
| 54 | +heroku create |
| 55 | +git push heroku master |
| 56 | +``` |
| 57 | + |
| 58 | +After you have deployed <submission>/pxPixi to Heroku,you need use `node update_assets_url.js http://you-heroku-url.com` to update all examples ASSSETS_URL,note that use the protocol to `http://` instead of `https://`, then push again |
| 59 | + |
| 60 | +```shell |
| 61 | +node update_assets_url.js <your-Heroku-host> |
| 62 | +git add . |
| 63 | +git commit -m "update assets url" |
| 64 | +git push heroku master |
| 65 | +``` |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | +**Note**: |
| 70 | +(1) If you modified and built pixi.js, please copy pixi.js/dist/* to pxPixi/dist/pixi and update it on Heroku. |
| 71 | +(2) make sure you use the protocol to `http://` instead of `https://`. |
| 72 | + |
| 73 | + |
| 74 | +## Heroku examples |
| 75 | +- Basic: http://agile-depths-26078.herokuapp.com/basics/basic.js |
| 76 | +- Container: http://agile-depths-26078.herokuapp.com/basics/container.js |
| 77 | +- Container Pivot: http://agile-depths-26078.herokuapp.com/basics/container-pivot.js |
| 78 | +- Spritesheet Animation: http://agile-depths-26078.herokuapp.com/basics/spritesheet.js |
| 79 | +- Click: http://agile-depths-26078.herokuapp.com/basics/click.js |
| 80 | +- Tiling Sprite: http://agile-depths-26078.herokuapp.com/basics/tiling-sprite.js |
| 81 | +- Text: http://agile-depths-26078.herokuapp.com/basics/text.js |
| 82 | +- Textured Mesh: http://agile-depths-26078.herokuapp.com/basics/textured-mesh.js |
| 83 | +- Graphics: http://agile-depths-26078.herokuapp.com/basics/graphics.js |
| 84 | +- Render Texture: http://agile-depths-26078.herokuapp.com/basics/render-texture.js |
| 85 | +- Display Z Order: http://agile-depths-26078.herokuapp.com/display/z-order.js |
| 86 | +- Layers Z Order: http://agile-depths-26078.herokuapp.com/layers/z-order.js |
| 87 | +- Layers Lighting: http://agile-depths-26078.herokuapp.com/layers/lighting.js |
| 88 | +- Spine Dragon: http://agile-depths-26078.herokuapp.com/spine/dragon.js |
| 89 | +- Spine Goblin: http://agile-depths-26078.herokuapp.com/spine/goblins.js |
| 90 | +- Spine Dragon: http://agile-depths-26078.herokuapp.com/spine/pixie.js |
| 91 | +- Spine Spineboy: http://agile-depths-26078.herokuapp.com/spine/spineboy.js |
| 92 | + |
| 93 | +Open pxscene and enter the URL of each example to the input box and press return, you will see the results. |
| 94 | + |
| 95 | +## Plugins |
| 96 | +Some examples need extra plugins' support, and there're extra patchs for these plugins to work with pxscene. |
| 97 | + |
| 98 | +| Examples | plugin | plugin source | patch file | patch base | |
| 99 | +| ---------------------------------- | ------------ | ---------------------------------------- | ------------------ | ---------------------------------------- | |
| 100 | +| Display Z Order | pixi-display | https://github.com/pixijs/pixi-display/tree/master | pixi-display.patch | branch master and commit b0898bf208431badfd2448cf2dc965a24de39ef8 | |
| 101 | +| Layers Z Order and Layers Lighting | pixi-layers | https://github.com/pixijs/pixi-display/tree/layers | pixi-layers.patch | branch layers and commit 0f812e3e6a16c6883c278aae6f1d719f12052862 | |
| 102 | +| All Spine examples | pixi-spine | https://github.com/pixijs/pixi-spine | pixi-spine.patch | branch master and commit bc64e3e6f3784f5eda1094ddc283561eb63ab3d3 | |
| 103 | + |
| 104 | +## Limitations |
| 105 | + |
| 106 | +(1) When hover on clickable object, the cursor cannot be changed in pxscene. |
| 107 | +(2) Layers Lighting example lack of lighting effect, because PXScene does not support filter yet. |
| 108 | + |
| 109 | +## Remarks |
| 110 | +(1) If you use the example in Heroku, you may need to wait several seconds for the resource downloading. |
| 111 | +(2) The updated pixi.js supports both browsers and pxscene. |
0 commit comments