You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param {*} hitArea - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used.
19
+
* @param {HitAreaCallback} hitAreaCallback - A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback.
18
20
*
19
21
* @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action.
Copy file name to clipboardExpand all lines: src/display/mask/GeometryMask.js
+23-18Lines changed: 23 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,19 @@ var Class = require('../../utils/Class');
8
8
9
9
/**
10
10
* @classdesc
11
-
* [description]
11
+
* A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect a visible pixel from the geometry mask. The mask is essentially a clipping path which can only make a masked pixel fully visible or fully invisible without changing its alpha (opacity).
12
+
*
13
+
* A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and alpha of the pixel from the Geometry Mask do not matter.
14
+
*
15
+
* The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. Moving or transforming the underlying Graphics object will change the mask (and affect the visibility of any masked objects), whereas moving or transforming a masked object will not affect the mask. You can think of the Geometry Mask (or rather, of the its Graphics object) as an invisible curtain placed in front of all masked objects which has its own visual properties and, naturally, respects the camera's visual properties, but isn't affected by and doesn't follow the masked objects by itself.
* @param {Phaser.Scene} scene - This parameter is not used.
23
+
* @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List.
20
24
*/
21
25
varGeometryMask=newClass({
22
26
@@ -25,7 +29,7 @@ var GeometryMask = new Class({
25
29
functionGeometryMask(scene,graphicsGeometry)
26
30
{
27
31
/**
28
-
* [description]
32
+
* The Graphics object which describes the Geometry Mask.
* @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask.
44
48
*/
45
49
setShape: function(graphicsGeometry)
46
50
{
47
51
this.geometryMask=graphicsGeometry;
48
52
},
49
53
50
54
/**
51
-
* [description]
55
+
* Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask.
Copy file name to clipboardExpand all lines: src/geom/intersects/TriangleToLine.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,17 @@ var Contains = require('../triangle/Contains');
8
8
varLineToLine=require('./LineToLine');
9
9
10
10
/**
11
-
* [description]
11
+
* Checks if a Triangle and a Line intersect.
12
+
*
13
+
* The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid".
0 commit comments