TilingSprite Gaps Support
See original GitHub issueTilingSprite seems doesn’t have any option to change the sprites margin. however, I can use the below code to create a new sprite that seems to have margins
function generateGapTexture(texture, gap) {
const gapBox = new Pixi.Graphics()
const originSprite = new Pixi.Sprite(texture)
gapBox.drawRect(0, 0, originSprite.width + gap.x, originSprite.height + gap.y)
gapBox.addChild(originSprite)
return gapBox.generateCanvasTexture()
}
but, if gaps are negative, this function is no use. it should be overlapping like this.
Is this ok to add this feature?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
TilingSprite is showing a gap - - Bountysource
TilingSprite is showing a gap ; Expected Behavior. Seamless tiling of textures without gaps image ; Current Behavior. Showing gaps between the tiles...
Read more >Gaps between sprite tiles when scaling the stage - Pixi.js
I just checked your suggestions, but it seems like it doesn't help to solve that issue. I am starting to think that it...
Read more >Gaps between tiled sprites. Help! : r/Unity3D - Reddit
We've been seeing these really annoying gaps between our tiled art. I've been doing a lot of googling but I haven't been able...
Read more >PIXI.TilingSprite - PixiJS API Documentation
Helper function that creates a new tiling sprite based on the source you provide. The source can be - frame id, image url,...
Read more >PixiJS - Browse /v6.2.0 at SourceForge.net
Reformat documentation to better support documentation in types (#7786, [#7787], ... Fix: TilingSprite gaps when mipmapping enabled (#7792) @ShukantPal ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
TilingSprite does not consists of multiple sprites. Its using extra transform on texture inside of it.
You can make your own implementation that actually spawns many sprites inside or works with internals separately, that’s very good way to make tilingSprite, its just nobody did it as plugin for pixi! I already have 10 plugins, i cant supply more, sorry.
Alternatively: make a mesh-shader (look in examples) that works same way like TilingSprite shader, but uses gaps.
@spd789562 did you found a solution? 👀