scroll factor applied automatically
This commit is contained in:
parent
a53cbbff34
commit
57bd8783e0
@ -85,6 +85,7 @@ export class GameMap {
|
||||
phaserMap
|
||||
.createLayer(layer.name, terrains, (layer.x || 0) * 32, (layer.y || 0) * 32)
|
||||
.setDepth(depth)
|
||||
.setScrollFactor(layer.parallaxx ?? 1, layer.parallaxy ?? 1)
|
||||
.setAlpha(layer.opacity)
|
||||
.setVisible(layer.visible)
|
||||
.setSize(layer.width, layer.height)
|
||||
@ -94,7 +95,6 @@ export class GameMap {
|
||||
depth = DEPTH_OVERLAY_INDEX;
|
||||
}
|
||||
}
|
||||
console.log(this.phaserLayers);
|
||||
for (const tileset of map.tilesets) {
|
||||
tileset?.tiles?.forEach((tile) => {
|
||||
if (tile.properties) {
|
||||
|
@ -78,6 +78,8 @@ export interface ITiledMapTileLayer {
|
||||
width: number;
|
||||
x: number;
|
||||
y: number;
|
||||
parallaxx: number;
|
||||
parallaxy: number;
|
||||
|
||||
/**
|
||||
* Draw order (topdown (default), index)
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user