I have problem with stretching sprites in LibGDX.
I have one png file for the sky in the game (1x1000 px) and i want to do it 1000x1000px
sprite.setSize(pixelWidth,pixelHeight);
Edit: Here is the image that I want to stretch - sky . It has little gradient from the top to the bottom as you can see. I want to make it 1000px in width. I expect image that has color-change in the width.
But I get this strange result: Image
You can see that there is something like gradient in width, even with lines, but with no reason, because I am scaling 1px image...
The strange thing is that everything looks fine on other PC's and mobile phones... But I don't think that the problem is in my PC!?
I don't know what to try... Any ideas?
Sorry if I didn't explained it very well.. and sorry for my bad english
Final: It was from the filtering. I changed the filter from linear to nearest and everything was fine
i dont understand what your question realy is but a good way to scale a sprite is like this
sprite.setSize(scrw * 0.16f, scrw * 0.16f);
here scrw is your viewport's width
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With