Multiple Scenegraphs?
by Jacob Wagner · in Torque Game Builder · 05/28/2006 (9:54 pm) · 1 replies
I did some searching for posts discussing how to implement this but I didn't find any details.
Here is what I want:
I want 2 scenegraphs: the regular one to hold the sprites and what not, and a second scenegraph to
hold a tilemap. The tilemap scenegraph should be drawn below the main
scenegraph.
My actual goal is to create a real time strategy spaceship game with a scrolling star tilemap in the background. I think I've got the tilemap scrolling part down, though. I'll just move the camera coordinates as the user puts the mouse on the edge of the screen and scroll the tilemap at the same speed (if i can figure out the math for that).
Here is what I want:
I want 2 scenegraphs: the regular one to hold the sprites and what not, and a second scenegraph to
hold a tilemap. The tilemap scenegraph should be drawn below the main
scenegraph.
My actual goal is to create a real time strategy spaceship game with a scrolling star tilemap in the background. I think I've got the tilemap scrolling part down, though. I'll just move the camera coordinates as the user puts the mouse on the edge of the screen and scroll the tilemap at the same speed (if i can figure out the math for that).
Torque 3D Owner Rodney Rindels - Torqued
Divide By Zero
An example GUI
//--- OBJECT WRITE BEGIN --- new GuiControl(myCustomGUI) { canSaveDynamicFields = "0"; Profile = "GuiDefaultProfile"; HorizSizing = "right"; VertSizing = "bottom"; position = "0 0"; Extent = "800 600"; MinExtent = "8 2"; canSave = "1"; Visible = "1"; hovertime = "1000"; new t2dSceneWindow(sceneWindow1) { canSaveDynamicFields = "0"; Profile = "GuiDefaultProfile"; HorizSizing = "right"; VertSizing = "bottom"; position = "0 0"; Extent = "797 335"; MinExtent = "8 2"; canSave = "1"; Visible = "1"; hovertime = "1000"; lockMouse = "0"; useWindowMouseEvents = "1"; useObjectMouseEvents = "0"; }; new t2dSceneWindow(sceneWindow2) { canSaveDynamicFields = "0"; Profile = "GuiDefaultProfile"; HorizSizing = "right"; VertSizing = "bottom"; position = "5 316"; Extent = "792 181"; MinExtent = "8 2"; canSave = "1"; Visible = "1"; hovertime = "1000"; lockMouse = "0"; useWindowMouseEvents = "1"; useObjectMouseEvents = "0"; }; }; //--- OBJECT WRITE END ---Others may know a better way as well. But I find this gives me granular control over what I'm displaying and where ,when, etc. without alot of custom handler code.
HTH,
Rodney