If I create a sprite from a .png file and then get its texture, the texture is the size of the png - which is what one would expect.
If I create a sprite from a sprite sheet, and then get its texture, the texture is the size of the sprite sheet - which is not what I expected.
Now I am using that texture to apply some effects to - but of course my effects are applied to the whole sheet! Not what I expected.
I’m basing my code on
but here it is applying the blur to the whole layer - I just want to:
Take a sprite.
Apply the blur
change the sprite to use the new blurred texture.
I’ve been searching for a while for a solution - any advice will be appreciated.
One thing I noticed while searching for this information is the lack of guidance on this site: I guess because of the rapid changes, there’s no “you should do it like this” more of a “you can do it like this, or this, or this”
e.g. should I use a sprite sheet at all any more - I really don’t know. Obviously I can get around my immediate issue by just loading sprites from file - but is that the best way to do it?
Sorry to go off topic - but with the “should we have paid support” issue I though it a good idea to bring up.
You can take a sprite, render it to texture, apply the blur to that texture, save the blurred version and use it later. But in my opinion it’s better to simply make a blurred version in any redactor and add it to spritesheet.
Well, that’s what I am doing (except for the ‘saving’ part - I want to use it immediately)
But the problem I am having is that when I get the texture from, the sprite, the texture is the whole sprite sheet, and not just the portion of the sprite sheet for the sprite i want to blur.
And if I want to blur the same sprite differently (e.g. blurring more or less depending on some factor) then I should pre-render blurred versions of every frame at every blurred-level? My sprite-sheet would be huge!!