Jump to content
Sign in to follow this  
wiggum2

Display image ingame (class RscTitles)

Recommended Posts

Hi, in ArmA2 i could display a image in the middle of the display just fine with this:

description.ext

class RscTitles
{
titles[]={};
class intro
{
  	idd=-1;
  	movingEnable=0;
  	duration=4;
  	fadein=1;
  	fadeout=1.9;
  	name="intro";
  	controls[]={"title1"};

  	class title1
	{
		type=0;
		idc=-1;
		size=1;
		colorBackground[]={0,0,0,0};
		colorText[]={1,1,1,1};
		font="Zeppelin32";
  	  	text="img\logo.paa";
		style=48;
  	  	sizeEx=0.15;
		x=0.2;
  	  	y=0.4;
  	  	w=0.6;
  	  	h=0.168;
	};
};
};

init.sqf:

titleRsc ["intro","PLAIN"];

(the logo.paa is 995x223px)

But in ArmA3 it is totally displaced and stretched, what do i do wrong ?

Share this post


Link to post
Share on other sites

Try to make it 1024x1024 (or any other power of two). In your case I'd save it as .png, then load up GIMP (or any other image editing program), create a new image (1024x1024), set background to transparent and then copy in your image, position it, save it as .png, convert to .paa and so forth.

Share this post


Link to post
Share on other sites

try

style = 0x30 + 0x800

picture and keep aspect ratio

Share this post


Link to post
Share on other sites

I already tried that IndeedPete, no luck.

@ Larrow

What does that actually do (i mean the "0x30 + 0x800" part) ?

Share this post


Link to post
Share on other sites

As i wrote above,

0x30 is hex for 48 (like you already had) and tells the control to expect a path to a image to display rather than using the text line as a string to display.

0x800 tells the control to keep the aspect ratio of the image and not to stretch it to fill the control.

Not 100% sure it will definitely work, that's why i said try it, Ive used it in some controls and it seemed to do the job but I'm so used to making images for games a power of two i do it with out thinking.

Share this post


Link to post
Share on other sites

Both of these work

style = 48 + 0x800; // ST_PICTURE + ST_KEEP_ASPECT_RATIO
style = 0x30 + 0x800;

This is an Arma 2 font.

font = "Zeppelin32";

so for A3 try

font = "PuristaMedium";

Share this post


Link to post
Share on other sites

That works, thanks guys !

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×