crowbar Posted May 27, 2015 Share Posted May 27, 2015 I'm trying to tile sprites using Pixi 3.0. I'm pulling the textures from a sprite sheet like so:var img_tile_black= new PIXI.Texture(wabbitTexture.baseTexture, new PIXI.Rectangle(695,419,64,64));var img_tile_brown= new PIXI.Texture(wabbitTexture.baseTexture, new PIXI.Rectangle(769,419,64,64));var img_tile_red= new PIXI.Texture(wabbitTexture.baseTexture, new PIXI.Rectangle(695,493,64,64));var img_tile_white= new PIXI.Texture(wabbitTexture.baseTexture, new PIXI.Rectangle(769,493,64,64));I add them to the container like so:display_tiles_walls = new PIXI.Container();display_tiles = new PIXI.Container();tile_containers = [display_tiles_walls,display_tiles];//...var sprite = new PIXI.Sprite(img_tile_white);//...tile_containers[index].addChild(sprite);However the result looks like this:While the source image (part of my sprite sheet) looks like this: I want just the white squares flush with the other white squares. I cannot figure out why the color borders are showing. I have tried adjusting the Rectangle that crops the texture, but it never works. Edit: I tried using a TilingSprite, but I guess that just fills the whole renderer.width and renderer.height with the sprite, tiled? Regards, Jordan Quote Link to comment Share on other sites More sharing options...
crowbar Posted May 28, 2015 Author Share Posted May 28, 2015 Any ideas as to why the rectangle is grabbing more than it should be? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.