Panel.layer = lower than ent => below ent!?

Posted By: Espér

Panel.layer = lower than ent => below ent!? - 07/05/09 21:33

Is there any chance to get this in one of the next versions???:

if the panel´s layer is below 0, the panel is shown below all models.

Could be usefull for 2D games, where 3D models stand at top.. or ent based particles...etc..
Posted By: Helghast

Re: Panel.layer = lower than ent => below ent!? - 07/06/09 08:06

it's already working...
currently im making a pre-rendered game, using this technique.
what you gotta do, i make the level's background transparent, and render the panel to a negative layer.

If you want to see an example of this, add me on MSN, i'll show you now i made it work.
I'm gonna post it in the showcase soon as well though wink (give or take a week).

regards,
Posted By: Espér

Re: Panel.layer = lower than ent => below ent!? - 07/06/09 15:53

really... it´s not working for me o.O

i just need a function to show 3D animated models.. WITH PARTICLES AND SHADERS.. above 2D panel-made maps ( for a 2D RPG with 3D Elements )..
Posted By: Helghast

Re: Panel.layer = lower than ent => below ent!? - 07/07/09 07:46

i've added you on ICQ, i'll pass a piece of code when you get online that shows you how it works wink

It's really really easy! smile

regards,
Posted By: Espér

Re: Panel.layer = lower than ent => below ent!? - 07/07/09 15:28

holland ^^

god bless.. we´re near in our time zones ^^ ( no need to wake up 1:00 am XD )
Posted By: Helghast

Re: Panel.layer = lower than ent => below ent!? - 07/08/09 08:22

Im sorry, I dont have ICQ installed at home anymore, so i'll post this here then (brought the project from home to work to copy/paste the code :P)

what you have to do in your main first is to tell the engine the background is transparent:

Code:
sky_color.red = 0;
sky_color.green = 0;
sky_color.blue = 0;



make sure to load a level after that ofcourse wink

now, when creating a panel, make sure it's layer is set negative

Code:
STRING* tempcreateSTR = "#500";

// create a string that contains the image directory
str_cpy(tempcreateSTR, "./backgrounds/"); 
str_cpy(tempcreateSTR, my.string1);

// create bitmap from string
BMAP* tempBMP = bmap_create(tempcreateSTR); 

// create a panel, and assign the bitmap created from the string to it.
PANEL* currentBGrender = pan_create("flags = SHOW;", -5);
currentBGrender.bmap = tempBMP;



I read the string of an entity (which is something like: myCurrentImage.tga), and use that to load it from the backgrounds folder, then display that into a dynamic panel i create.

that's how I did it, really that's all... nothing strange, if you cant get it to work, i can send my project so you can see how I did it...

hope that helps you!
regards,
Posted By: Espér

Re: Panel.layer = lower than ent => below ent!? - 07/08/09 13:33

that´s all i´ve done:

Code:
//=================================================================================================================================
//                                                                                                                               //
//                                                     DAS MAINSCRIPT                                                            //
//                                                     ^^^^^^^^^^^^^^                                                            //
//                                                                                                                               //
//=================================================================================================================================
//                                                                                                                               //
//                                          EINBINDEN DER UNTERORDNER UND SCRIPTS                                                //
//                                          """""""""""""""""""""""""""""""""""""                                                //
//                                                                                                                               //
//=================================================================================================================================
#define PRAGMA_PATH "Graphics\Characters"
#define PRAGMA_PATH "Graphics\Battlebacks"
#define PRAGMA_PATH "Data\Levels"


#include <acknex.h>
#include <default.c>

//=================================================================================================================================
//                                                                                                                               //
//                                                       FUNKTIONEN                                                              //
//                                                       """"""""""                                                              //
//                                                                                                                               //
//=================================================================================================================================

BMAP* testobjekt = "Mountainroad.png";


action debugging()
{
	while(1)
	{
		my.pan  += random(3)*time_step;
		my.tilt += random(3)*time_step;
		my.roll += random(3)*time_step;
		wait(1);
	}
}
//=================================================================================================================================
//                                                                                                                               //
//                                                     DAS MAINSCRIPT                                                            //
//                                                     """"""""""""""                                                            //
//                                                                                                                               //
//=================================================================================================================================
function main()
{
	fps_max = 60;
	d3d_antialias = 9;
	video_set(1024,768,32,0);
	video_window(vector(10,10,NULL),NULL,48,"Panel below models!");
	screen_color.red   = 0;
	screen_color.green = 0;
	screen_color.blue  = 0;
	sky_color.red   = 0;
	sky_color.green = 0;
	sky_color.blue  = 0;
	level_load("leer.wmb");
	wait(3);

	error("before creating panel and entity");

	PANEL* testerpanel = pan_create("bmap = testobjekt; flags = SHOW;", -1);
	error("after creating panel");
	ent_create("Gegner_Weißer Drachenreiter_stehen+4.tga", vector(0,0,0), debugging);
	error("after creating entity");

//end of function
}



But Acknex crashes..


But after creating the panel...
The last error ( after creating the entity) is not shown...
Posted By: FBL

Re: Panel.layer = lower than ent => below ent!? - 07/08/09 13:37

You should not use special characters like ß in file names. Not sure whether this is the reason for the crash, though.
Posted By: Espér

Re: Panel.layer = lower than ent => below ent!? - 07/08/09 13:40

not really ^^
i used special characters often.. and they work.. i tried to change "weißer" to "weisser".. still crashing ^^
Posted By: flits

Re: Panel.layer = lower than ent => below ent!? - 07/13/09 18:37

Gegner_Weißer Drachenreiter_stehen+4.tga
you cant use ...Ber[space]drachen... spaces always crashes here
© 2024 lite-C Forums