PANEL* /TEXT* - target_map

Posted By: HeelX

PANEL* /TEXT* - target_map - 11/21/07 12:23

http://www.conitec.net/beta/target_map.htm

target_map
Render target for panels and texts. If this parameter is set to a bitmap, the object renders into the bitmap instead of on the screen.


Honestly, this is a really cool feature! Though, how useful is it? There are still question about it:

  • How does a RTT panel react with the mouse? If I use a panel on a model: will the mouse be evaulated correctly?
  • This would make resolution indepent display-programming easier. Currently I run for each panel a callback which grabs specific layout information (position on a reference resolution) and calculates the scaled position and scaling for the panel. If I pass the panel to a bmap of a view entity - given that the mouse gets evaluated - the engine would do the main scaling stuff by itself. But most interfaces are build upon several panels and texts. How could I nest several panels with target_map into another so that I finally pass one composition of these to one view entity skin?
  • Will this apply to TTF Texts as well?
  • If the mouse is evaluated on skins and I want to develop code for a drag-and-drop operation - how would I do that if the panel is passed to an entity skin? In the current state I work with the difference vector from panel to mouse and the framewise movement vector of the mouse. How would I work on this?


I am really excited about this feature, so I apologize for my nagging questions

[EDIT] Again about the nesting feature: Maybe you could add a new engine sort-of-collection datatype which holds several panels and text (added via engine commands... its basicalls a stack or a linked list) and has one target_map pointer? You can e.g. switch the collection's visibility off and all contained panels switch off, too. Or such things..

Cheers, Christian
Posted By: jcl

Re: PANEL* /TEXT* - target_map - 11/21/07 15:11

I'm afraid I have to dampen the enthusiasm: The panel does not know where in the level its render target is displayed (if at all), and thus can't react on the mouse. For reacting on the mouse within in the level you have to use an entity on_click event with the sprite or model the panel is rendered to.

The feature is intended mainly for displays or texts on level surfaces. TTF fonts should work.
Posted By: HeelX

Re: PANEL* /TEXT* - target_map - 11/21/07 15:39

If I would calculate the position of the cursor on the panel, you could maybe provide a sort of message function that takes the PANEL*, the cursor position on the panel and a flag covering the button state (none, click, rightclick). So when I write an on_click event for the entity/sprite/whatever, I would calculate the position on the panel (in panel coordinates!) and then execute the message function. Would this work? I guess you use as well a similar function in the engine that takes the mouse position and the button state and then you cycle through all visible panels!?

Do you think a nested panel-collection would be natively possible with target_map? If not, would you have fun to work on this?

Cheers, Christian
Posted By: Joey

Re: PANEL* /TEXT* - target_map - 11/21/07 22:22

to your first question: it's indeed possible, best solution for that is a transformation matrix which calculates view space into "panel space". i've done this once (without a matrix, though) for passing events to a rendered window control.
Posted By: HeelX

Re: PANEL* /TEXT* - target_map - 11/21/07 22:58

I will ask you when I'm dealing with that, thanks for that info.
Posted By: jcl

Re: PANEL* /TEXT* - target_map - 11/22/07 09:54

For calculating the 2D click position within the panel you'll need the 3D position of the mouse hit point. The mouse event does not give you the hit point, but you could use c_trace instead.
Posted By: WINBERRY

Re: PANEL* /TEXT* - target_map - 11/22/07 19:06

by any chance is there a way to place a VIDEO , *.AVI onto a panel? I'm trying to make a video screen that appears to be talking to the PLAYER through the control panel (cockpit)

thanks
Posted By: HeelX

Re: PANEL* /TEXT* - target_map - 11/22/07 20:09

This is already possible by setting the panel's bmap pointer in the media_play instruction.
Posted By: hack-panther

Re: PANEL* /TEXT* - target_map - 03/08/08 16:08

Sorry, dass ich den recht alten Thread wieder aufwirble aber
ich habe eine kleine Frage zu target_map und möchte kein neues Thema eröffnen:

Ich habe die Version 7.07.5 und experimentiere gerade etwas mit target_map rum.
Ich weiß, dass dieses feature offiziell erst ab 7.08 zur verfügung steht, aber
es klappt soweit ganz gut.
Nur als ich versucht habe eine TGA-Datei mit Alphachannel auf einem Sprite zu rendern,
sind die schwarzen Kanten des Alphachannels nicht unsichtbar.

Funktioniert es erst bei Version 7.08 oder funktioniert es generell nicht?

Hoffe auf Antwort... Danke
Posted By: HeelX

Re: PANEL* /TEXT* - target_map - 03/09/08 08:49

I think this is intended. Nevertheless -

@JCL: how could one overcome this?
Posted By: FBL

Re: PANEL* /TEXT* - target_map - 03/09/08 11:57

Did you define a 32bit BMAP?

Otherwise the alpha channel can get lost.
Posted By: hack-panther

Re: PANEL* /TEXT* - target_map - 03/09/08 14:21

It`s an 32bit BMAP and the alphachannel works fine on a normal panel.

I hope it will works somehow...
...Otherwise my gui-menu on the 3D display has an Quadrangular mousegraphic.
Posted By: jcl

Re: PANEL* /TEXT* - target_map - 03/10/08 12:58

I am not sure if alpha channels are possible on render targets at all. I'll check.
Posted By: Anonymous

Re: PANEL* /TEXT* - target_map - 04/08/08 11:16

 Quote:
am not sure if alpha channels are possible on render targets at all. I'll check.


Any news about alpha channels on render targets?
© 2024 lite-C Forums