forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSize.js
More file actions
62 lines (44 loc) · 1.02 KB
/
Copy pathSize.js
File metadata and controls
62 lines (44 loc) · 1.02 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
62
var Size = {
width: 0,
height: 0,
displayWidth: {
get: function ()
{
return this.scaleX * this.frame.realWidth;
},
set: function (value)
{
this.scaleX = value / this.frame.realWidth;
}
},
displayHeight: {
get: function ()
{
return this.scaleY * this.frame.realHeight;
},
set: function (value)
{
this.scaleY = value / this.frame.realHeight;
}
},
setSizeToFrame: function (frame)
{
if (frame === undefined) { frame = this.frame; }
this.width = frame.realWidth;
this.height = frame.realHeight;
return this;
},
setSize: function (width, height)
{
this.width = width;
this.height = height;
return this;
},
setDisplaySize: function (width, height)
{
this.displayWidth = width;
this.displayHeight = height;
return this;
}
};
module.exports = Size;