Game Development Community

Page«First 1 2 Next»
#21
03/09/2005 (3:08 pm)
@Gonzo & Thc-03:

Just to clarify whether or not a PNG should be interlaced...

I have never used interlaced PNGs with Torque, and had no problems whatsoever, but just to see, I dug into the code a bit...

After perusing the PNG loading code (GBitmap::readPNG), it definitely looks like it doesn't matter if the PNG is interlaced or not, since this is handled transparently (to Torque) by the routines in libpng.

Also, an additional note: Looks like you can't have PNGs that are taller than 2048 pixels.

An additional additional note: If you don't want to use PNGs (for some strange reason) you can still specify an alpha channel with a separate JPG file: the filename should be .alpha.jpg where is the name of the RGB portion of the image.
#22
03/09/2005 (6:45 pm)
Kevin, although "Interlaced" may not be a TGE requirement, the data that is exported when you save to .png is different. I have had quite a few crash errors that were corrected immediately when saving the .png to "interlaced" so now I save ALL of them that way. And I have never had the crash problem since. IMO it just makes sense to "not chance it" and do them all that way.
#23
03/10/2005 (1:18 pm)
@Gonzo:
Quote:IMO it just makes sense to "not chance it" and do them all that way.

I totally understand the method to the madness now! =)

Quote:...the data that is exported when you save to .png is different. I have had quite a few crash errors that were corrected immediately...


Could you explain a little more about this? What do you mean the data that is exported is "different"? And what sort of crash errors should I be keeping an eye out for? (Like I said, I haven't had any issues with my PNGs... I use Paint Shop Pro for all my editing -- it seems to do the Right Thing.)
#24
03/21/2005 (4:15 pm)
*bump*

No really... can anyone (Gonzo?) explain in greater detail what crashes or errors you've encountered while working with PNGs (or JPGs for that matter)? This is exactly the sort of thing us newbs need to watch out for... also, if there is a potential bug (or bugs) in the loading code that is causing these issues, it makes sense to try and track it down and get it fixed.
#25
05/30/2005 (1:23 pm)
Kevin


Quote:What do you mean the data that is exported is "different"?


Well, it's different. I do not know the specifics but I can tell you this from just common sense thinking, lol...

If they were not different in some way, then why have two different methods?


As for crashing, it's been so long ago, I can't give you very specific info, but I do know that for a while I had crashing problems when modifying .png's untill I discovered just by trial and error that my crashing stopped when I saved as Interlaced. Since that time I have saved them all that way and I have not had any .png crashing problems ever since. As for tracking down the "bug", what would be the point? You have to save as one or the other, and if you use Interlaced, then the bug is rendered moot. Not worth wasting time on IMO.

Hope this helps somehow, lol.
#26
09/22/2008 (1:26 pm)
I know this post is old but anyway,
i was trying to modify the demoWindow.png in TGE or TGEA, the engine crashes.

I followed the resource and i'm 100% sure that everything is set up.

But i realized when i have different "tile" sizes than in the demoWindow image, the engine will crash.

Do i really have to keep this size? I thought i can use my own sizes as long as i keep them seperated by at least 1 px.
#27
09/22/2008 (9:55 pm)
You need to set them in rows. All rectangles in a rows should align on top with 1px separation. It doesnt matter how many rectangles you place in a row but the in the next row all the objects should have the same top alignment.
OOOOOOOOOOOOOOOOOOOO //Your align row
AAAOBBBBOCCCCCCODDDDDDD
AAAOOOOOCCCCCCODDDDDDD
OOOOOOOOCCCCCCODDDDDDD
OOOOOOOOOOOOOOOOOOOO //Another align row
FFFFFOGGGGOHHHOIIIIIIIIIIIIIII
FFFFFOGGGGOHHHOIIIIIIIIIIIIIII
OOOOGGGGOHHHOIIIIIIIIIIIIIIII
OOOOOOOOOOOOOOOOOOOO

Not an ascii artist, but I hope you get it. Regions A, B, C, D are in a row. They are separated 1px from the top and 1px between them. Row with regions F, G, H, I are aligned to the row top and separated by 1 px between them.

All pixels O should be the same color. Any difference in color will break the engine. You may have an alpha channel if you want some transparency.

Luck!
Guimo
#28
09/22/2008 (11:10 pm)
You are so right, thanks a lot. I realized (after checking pixel by pixel) that ONE pixel had not the same color as the background. Background was FF0000 and the Pixel was FF000B q_q

But glad it works now, i like it much better now compared to the standard gui layout lol.

Thanks a lot!
#29
09/30/2008 (1:55 pm)
The zombie arises again... But there is some good info here, so it's probably a good resurrection. =)

I recommend using at least two layers when building your array images. The background layer you set to your separator color and then just leave it alone. Then build out your gui elements on the successive layers, of course leaving the space between elements transparent. Finally, merge it all, and you're good to go with no worries about any stray pixels' color being off. This also give you much better control over the creation of an alpha channel if you need to do so.
Page«First 1 2 Next»