-
Notifications
You must be signed in to change notification settings - Fork 459
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
Conversation
@@ -1013,6 +1018,11 @@ class FlxTilemap extends FlxBaseTilemap<FlxTile> | |||
} | |||
#end | |||
|
|||
private function set_antialiasing(value:Bool):Bool |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Does this work with both |
@Gama11: It works with rendertile, not sure about renderblit. Let me see. |
Okay, looks like it doesn't -- in BLIT mode, the draw call happens on the FlxTilemapBuffer, which passes a null (and thus false) value for "smoothing" to draw(). Serendipitously, this creates a non-speculative use for the antialiasing setter on the tilemap -- we need to add an antialiasing flag to the FlxTilemapBuffers, and that's a natural place to update it. |
I was about to tell you that there's a reason why |
Hm, looks like it was needed by the old version of the bitmap text class, but apparently not anymore in the refactored |
Okay, I have the change for Blit, tested and works. one second. |
…liased if FlxG.renderBlit
@@ -970,6 +975,10 @@ class FlxTilemap extends FlxBaseTilemap<FlxTile> | |||
{ | |||
var buffer = new FlxTilemapBuffer(_tileWidth, _tileHeight, widthInTiles, heightInTiles, camera, scale.x, scale.y); | |||
buffer.pixelPerfectRender = pixelPerfectRender; | |||
if (FlxG.renderBlit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can skip this check for render mode and just set antialiasing
directly
No description provided.