Game Development Community

Combining multiple views

by Nicolas Stohler · in Torque Game Builder · 08/28/2006 (10:21 am) · 4 replies

I think it is possible to combine multiple TGB views (t2dSceneGraphs?/t2dSceneWindows?).

But how?
Is there a sample somewhere?
Can those Sub-Views have different world/camera properties or do they have to be shared somehow?
...and can I load different levels into different Sub-Views at the same time?

#1
08/28/2006 (10:14 pm)
Yes it is :) ... Think of a Scene Graph as your world object. When you create a level in the Level Builder you can think of the Level parent object as the scenegraph, so when it gets loaded it loads that scenegraph (level).

A scenewindow can be set to a scenegraph and then it 'views' on that 'world'. You can assign a scenegraph to multiple scenewindows to view different areas at different dimensions of the same world, or create multiple scenegraphs to have different worlds.
#2
09/03/2006 (10:33 am)
Thanks for the reply, I have not had time to look into this so far, but will try soon.

I will need a combine the main game area with some other views (score, info, ...). so what do I need exactly to create such a setup? Currently (no subviews) I use the default sceneWindow2D and its sceneGraph (sceneWindow2D.getSceneGraph()).

what code do I need to change/create to create something like this:
+-[main]-----------------+
|                        |
| +-[game]-----+  +[x1]+ |
| |            |  |    | |
| |            |  +----+ |
| |            |         |
| |            |  +[x2]+ |
| |            |  |    | |
| +------------+  +----+ |
|                        |
+------------------------+

main: full screen
game: main game area, load from level file
x1:   score
x2:   info
pseudo code is also fine, I'll figure out the details.

is it possible to have overlapping areas (like [game] behind [x1] and [x2])?
#3
09/03/2006 (12:06 pm)
Unless you need to do anything funky with image maps and so-on, you could just setup x1 and x2 as GUI items. Set the GUI to be the full size (100x75 by default), then your sceneWindow appropriately (something like 60x40 maybe) and then position your score GUI items in the relevant place.

It all depends on what you want to achieve.
#4
09/03/2006 (5:49 pm)
This won't really answer how to write this functionality yourself but earlier today I posted a couple links to existing resources which implement multiple viewports:

www.garagegames.com/mg/forums/result.thread.php?qt=50128

-Unk