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
* Checks to see if this <code>GameObject</code> were located at the given position, would it overlap the <code>GameObject</code> or <code>Group</code>?
179
-
* This is distinct from overlapsPoint(), which just checks that point, rather than taking the object's size numbero account.
180
-
* WARNING: Currently tilemaps do NOT support screen space overlap checks!
148
+
* Checks to see if the given x and y coordinates overlaps this <code>Sprite</code>, taking scaling and rotation into account.
149
+
* The coordinates must be given in world space, not local or camera space.
181
150
*
182
-
* @param X {number} The X position you want to check. Pretends this object (the caller, not the parameter) is located here.
183
-
* @param Y {number} The Y position you want to check. Pretends this object (the caller, not the parameter) is located here.
184
-
* @param objectOrGroup {object} The object or group being tested.
185
-
* @param inScreenSpace {boolean} Whether to take scroll factors numbero account when checking for overlap. Default is false, or "only compare in world space."
186
-
* @param camera {Camera} Specify which game camera you want. If null getScreenXY() will just grab the first global camera.
151
+
* @param sprite {Sprite} The Sprite to check. It will take scaling and rotation into account.
152
+
* @param x {Number} The x coordinate in world space.
153
+
* @param y {Number} The y coordinate in world space.
187
154
*
188
-
* @return{boolean} Whether or not the two objects overlap.
155
+
* @returnWhether or not the point overlaps this object.
Copy file name to clipboardExpand all lines: README.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,30 +26,28 @@ TODO:
26
26
* Investigate why tweens don't restart after the game pauses
27
27
* Fix bug in Tween yoyo + loop combo
28
28
* Apply Sprite scaling to Body.bounds
29
-
* When you modify the sprite x/y directly the body position doesn't update, which leads to weird results. Need to work out who controls who.
30
29
* Check that tween pausing works with the new performance.now
31
30
* Game.Time should monitor pause duration
32
31
* Investigate bug re: tilemap collision and animation frames
33
32
* Update tests that use arrow keys and include touch/mouse support (FlxControlHandler style)
34
-
* Polygon geom primitive
35
33
* If the Camera is larger than the Stage size then the rotation offset isn't correct
36
34
* Texture Repeat doesn't scroll, because it's part of the camera not the world, need to think about this more
37
35
* Bug: Sprite x/y gets shifted if dynamic from the original value
38
36
* Input CSS cursor those little 4-way arrows on drag?
39
37
* Stage CSS3 transforms!!! Color tints, sepia, greyscale, all of those cool things :)
40
-
* Cameras should have option to be input disabled + Pointers should check which camera they are over before doing Sprite selection
41
-
* Added JSON Texture Atlas object support.
42
-
* RenderOrderID won't work across cameras - but then neither do Pointers yet anyway
38
+
* Add JSON Texture Atlas object support.
43
39
* Swap to using time based motion (like the tweens) rather than delta timer - it just doesn't work well on slow phones
44
40
* Pointer.getWorldX(camera) needs to take camera scale into consideration
45
41
* Add a 'click to bring to top' demo (+ Group feature?)
46
42
* If stage.clear set to false and game pauses, when it unpauses you still see the pause arrow - resolve this
47
-
48
43
* Add clip support + shape options to Texture Component.
44
+
* Make sure I'm using Point and not Vec2 when it's not a directional vector I need
45
+
* Bug with setting scale or anything on a Sprite inside a Group, or maybe group.addNewSprite issue
49
46
50
-
Make sure I'm using Point and not Vec2 when it's not a directional vector I need
51
-
52
-
47
+
* Make input check use the rotated sprite check
48
+
* Sprite collision events
49
+
* See which functions in the input component can move elsewhere (utils)
50
+
* Move all of the renderDebugInfo methods to the DebugUtils class
53
51
54
52
V1.0.0
55
53
@@ -98,7 +96,7 @@ V1.0.0
98
96
* Added optional frame parameter to Phaser.Sprite (and game.add.sprite) so you can set a frame ID or frame name on construction.
99
97
* Fixed bug where passing a texture atlas string would incorrectly skip the frames array.
100
98
* Added AnimationManager.autoUpdateBounds to control if a new frame should change the physics bounds of a sprite body or not.
101
-
* Added StageScaleMode.pageAlignHorizontally and pageAlignVertically booleans. When on Phaser will set the margin-left and top of the canvas element so that it is positioned in the middle of the page (based on window.innerWidth).
99
+
* Added StageScaleMode.pageAlignHorizontally and pageAlignVertically booleans. When true Phaser will set the margin-left and top of the canvas element so that it is positioned in the middle of the page (based only on window.innerWidth).
102
100
* Added support for globalCompositeOperation, opaque and backgroundColor to the Sprite.Texture and Camera.Texture components.
103
101
* Added ability for a Camera to skew and rotate around an origin.
104
102
* Moved the Camera rendering into CanvasRenderer to keep things consistent.
@@ -109,8 +107,12 @@ V1.0.0
109
107
* Added CameraManager.swap and CameraManager.sort methods and added a z-index property to Camera to control render order.
110
108
* Added World.postUpdate loop + Group and Camera postUpdate methods.
111
109
* Fixed issue stopping Pointer from working in world coordinates and fixed the world drag example.
112
-
* For consistency renamed input.scaledX/Y = input.scale.
110
+
* For consistency renamed input.scaledX/Y to input.scale.
113
111
* Added input.activePointer which contains a reference to the most recently active pointer.
112
+
* Sprite.Transform now has upperLeft, upperRight, bottomLeft and bottomRight Point properties and lots of useful coordinate related methods.
113
+
* Camera.inCamera check now uses the Sprite.worldView which finally accurately updates regardless of scale, rotation or rotation origin.
114
+
* Added Math.Mat3 for Matrix3 operations (which Sprite.Transform uses) and Math.Mat3Utils for lots of use Mat3 related methods.
115
+
* Added SpriteUtils.overlapsXY and overlapsPoint to check if a point is within a sprite, taking scale and rotation into account.
0 commit comments