how to put a VIEW on top of a panel

Posted By: ncc1701d

how to put a VIEW on top of a panel - 03/31/10 06:13

Just wondering if someone could give me a clue as it if I can have a camera VIEW say 100 x 100 on top of a panel thats say 200x200 on top of the level I am playing?
I can create camera VIEW now but it shows up directly on top of the level I am playing not on top of the panel.
Can I do this? I have played with various layer numbers and it doesnt seem to make a difference.
Any trick to putting a camera VIEW on top of a panel? The panel of which exists on top of the level I am playing.
thanks
Posted By: bart_the_13th

Re: how to put a VIEW on top of a panel - 03/31/10 07:37

Use another panel with higher layer and render the camera into that.
Code:
camera_view_panel.bmap=camera.bmap;



Only work for A7 comm or above though...
Posted By: ncc1701d

Re: how to put a VIEW on top of a panel - 03/31/10 09:03

Hey Bart,
perhaps you could restate your code sample in terms of what I have below with my mini test? Your code sample is little confusing to me since I am new to programming.

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


function main()
{
level_load("roller.wmb"); // load the level
}

PANEL* squareone_pan = //panel between gameplay level and the VIEW camera 3rd person
{
layer = 1;
pos_x = 134;
pos_y = 134;
bmap = hpic.tga;
flags = SHOW;
}

PANEL* squaretwo_pan = //another panel?
{
pos_x = 334;
pos_y = 234;
layer = 3;//
bmap = "MPanel.tga";
flags = SHOW;
squaretwo_pan.bmap=camera3rdperson_view.bmap;//?????
}

VIEW* camera3rdperson_view =

{
layer = 3;
pos_x = 97;
pos_y = 97;
size_x = 100;
size_y = 100;
flags = SHOW;

}
Posted By: bart_the_13th

Re: how to put a VIEW on top of a panel - 03/31/10 09:45

Try:
Code:
PANEL* squaretwo_pan = //another panel?
{
pos_x = 334;
pos_y = 234;
layer = 3;//
bmap = "MPanel.tga";
flags = SHOW;
}

function main()
{
squaretwo_pan.bmap=camera.bmap;
level_load("roller.wmb"); // load the level
}



I have a habit to put main at the bottom of the program. The rest is like your code
Posted By: ncc1701d

Re: how to put a VIEW on top of a panel - 04/03/10 01:43

if I reverse the
squaretwo_pan.bmap=camera.bmap;
to be
camera.bmap=squaretwo_pan.bmap
it then works like you said otherwise it doesnt work. So now the camera is showing in the image squaretwo_pan MPanel.tga
The only thing is though is now the everything else is black except what is seen in the the sqaretwo_pan.
can I have both it show up in the squaretwo pan AND the level I am playing in?
thanks for your help.
© 2024 lite-C Forums