Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
HM2 FMF Smithee

is there a better way to have images displayed in the game?

Recommended Posts

To display a poster or custom sign in the game, I have been adding the init line:

this setObjectTexture [0,"image_folder\image_name.jpg"];

to have my custom image attached to the object for gamers to see, but the drawback has been that the image is a black square until a user comes close enough to it to have the image load-up for them to view it.

I had it explained to me once that I could create a sqm file in which I list the object name and it's location on the map and set the init line for that image in the sqm file - but never really got the details beyond that nor any examples to backwards-engineer.

Does anyone have an idea of what I'm describing or perhaps another methods that would load the images as part of the map launching so that they don't appear as black squares until someone comes close enough to them?

Another question while I'm at this, is it true that there is a certain color key-code that would be "viewed" as a clear color in game?

Share this post


Link to post
Share on other sites

I read something recently saying that the black rectangle thing happens with jpg's and it's to do with the compression. Could try converting to paa (http://forums.bistudio.com/showthread.php?89147-Converting-jpg-to-paa).

In saying that, i'm a newb so it's possible, and probably likely, that i'm wrong but I thought I'd throw it out there.

Share this post


Link to post
Share on other sites

yes having the texture as a .paa should fix the issue

Share this post


Link to post
Share on other sites
To display a poster or custom sign in the game, I have been adding the init line:

this setObjectTexture [0,"image_folder\image_name.jpg"];

to have my custom image attached to the object for gamers to see, but the drawback has been that the image is a black square until a user comes close enough to it to have the image load-up for them to view it.

I had it explained to me once that I could create a sqm file in which I list the object name and it's location on the map and set the init line for that image in the sqm file - but never really got the details beyond that nor any examples to backwards-engineer.

Does anyone have an idea of what I'm describing or perhaps another methods that would load the images as part of the map launching so that they don't appear as black squares until someone comes close enough to them?

Another question while I'm at this, is it true that there is a certain color key-code that would be "viewed" as a clear color in game?

What the above guys already said, and if you want Transparency, save it as a .png and then convert it to a .paa

Share this post


Link to post
Share on other sites

many thanks all.

Installed the TexView2 tool today and gave it a try. I need to do some learning here - when I saved .png file to .paa using the TexView tool, anything colored red is turned blue, some things in the color black just show as clear.

But, it is loading like you all suggested. Again, thanks.

Share this post


Link to post
Share on other sites

Make sure you use a PNG32 (with an actual alpha-channel). Not an indexcolor png.

Share this post


Link to post
Share on other sites
Make sure you use a PNG32 (with an actual alpha-channel). Not an indexcolor png.

How would I do that with gimp? I'm not too sure about that. On gimptalk they're saying that saving an image in rgb mode with an alpha channel would be enough to create a 32-bit png. But it never works for me, the colours are always partially inverted. Even removing and readding the alpha channel doesn't prevent that.

Edited by Pergor

Share this post


Link to post
Share on other sites

Also, make sure the size is n2

Like 128x256, 256x256, 512x64, 512x64 etc.

The colours will go weird if you used 200x200 or something like that.

Share this post


Link to post
Share on other sites

first off, thank you all, my friends for your feedback and advice.

I did not comprehend the alpha channel thing - reading an article on it helped clear that up: http://www.ehow.com/info_10000153_alpha-channel-gimp.html

I'm using Photoshop Elements and it didn't explicitly show the ability to save as a 32bit PNG, so it looks that selecting a new image as a RGB sets the stage for saving as 32bit.

Then I open it in TexView2 and save as paa format with RGBA.

Now I'm trying to flip the image to lay flat on the ground, as if stenciled it on the concrete.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×