|
1 |
| - <article> <h1>How to Read the Documentation</h1> <p>Zephyr is designed to extend the functionality of <span id="compatibility" class="nightly">PixiJS</span>, |
2 |
| - rather |
3 |
| - than wrapping it so that you can always use Pixi without Zephyr.</p> <p>The <span class="return">Return</span> line below the function indicates the object type that is returned. |
4 |
| - </p> <p>The <span class="nightly">Nightly</span> features can only be found in the current nightly version of Zephyr. |
5 |
| - Consider trying it out, and letting us know of any bugs you find!</p> <p>The <span class="deprecated">Deprecated</span> features are set to be removed in the next stable release.</p> <br> <h2>PIXI.Zephyr</h2> <dl> <dt>PIXI.Zephyr.useKeys()</dt> <dd>Sets up the key tracking system for use</dd> <dt>PIXI.Zephyr.useMouse()</dt> <dd>Sets up the mouse tracking system for use</dd> <dd><span class="warning">NOTE</span>: Please make sure you call PIXI.Mouse.setContainer() with an appended |
6 |
| - element afterward!</dd> <dt>PIXI.Zephyr.useAudio()</dt> <dd>Sets up the WebAudio API for Pixi-style usage</dd> <dt>PIXI.Zephyr.useFile()</dt> <dd>Sets up the File reading/writing system</dd> </dl> <br> <h2>PIXI.Keys</h2> <p>keyName is a string that is returned by keyboardEvent.code. Check out the <a |
| 1 | + <article> <br> <h1>How to Read the Documentation</h1> <p><span class="warning">WARNINGS</span> are just general knowledge to be aware of when using a particular feature.</p> <p>Lines color coded as <span class="return">RETURN</span> below the function indicates the object type that is returned. |
| 2 | + </p> <p>Lines coded as <span class="nightly">NIGHTLY</span> can only be found in the current nightly version of Zephyr. |
| 3 | + Consider trying it out, and letting us know of any bugs you find!</p> <p><span class="deprecated">DEPRECATED</span> lines specify features are set to be removed in the next stable release.</p> <h2>PIXI.Zephyr</h2> <dl> <dt>PIXI.Zephyr.useKeys()</dt> <dd><em>Enables <a href="#PIXI.Keys">PIXI.Keys</a></em></dd> <dd>Sets up the key tracking system for use</dd> <dt>PIXI.Zephyr.useMouse()</dt> <dd><em>Enables <a href="#PIXI.Mouse">PIXI.Mouse</a></em></dd> <dd>Sets up the mouse tracking system for use</dd> <dd><span class="warning">NOTE</span>: Please make sure you call PIXI.Mouse.setContainer() with an appended |
| 4 | + element afterward!</dd> <dt>PIXI.Zephyr.useAudio()</dt> <dd><em>Enables <a href="#PIXI.Audio">PIXI.Audio</a></em></dd> <dd>Sets up the WebAudio API for Pixi-style usage</dd> <dt>PIXI.Zephyr.useFile()</dt> <dd><em>Enables <a href="#PIXI.File">PIXI.File</a></em></dd> <dd>Sets up the File reading/writing system</dd> <dt>PIXI.Zephyr.useParticles()</dt> <dd><em>Enables <a href="#PIXI.Particles">PIXI.Particles</a></em></dd> <dd>Sets up the Particle Emitter backend for Pixi-Style usage</dd> </dl> <h2 id="PIXI.Keys">PIXI.Keys</h2> <p>keyName is a string that is returned by keyboardEvent.code. Check out the <a |
7 | 5 | href="https://zephyrjs.netlify.app/keyname">Key Namer</a> to get specific key names.</p> <dl> <dt>PIXI.Keys.down(keyName)</dt> <dd>Returns true if the key is actively pressed down.</dd> <dd class="return">Boolean</dd> <dt>PIXI.Keys.fired(keyName)</dt> <dd>Returns true if this is the first time the key value has been accessed since the key has been pressed.
|
8 |
| - </dd> <dd class="return">Boolean</dd> </dl> <br> <h2 id="PIXI.Mouse">PIXI.Mouse</h2> <p>For button-related functions, the button names are 'Primary', 'Middle', and 'Secondary'</p> <dl> <dt>PIXI.Mouse.setContainer(domElement)</dt> <dd>What the mouse’s coordinates should be scaled according to (Generally, this should be your Pixi |
| 6 | + </dd> <dd class="return">Boolean</dd> </dl> <h2 id="PIXI.Mouse">PIXI.Mouse</h2> <p>For button-related functions, the button names are 'Primary', 'Middle', and 'Secondary'</p> <dl> <dt>PIXI.Mouse.setContainer(domElement)</dt> <dd>What the mouse’s coordinates should be scaled according to (Generally, this should be your Pixi |
9 | 7 | app.view).
|
10 | 8 | </dd> <dd class="warning"><strong>NOTE</strong>: Please ensure that this element has already been appended to the
|
11 | 9 | DOM.
|
12 | 10 | As of version 23.1, calling this method with an unappended element will fail with a console error about
|
13 | 11 | using an "invalid element".</dd> <dt>PIXI.Mouse.down([mouse button])</dt> <dd>Returns true if the button is actively pressed down.</dd> <dd class="return">Boolean</dd> <dt>PIXI.Mouse.fired(mouseEvent.button)</dt> <dd>Returns true if this is the first time the button value has been accessed since the button has been
|
14 | 12 | pressed.
|
15 |
| - </dd> <dd class="return">Boolean</dd> <dt>PIXI.Mouse.x</dt> <dd>The last seen mouse X coordinate, scaled to the mouseContainer horizontally from left to right.</dd> <dd class="return">Number</dd> <dt>PIXI.Mouse.y</dt> <dd>The last seen mouse Y coordinate, scaled to the mouseContainer vertically from top to bottom.</dd> <dd class="return">Number</dd> </dl> <br> <h2>PIXI.Audio</h2> <dl> <dt>PIXI.Audio.from(src)</dt> <dd>Returns a "Pixi Audio" object. These can have .play() called on them to play their sound.</dd> <dd class="return">Pixi Audio object</dd> </dl> <br> <h2>PIXI.File</h2> <dl> <dt>PIXI.File.write(object, fileName)</dt> <dd>Converts the passed object into JSON and prompting the user to download the resulting fileName.json</dd> <dt>PIXI.File.open()</dt> <dd>Prompts the user to select a file, which it then attempts to parse as JSON and return</dd> <dd class="return">Object</dd> </dl> <br> <h2>PIXI.Particles</h2> <dl> <dt>PIXI.Particles.from(src, maxParticleCount)</dt> <dd>Returns a "PIXI Particle Emitter" which is a particleContainer with a built-in <strong>step()</strong> |
| 13 | + </dd> <dd class="return">Boolean</dd> <dt>PIXI.Mouse.x</dt> <dd>The last seen mouse X coordinate, scaled to the mouseContainer horizontally from left to right.</dd> <dd class="return">Number</dd> <dt>PIXI.Mouse.y</dt> <dd>The last seen mouse Y coordinate, scaled to the mouseContainer vertically from top to bottom.</dd> <dd class="return">Number</dd> </dl> <h2 id="PIXI.Audio">PIXI.Audio</h2> <dl> <dt>PIXI.Audio.from(src)</dt> <dd>Returns a "Pixi Audio" object. These can have .play() called on them to play their sound.</dd> <dd class="return">Pixi Audio object</dd> </dl> <h2 id="PIXI.File">PIXI.File</h2> <dl> <dt>PIXI.File.write(object, fileName)</dt> <dd>Converts the passed object into JSON and prompting the user to download the resulting fileName.json</dd> <dt>PIXI.File.open()</dt> <dd>Prompts the user to select a file, which it then attempts to parse as JSON and return</dd> <dd class="return">Object</dd> </dl> <h2 id="PIXI.Particles">PIXI.Particles</h2> <dl> <dt>PIXI.Particles.from(src, maxParticleCount<em>, optionObject</em>)</dt> <dd>Returns a "PIXI Particle Emitter" which is a particleContainer with a built-in <strong>step()</strong> |
16 | 14 | function to progress the animation. The different attributes of the container specify how the particles
|
17 |
| - are emitted.</dd> <dd class="return">Pixi Particle Container |
18 |
| - <br>{ |
19 |
| - <br>life: how far the particles can move away from the emitter's location, in pixels (default 128) |
20 |
| - <br>speed: quickly the particles move to their end of life distance (default 1) |
21 |
| - <br>direction: specifies the direction (in radians) that the particles will move (default 0) |
22 |
| - <br>spread: the angle (in radians) of how closely particles should follow the direction. 0 is no deviation, 2 PI is in a full circle (default is 2 PI) |
23 |
| - <br>step(): moves and updates all particles |
24 |
| - <br>} |
25 |
| - </dd> </dl> <br> <h2>PIXI.collision</h2> <dl> <dt>PIXI.collision.aabb(Sprite, Sprite)</dt> <dd>Checks if the two provided Sprites are colliding with the aabb algorithm - NOTE: Both a and b are |
| 15 | + are emitted.</dd> <dd>An object can optionally be passed in to specify life, speed, direction, and spread, where the attributes are the associated values, for example, {life: 30, speed: 0.5, direction: Math.PI, Math.PI * 0.5}.</dd> <dd class="return">Pixi Particle Emitter</dd> <dd>.life = how far the particles can move away from the emitter's location, in pixels (default 128) |
| 16 | + <br>.speed = quickly the particles move to their end of life distance (default 1) |
| 17 | + <br>.direction = specifies the direction (in radians) that the particles will move (default 0) |
| 18 | + <br>.spread = the angle (in radians) of how closely particles should follow the direction. 0 is no |
| 19 | + deviation, 2 PI is in a full circle (default is 2 PI) |
| 20 | + <br>.step() = a shared function that moves and updates all particles |
| 21 | + </dd> </dl> <h2>PIXI.collision</h2> <dl> <dt>PIXI.collision.aabb(Sprite, Sprite)</dt> <dd>Checks if the two provided Sprites are colliding with the aabb algorithm - NOTE: Both a and b are |
26 | 22 | formatted
|
27 | 23 | as javascript objects with x, y, width, and height, and optionally anchor positions.</dd> <dd class="return">Boolean</dd> <dt>PIXI.collision.radius(Sprite, Sprite)</dt> <dd>Checks if the two provided Sprites are colliding with the standard point-radius method of circle
|
28 | 24 | collision -
|
29 | 25 | NOTE: Both a and b are formatted as javascript objects with x, y, and r, and optionally anchor
|
30 | 26 | positions.
|
31 |
| - </dd> <dd class="return">Boolean</dd> </dl> <br> <h2>PIXI.utils</h2> <dl> <dt>PIXI.utils.requestFullScreen(domElement)</dt> <dd>The element passed in (typically use the Application view) will attempt to go fullscreen</dd> </dl> <br> <h2>Added Functions</h2> <dl> <dt>PIXI.clamp(x, min, max)</dt> <dd>Returns the value of x if it is between the bounds of min and max, or the closest bound if x is outside |
| 27 | + </dd> <dd class="return">Boolean</dd> </dl> <h2>PIXI.utils</h2> <dl> <dt>PIXI.utils.requestFullScreen(domElement)</dt> <dd>The element passed in (typically the Application view) will attempt to go fullscreen</dd> </dl> <h2>Added Functions</h2> <dl> <dt>PIXI.clamp(x, min, max)</dt> <dd>Returns the value of x if it is between the bounds of min and max, or the closest bound if x is outside |
32 | 28 | </dd> <dd class="return">Number</dd> <dt>PIXI.mix(a, b, m)</dt> <dd>Linearly interpolate between values a and b</dd> <dd class="return">Number</dd> <dt>PIXI.rand(min, max)</dt> <dd>Generates a random integer between min and max, inclusive</dd> <dd class="return">Number</dd> </dl> </article>
|
0 commit comments