Hi Community i wrote i think a useful but simple code
u remember u want to publish a game but u forgot that other people have another resoulution and u have to do 20 other bmaps
With this code u only need to create one bmap the code wll scale it for u right so that u can save much time
so here we go first as bacground u need to create a picture as big as your resolution is in my case 1440*900
press F5 to test it (:
now comes the code :

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////
var width;
var height;


PANEL* test=
{
	bmap="test.jpg";
	pos_x=0;
	pos_y=0;
	layer=1;
	flags=VISIBLE;
}

PANEL* testbutton=
{
   bmap="test2.jpg";
   //dont put any position here 
   layer=2;
   flags=VISIBLE;
}

function main()
{
	level_load("");
	while(1)
	{
		width=screen_size.x;
		height=screen_size.y;

		test.scale_x=1/(1440/width);//here there where 1440 stands there must be your screen_size.x
		test.scale_y=1/(900/height);//here there where 900 stands must be your screen_size.y
      
      testbutton.scale_x=1/(1440/width);//here there where 1440 there must be your screen_size.x
		testbutton.scale_y=1/(900/height);////here there where 900 there must be your screen_size.x
      
      testbutton.pos_x = 520/(1440/width);//so here put the position.x of the panel and the button button in relation to your screen_size in my case its near the middle 
       
testbutton.pos_y = 250/(900/height);//so here put the position.y of the panel and the button button in relation to your screen_size in my case its near the middle 
      
      
		wait(1);
	}
}



and here is an example
http://www.filefront.com/17277237/test.zip
WFG Progger laugh


Last edited by Progger; 09/09/10 20:48.

asking is the best Way to get help laugh laugh laugh