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 x and y attributes to Tile objects #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jjatria
Copy link

@jjatria jjatria commented Mar 14, 2019

This adds an x and y attribute to the Tile class which makes it easier to determine what part of the sprite tilesheet this tile in particular needs to clip. They will be [ 0, 0 ] for the tile at the top left, and [ 1, 0 ] for the tile immediately to the right.

The clip rectangle for the sprite sheet can then be calculated using the tile_width and tile_height attributes from the Tileset object.

This includes a fix for these attributes' builders, which had an extra underscore.

@jjatria jjatria changed the title Tile xy Add x and y attributes to Tile objects Mar 14, 2019
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.

1 participant