Is it posible to blit gif animations instead of jpg images? I want to do it for a crosshair, that may be difficult to see when its over something of the same color, I want to do a crosshair as a gif animation in which the color change smottly so its easier to see.
BTW: I have problems blitting numbers, I made a 330 x 32 pixels contaning all the numbers from 0 to 9, but only the first one blits ok, I mean, the 0 appears ok, but the rest of numbers no, each number is at 33 pixels of width, but when trying to take the next 33 pixels it takes other things. I solved this testing with values and worked so so, asuming that the numbers are 23 pixels of width, but there arent.
No, you can't blit a GIF animation directly. You may load it, blit it using Java2D into seperate images and use that as textures.
If your texture is really 330*32, it will be scaled at load time to 256*32, because width and height have to be powers of 2. Try to embed the texture into a 512*32 one instead.
ok, thanks a lot.
I made another image for the numbers, now its 256x32, but has the same problem, the image is not blitted correctly even now, the x initial position is not the correct one.
I am taking each 25 pixels because there are 10 digits equaly separated on a 256 picture. What can I do?
Well, I solved the problem putting the numbers on a colum and not n¡on a row, this means, ordering them in the vertically.
Anyway this error should be check.
Quote from: "Melssj5"Anyway this error should be check.
I can't reproduce this without a test case. If you would be so kind... :wink:
Well, I cant give you a test case because when I did the image again and when I changed the code for blitting the numbers it worked fine, maybe an old image was still in memory causing this, but IDK, anyway is working perfectly now.