Jump to content

Tilemap sprites have weird spacing.


mid
 Share

Recommended Posts

At initialization I iterate over the tilemap and add the sprites accordingly:

for y {
	for x {
		var sprite = new PIXI.Sprite(new PIXI.Texture(PIXI.Loader.shared.resources["assets/tileset1.png"].texture, new PIXI.Rectangle(tile % 32 * size, tile / 32 * size, size, size)));
		sprite.anchor.set(0.5);
		sprite.position.set(x * size, y * size);
		spriteContainer.addChild(sprite);
	}
}

However it results in these weird artifacts (in attachment). There's space between the tiles on the Y axis (and these are not in the tileset).

Untitled2019.png

tileset1.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...