Skip to content

Commit 80aa157

Browse files
committed
Falls back to GO width / height if no frame.
1 parent d5ed070 commit 80aa157

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

v3/src/input/local/components/SetHitAreaFromTexture.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,23 @@ var SetHitAreaFromTexture = function (gameObjects, callback)
1616
var gameObject = gameObjects[i];
1717
var frame = gameObject.frame;
1818

19+
var width = 0;
20+
var height = 0;
21+
1922
if (frame)
2023
{
21-
gameObject.input = InteractiveObject(gameObject, new Rectangle(0, 0, frame.width, frame.height), callback);
24+
width = frame.width;
25+
height = frame.height;
26+
}
27+
else if (gameObject.width)
28+
{
29+
width = gameObject.width;
30+
height = gameObject.height;
31+
}
32+
33+
if (width !== 0 && height !== 0)
34+
{
35+
gameObject.input = InteractiveObject(gameObject, new Rectangle(0, 0, width, height), callback);
2236

2337
this.queueForInsertion(gameObject);
2438
}

0 commit comments

Comments
 (0)