forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPointProxy.js
More file actions
61 lines (41 loc) · 1.24 KB
/
Copy pathPointProxy.js
File metadata and controls
61 lines (41 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* A PointProxy is an internal class that allows for direct getter/setter style property access to Arrays and TypedArrays.
*
* @class Phaser.Physics.PointProxy
* @classdesc PointProxy
* @constructor
* @param {any} destination - The object to bind to.
*/
Phaser.Physics.PointProxy = function (destination) {
this.destination = destination;
};
Phaser.Physics.PointProxy.prototype.constructor = Phaser.Physics.PointProxy;
/**
* @name Phaser.Physics.PointProxy#x
* @property {number} x - The x property of this PointProxy.
*/
Object.defineProperty(Phaser.Physics.PointProxy.prototype, "x", {
get: function () {
return this.destination[0];
},
set: function (value) {
this.destination[0] = value;
}
});
/**
* @name Phaser.Physics.PointProxy#y
* @property {number} y - The y property of this PointProxy.
*/
Object.defineProperty(Phaser.Physics.PointProxy.prototype, "y", {
get: function () {
return this.destination[1];
},
set: function (value) {
this.destination[1] = value;
}
});