question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TilingSprite Gaps Support

See original GitHub issue

TilingSprite 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. image

Is this ok to add this feature?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ivanpopelyshevcommented, Jan 22, 2021

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.

0reactions
imfunnieecommented, Jun 6, 2021

@spd789562 did you found a solution? 👀

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found