Displaying the same tileLayer twice?
by Lennart Steinke · in Torque Game Builder · 03/24/2005 (2:25 am) · 5 replies
Hi!
How would I display the same tile layer at different sizes at different positions?
Besides showing a part of the tile layer in my main playing area, I also want to have an overview on the map at the right of the screen.
How would I do that? Should I create another map with the same datablock? Create a 2nd instance of the tileLayer?
My main problem is that I'm not sure where the actual data is held and how I can position 2 objects sharing the same data,
-Lenny
How would I display the same tile layer at different sizes at different positions?
Besides showing a part of the tile layer in my main playing area, I also want to have an overview on the map at the right of the screen.
How would I do that? Should I create another map with the same datablock? Create a 2nd instance of the tileLayer?
My main problem is that I'm not sure where the actual data is held and how I can position 2 objects sharing the same data,
-Lenny
About the author
#2
I'm still fighting a bit with the gui, so don't be suprised if I post some follow-up questions :)
-Lenny
03/24/2005 (4:05 am)
The tiles will vanish (think down scrolling arkanoid like map) and the overview should show some of the screens to come. The map itself won't be that large I guess. Since it's only 8 tiles wide and just a single layer even 10 screens shouldn't be that large.Quote:Create another fxSceneWindow2D (GUI) window and position this for your overview map. If you didn't already know it, you can use "fxSceneWindow2D::setRenderMasks()" to select specific layers/groups to render which can be really handy
I'm still fighting a bit with the gui, so don't be suprised if I post some follow-up questions :)
Quote:Hope this helps,It helped. Thanks a lot!
-Lenny
#3
I'm pretty sure I'm missing something very basic, but was is it? :)
03/24/2005 (5:15 am)
Ok, I have the 2nd view showing, the problem is just that it seems like I can't position it corrctly. It appears always at the same physical position and now matter how I set the sizing paramters, neither size nor position change in different resolutions. I'm pretty sure I'm missing something very basic, but was is it? :)
#4
You can use the relative settings so that it stays in the same relative position if that's what you want.
- Melv.
03/24/2005 (6:00 am)
Have you been through some of the GUI docs? The GUI can be a bit of a pain sometimes.You can use the relative settings so that it stays in the same relative position if that's what you want.
- Melv.
#5
And yes, I went through the gui totorial for t3d and the physics engine tut. I'm just not sure what I am missing here.. the scene object doesn't have that many options, and I thought setting both width and height to relative should do the trick :(
-Lenny
03/24/2005 (6:20 am)
I had both size menu buttons set to relative. but it didn't change a thing.And yes, I went through the gui totorial for t3d and the physics engine tut. I'm just not sure what I am missing here.. the scene object doesn't have that many options, and I thought setting both width and height to relative should do the trick :(
-Lenny
Associate Melv May
If the tile-layer is dynamically changing e.g. its tiles are being changed or perhaps it's quite large and you don't want to duplicate it or just for any other reason then the only way to render the same object would be to do the following...
Create another fxSceneWindow2D (GUI) window and position this for your overview map. If you didn't already know it, you can use "fxSceneWindow2D::setRenderMasks()" to select specific layers/groups to render which can be really handy. Note that you can also change this dynamically. You'd only then need to ensure that your object(s) (in this case a specific layer) can be uniquely identified by a layer/group mask.
Now, when that window renders, it will only render objects that meet the layer/group criteria. Also note that just because objects are not rendering, doesn't mean that you can't reference objects in the window. What this means is that you can still get the new window to mount to the invisible player or any other object.
This new window has its own camera system as well which can be very handy if you need to change the overview somehow.
Hope this helps,
- Melv.