.png image problems
by Jeremy Alessi · in Torque Game Engine · 02/24/2005 (3:48 pm) · 8 replies
I've replaced the .png files for the HUD of the fps starter kit. The file names are identical but some of the file sizes differ. I'm using Adobe Photoshop 5.5 to create (actually I'm just modifying the existing ones) these .png's and I've created new alpha channels. The new .png's cause an error in Torque that causes the whole engine to crash bringing up the XP error report. What could be the problem?
About the author
#2
02/24/2005 (4:05 pm)
You may want to see if you can find anything via forum search--I've heard rumors about this being one of the most difficult images to modify, but I can't point to any specifics. It probably has something to do with a hard coded expectation of the size of the image that your new image doesn't meet, but that's a guess.
#3
02/24/2005 (7:05 pm)
What's crazy is I only tried to change the color of it!
#4
02/25/2005 (4:06 am)
If thats an array image (I think it is) you will need to take notice of the very first pixel. This one color is used through out to mark the borders of each image. Changing colors will generally munge this value, causing the whole image to not work.
#5
I am having the same problem and the secret might be in whats hidden under the alpha channel. Could be hidden colour information etc.
--------
Reporting back... The stripping of the Alpha channel revealed a blue (RGB = 0,0,255) background and around the elements that make up the Chat-HUD there are white (RGB = 255,255,255) boxes 'encasing' each part.
I am guessing these parts of the PNG need to stay in-tact for it to function. It's probable that the colour information can be altered within these white boxes (you would hope!) but I just tried one and it didn't work (crash). I'll go try again .....
03/15/2005 (6:24 am)
I don't know if this will help you but ...I am having the same problem and the secret might be in whats hidden under the alpha channel. Could be hidden colour information etc.
--------
Reporting back... The stripping of the Alpha channel revealed a blue (RGB = 0,0,255) background and around the elements that make up the Chat-HUD there are white (RGB = 255,255,255) boxes 'encasing' each part.
I am guessing these parts of the PNG need to stay in-tact for it to function. It's probable that the colour information can be altered within these white boxes (you would hope!) but I just tried one and it didn't work (crash). I'll go try again .....
#6
I can now create my own HUD... BUT I am limited to using vectors to create the colour information. Anyone who wants a simple HUD array for their game can find one on our site in the download section. It is a very simple 2 pixel border but it WONT crash out your PC or cause errors and it DOES get you away from the designs of the FPS starter kit etc. etc.
Anyone who wants the file go to www.pitfighters.com and hit the download button.
Hope this helps.
J.
04/05/2005 (2:29 pm)
I have had limited success with the chatHUD.I can now create my own HUD... BUT I am limited to using vectors to create the colour information. Anyone who wants a simple HUD array for their game can find one on our site in the download section. It is a very simple 2 pixel border but it WONT crash out your PC or cause errors and it DOES get you away from the designs of the FPS starter kit etc. etc.
Anyone who wants the file go to www.pitfighters.com and hit the download button.
Hope this helps.
J.
#7
I made the alpha channel as a separate file which i drop into a layer in Fireworks. Then I add the HUD colour information on another layer and flatten them into a PNG. At the moment I can only do this with vectors.
04/06/2005 (6:35 pm)
One thing to remember is when you are creating the 1 pixel 'gaps' the array code looks for, make sure you are not using Anti-alias because it could screw it up.I made the alpha channel as a separate file which i drop into a layer in Fireworks. Then I add the HUD colour information on another layer and flatten them into a PNG. At the moment I can only do this with vectors.
#8
Erik is right -- the pixel at 0,0 determines the color key to look for when determining the bounds of each cell in the array. This color key cannot be used anywhere within each cell, or you'll have issues. Also, each cell must be completely framed with the color key. Edit: Except for the left-most cells; these should not have the border on the left side. The frame can be any width as well.
Jason, good tips... I also recommend choosing a color key that won't ever be used in the actual graphics. (I use magenta (255, 0, 255) since I very rarely have magenta in any of my graphics.) Always use layers -- it's far easier to control your image's elements with layers. And you can place the color key layer on the very top, easily creating a mask that will automagically work in Torque when you flatten your image to save as PNG or JPG.
11/04/2005 (4:09 pm)
Old thread but I'll put in my $0.02. =)Erik is right -- the pixel at 0,0 determines the color key to look for when determining the bounds of each cell in the array. This color key cannot be used anywhere within each cell, or you'll have issues. Also, each cell must be completely framed with the color key. Edit: Except for the left-most cells; these should not have the border on the left side. The frame can be any width as well.
Jason, good tips... I also recommend choosing a color key that won't ever be used in the actual graphics. (I use magenta (255, 0, 255) since I very rarely have magenta in any of my graphics.) Always use layers -- it's far easier to control your image's elements with layers. And you can place the color key layer on the very top, easily creating a mask that will automagically work in Torque when you flatten your image to save as PNG or JPG.
Torque Owner Jeremy Alessi