Add view property for panel

Posted By: vlau

Add view property for panel - 03/01/06 17:17

It'll be nice to add a "view" property for panel,
for example :

view myNewCamera
{
...
...
}

panel myPanel
{
view = myNewCamera;
...
...
}

then myPanel only shown on myNewCamera,
if I change back to default camera,
myPanel will disappear automatically.
Posted By: capanno

Re: Add view property for panel - 03/09/06 09:49

Its 2 lines of scripting!

myPanel.visible = on/off; wherever you make your view visible/invisible.


Posted By: vlau

Re: Add view property for panel - 03/09/06 14:55

Quote:

Its 2 lines of scripting!




Yes, you're right , but if I have 10 or more panels
shown on 1 view/camera only?

With this feature, you don't need to invisible panel 1,
panel 2, panel 3.....while switch to another camera view.

Hope that it can be done!!!
Posted By: PHeMoX

Re: Add view property for panel - 03/14/06 14:53

Well you could also try to merge some of the panels together, so you have 1 big background panel instead of several smaller ones, but I see your point ..

Cheers
Posted By: FRAJO

Re: Add view property for panel - 03/14/06 16:24

Could easily be done with a small pulg-in.
Posted By: vlau

Re: Add view property for panel - 03/14/06 17:02

Quote:


Well you could also try to merge some of the panels together,
so you have 1 big background panel instead of several smaller ones,
but I see your point ..





How can you do that?
Posted By: FRAJO

Re: Add view property for panel - 03/14/06 18:02

smething like that:


DLL_RegisterPanel(PANEL*,VIEW*);

DLL_UnregisterPanel(PANEL*);

DLL_SetVisibility(VIEW*);// set the visible flag for all registered panels

If I have time I'll write that plug-in.

EDIT:
Took the time and wrote it:
Here it is ( wasnt that fast ? )

It should work.
Posted By: vlau

Re: Add view property for panel - 03/15/06 03:49

Thank you, FRAJO.

EDIT
----
Great! Work perfectly. You should put it into Wiki page.

BTW, should I issue DLL_UnregisterPanel(_Panel),
DLL_UnregisterAllPanelsOfView(_View) when exit the game or
doing that when the panel/view are no longer necessary in the game?

Thank you so much.





Posted By: FRAJO

Re: Add view property for panel - 03/15/06 15:55

On game exit all ressources are freed.

EDIT: you dont have to pass a valid view pointer. You can also use IDs except 0.
So you can have many groups not bound to any view.

Ex:

#define ID_GROUP1,1;//dont use 0

DLL_RegisterPanel(MyPan,ID_GROUP1);

EDIT2: Added to wiki.
© 2024 lite-C Forums