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

add antialiasing to FlxTilemap #1850

Merged
merged 2 commits into from
May 13, 2016
Merged
Changes from 1 commit
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
12 changes: 11 additions & 1 deletion flixel/tile/FlxTilemap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ class FlxTilemap extends FlxBaseTilemap<FlxTile>
*/
public var scale(default, null):FlxPoint;

/**
* Controls whether the object is smoothed when rotated, affects performance.
*/
public var antialiasing(default, set):Bool = false;

/**
* Use to offset the drawing position of the tilemap,
* just like FlxSprite.
Expand Down Expand Up @@ -806,7 +811,7 @@ class FlxTilemap extends FlxBaseTilemap<FlxTile>
scaledHeight = _scaledTileHeight;

var hasColorOffsets:Bool = (colorTransform != null && colorTransform.hasRGBAOffsets());
drawItem = Camera.startQuadBatch(graphic, isColored, hasColorOffsets, blend);
drawItem = Camera.startQuadBatch(graphic, isColored, hasColorOffsets, blend, antialiasing);
}

// Copy tile images into the tile buffer
Expand Down Expand Up @@ -1013,6 +1018,11 @@ class FlxTilemap extends FlxBaseTilemap<FlxTile>
}
#end

private function set_antialiasing(value:Bool):Bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a setter here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just following the convention from FlxSprite

{
return antialiasing = value;
}

/**
* Internal function for setting graphic property for this object.
* It changes graphic' useCount also for better memory tracking.
Expand Down