View over Panel

Posted By: dd231

View over Panel - 09/24/12 04:27

Can someone tell me why the VIEW* won't overlay the PANEL*? The panel and view are visible and view layer is greater than the PANEL* layer so it should be visible when the panel shares the x and y position, however it doesn't frown

Code:
VIEW* mini_map = 
{ 
   layer = 3; 
   pos_x = 1400; 
   pos_y = 0; 
   size_x = 300; 
   size_y = 250; 
   tilt = -90; 
  
PANEL* side_panel = 
{ 
   layer = 1;  
   bmap = panel1;
   size_x = 300; 
   size_y = 800; 
   flags = SHOW;  
}

function handle_panels()
{
  mini_map.pos_x = screen_size.x - mini_map.size_x; //places  mini map at far right of screen
  mini_map.pos_y = screen_size.y - (screen_size.y-22); //places mini map at very top of screen within border
  //
  side_panel.pos_x = screen_size.x - side_panel.size_x; //places side panel at far right of screen
  side_panel.pos_y = screen_size.y - screen_size.y; //places  side panel at bottom of screen	
  //
  vec_set(side_panel.scale_y,vector(2,0,0));
}

Posted By: jcl

Re: View over Panel - 09/24/12 06:18

http://manual.3dgamestudio.net/apanel-layer.htm
Posted By: dd231

Re: View over Panel - 09/24/12 15:43

Layer sort doesn't do anything for me... I've tried placing it another part of my code but it does nothing to help. Not to mention it shouldn't be have to be called because the layers are already set in the above code as you can see.

VIEW = 3; and PANEL = 1 therefore VIEW should overlap PANEL but it doesn't! Is there any other ideas? It should be a simple fix!
Posted By: Superku

Re: View over Panel - 09/24/12 15:50

Quote:
Panels, texts, and view entities with a positive layer value are placed above any view; with a negative layer value they are placed below any view.
Posted By: Ch40zzC0d3r

Re: View over Panel - 09/24/12 15:52

Originally Posted By: dd231
Layer sort doesn't do anything for me... I've tried placing it another part of my code but it does nothing to help. Not to mention it shouldn't be have to be called because the layers are already set in the above code as you can see.

VIEW = 3; and PANEL = 1 therefore VIEW should overlap PANEL but it doesn't! Is there any other ideas? It should be a simple fix!


Learn2Read.
Quote from manual:
[...] Panels und Texte werden immer oberhalb sämtlicher Views angezeigt, unabhängig von deren LAYER-Werten.

[...] Panels and texts are ALWAYS rendered above views, independent from their layers.
Posted By: dd231

Re: View over Panel - 09/24/12 16:05

Quote:
Learn2Read


Thanks for the attitude Ch40zzC0d3r... I'm simply trying to learn here. I have read the section in the user guide and that's why I am on the forum... Do you try to discourage alot of noobs on the forum?
Posted By: dd231

Re: View over Panel - 09/24/12 16:47

I assumed that both the view and panel had to be positive values because the default view is set at zero and if I make the side panel a negative value it hides behind the main view. So I set the main view and side panel as negative values and the mini map as a positive value, however, I still lose the side panel under the main view...

Code:
#include <acknex.h>

BMAP* panel1 = "metal_texture.jpg";

VIEW* main_view = 
{  
	layer = -2;
   size_x = 3000; 
   size_y = 2500;
}

VIEW* mini_map = 
{  
	layer  =  1;
   size_x = 300; 
   size_y = 250; 
}

PANEL* side_panel = 
{   
	layer = -1;
   bmap  = panel1; 
   flags = SHOW;  
}

function main()
{
	video_mode = 12;
	video_screen = 1;
	level_load(""); 
	//
	while(1)
	{
		if(key_esc) sys_exit(NULL);
		//
		mini_map.pos_x = screen_size.x - mini_map.size_x;
		mini_map.pos_y = screen_size.y - screen_size.y;
		//
		side_panel.size_y = screen_size.y - screen_size.y;
		side_panel.pos_x = screen_size.x - (side_panel.size_x); 
		//
		wait(1);	
	}
}



PS. Thanks for being helpful Superku! It's very much appreciated laugh
Posted By: Superku

Re: View over Panel - 09/24/12 17:14

It won't work this way (as you've already noticed), just render the view into a bitmap and display the bitmap in a panel.
Posted By: dd231

Re: View over Panel - 09/24/12 17:22

Ok will do... once again thanks so much!!! Sie sind die besten!!!
© 2024 lite-C Forums