Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use parallaxx and parallaxy from the tiled tmx #449

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading