Skip to content

Commit

Permalink
fix: use parallaxx and parallaxy from the tiled tmx (#449)
Browse files Browse the repository at this point in the history
parallax typo fix
  • Loading branch information
ninjamuffin99 authored Oct 7, 2024
1 parent 73856c9 commit 0d07752
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flixel/addons/editors/tiled/TiledLayer.hx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package flixel.addons.editors.tiled;

import openfl.utils.ByteArray;
import haxe.xml.Access;
import openfl.utils.ByteArray;

/**
* Base class for Tiled object and tile layers
Expand All @@ -24,6 +24,9 @@ class TiledLayer
/** @since 2.1.0 */
public var offsetY:Float;

public var parallaxX:Float;
public var parallaxY:Float;

function new(source:Access, parent:TiledMap)
{
properties = new TiledPropertySet();
Expand All @@ -33,6 +36,8 @@ class TiledLayer
opacity = (source.has.opacity) ? Std.parseFloat(source.att.opacity) : 1.0;
offsetX = (source.has.offsetx) ? Std.parseFloat(source.att.offsetx) : 0.0;
offsetY = (source.has.offsety) ? Std.parseFloat(source.att.offsety) : 0.0;
parallaxX = (source.has.parallaxx) ? Std.parseFloat(source.att.parallaxx) : 1.0;
parallaxY = (source.has.parallaxy) ? Std.parseFloat(source.att.parallaxy) : 1.0;

loadProperties(source);
}
Expand Down

0 comments on commit 0d07752

Please sign in to comment.