Merge pull request #1839 from thecodingmachine/parallax-effect
Parallax effect
This commit is contained in:
commit
c39f23de6f
@ -85,6 +85,7 @@ export class GameMap {
|
|||||||
phaserMap
|
phaserMap
|
||||||
.createLayer(layer.name, terrains, (layer.x || 0) * 32, (layer.y || 0) * 32)
|
.createLayer(layer.name, terrains, (layer.x || 0) * 32, (layer.y || 0) * 32)
|
||||||
.setDepth(depth)
|
.setDepth(depth)
|
||||||
|
.setScrollFactor(layer.parallaxx ?? 1, layer.parallaxy ?? 1)
|
||||||
.setAlpha(layer.opacity)
|
.setAlpha(layer.opacity)
|
||||||
.setVisible(layer.visible)
|
.setVisible(layer.visible)
|
||||||
.setSize(layer.width, layer.height)
|
.setSize(layer.width, layer.height)
|
||||||
|
@ -78,6 +78,8 @@ export interface ITiledMapTileLayer {
|
|||||||
width: number;
|
width: number;
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
|
parallaxx?: number;
|
||||||
|
parallaxy?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw order (topdown (default), index)
|
* Draw order (topdown (default), index)
|
||||||
|
@ -32,6 +32,14 @@
|
|||||||
<a href="#" class="testLink" data-testmap="jitsi_custom_url.json" target="_blank">Testing jitsiUrl property</a>
|
<a href="#" class="testLink" data-testmap="jitsi_custom_url.json" target="_blank">Testing jitsiUrl property</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="radio" name="test-animated-tiles"> Success <input type="radio" name="test-animated-tiles"> Failure <input type="radio" name="test-animated-tiles" checked> Pending
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="#" class="testLink" data-testmap="parallax.json" target="_blank">Test parallax effect</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input type="radio" name="test-animated-tiles"> Success <input type="radio" name="test-animated-tiles"> Failure <input type="radio" name="test-animated-tiles" checked> Pending
|
<input type="radio" name="test-animated-tiles"> Success <input type="radio" name="test-animated-tiles"> Failure <input type="radio" name="test-animated-tiles" checked> Pending
|
||||||
|
150
maps/tests/parallax.json
Normal file
150
maps/tests/parallax.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user