forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTilemapView.js
More file actions
144 lines (113 loc) · 3.17 KB
/
Copy pathTilemapView.js
File metadata and controls
144 lines (113 loc) · 3.17 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
*
* @class Phaser.TilemapLayer
* @constructor
* @param {Phaser.Game} game - Game reference to the currently running game.
* @param {Phaser.Tilemap} tilemap - The tilemap to which this layer belongs.
* @param {integer} index - The index of the TileLayer to render within the Tilemap.
* @param {integer} width - Width of the renderable area of the layer (in pixels).
* @param {integer} height - Height of the renderable area of the layer (in pixels).
*/
Phaser.TilemapView = function (game, tilemap, index, width, height) {
/**
* A reference to the Phaser.Game instance.
*
* @property {Phaser.Game} game
*/
this.game = game;
/**
* A custom view.
*
* @property {Phaser.Point} view
*/
this.view = null;
/**
* An Array of any linked layers.
*
* @property {Array} linkedLayers
* @private
*/
this.linkedLayers = [];
/**
* The Tilemap to which this layer is bound.
* @property {Phaser.Tilemap} map
* @protected
* @readonly
*/
this.map = tilemap;
/**
* The index of this layer within the Tilemap.
* @property {number} index
* @protected
* @readonly
*/
this.index = index;
/**
* The layer object within the Tilemap that this layer represents.
* @property {object} layer
* @protected
* @readonly
*/
this.layer = tilemap.layers[index];
/**
* The const type of this object.
* @property {number} type
* @readonly
* @protected
* @default Phaser.TILEMAPLAYER
*/
this.type = Phaser.TILEMAPLAYER;
/**
* @property {number} physicsType - The const physics body type of this object.
* @readonly
*/
this.physicsType = Phaser.TILEMAPLAYER;
/**
* @property {boolean} exists - Controls if the core game loop and physics update this game object or not.
*/
this.exists = true;
/**
* Speed at which this layer scrolls horizontally, relative to the camera (e.g. scrollFactorX of 0.5 scrolls half as quickly as the 'normal' camera-locked layers do).
* @property {number} scrollFactorX
* @public
* @default
*/
this.scrollFactor = new Phaser.Point(1, 1);
/**
* When ray-casting against tiles this is the number of steps it will jump. For larger tile sizes you can increase this to improve performance.
* @property {integer} rayStepRate
* @default
*/
this.rayStepRate = 4;
/**
* If true tiles will be force rendered, even if such is not believed to be required.
* @property {boolean} dirty
* @protected
*/
this.dirty = true;
/**
* @property {array} _results - Internal var.
* @private
*/
this._results = [];
};
Phaser.TilemapView.prototype.constructor = Phaser.TilemapView;
Phaser.TilemapView.prototype = {
preUpdate: function () {
},
postUpdate: function () {
},
render: function () {
},
resize: function () {
},
resizeWorld: function () {
},
destroy: function () {
}
};