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

Included tile spacing and margin in source rectangle calculation #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

treesgobark
Copy link

DualStickSheet.zip
Saw the discussion on #86. Here's a solution that also includes the margins and a tilesheet to test with. Note how each tile is 16x16 but has a 1 pixel border around it that matches the adjacent pixel. Margin is the thickness of the border around the entire tile sheet image whereas spacing is how many pixels are between any two tiles. This "extrusion" is used for solving gpu rounding errors that try to sample from the sprite sheet a tiny bit over the true border of the sprite and end up creating strange lines between tiles. Aseprite has an extrude option when exporting a tile sheet that does this for you if you want to make your own. https://www.aseprite.org/docs/sprite-sheet/

Copy link

@kaltinril kaltinril left a comment

Choose a reason for hiding this comment

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

Similar to PR #86, as indicated by @treesgobark but this one has an additional fix it appear for the tileset boarder. Code makes sense to me, recommend merging if no unforseen issues exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants