Question about setting the window name
by David Roberts · in Torque Game Builder · 03/01/2005 (1:24 pm) · 5 replies
Hi,
I know that you can specify the window name by using:
InitCanvas("my_window_name");
as shown in the basic tutorial scripts.
I am now modifying the spacescroller scripts for the game that I am working on and would like to change the windowName from "T2D" to something different. I cannot for the life of me figure out where the windowName is being specified in the scripts within the spacescroller folders though! Can you also change the canvas name after it has been initialised?
I have a feeling that this is gonna prove to be a "Doh!" moment but does anyone know how I can do this?
- Dave.
I know that you can specify the window name by using:
InitCanvas("my_window_name");
as shown in the basic tutorial scripts.
I am now modifying the spacescroller scripts for the game that I am working on and would like to change the windowName from "T2D" to something different. I cannot for the life of me figure out where the windowName is being specified in the scripts within the spacescroller folders though! Can you also change the canvas name after it has been initialised?
I have a feeling that this is gonna prove to be a "Doh!" moment but does anyone know how I can do this?
- Dave.
About the author
#2
I have checked the previous main.cs scripts and gui definitions within the spacescroller folder and cannot find where the Canvas windowName is being set to "T2D".
03/01/2005 (2:20 pm)
Yeah - that is the method for setting the window name in the T2D example folder - but if you are modifying the spacescroller code, the initialiseClient function in example/spacescroller/client/client.cs doesn't have an InitCanvas call. I have checked the previous main.cs scripts and gui definitions within the spacescroller folder and cannot find where the Canvas windowName is being set to "T2D".
#3
If you modify the space-scroller, don't forget it runs as a mod to the blank T2D. We were allowing people to create their stuff in T2D.
You can only create one Canvas (window). The only in the T2D code is the correct one to change.
You can run a mod as a base if you want by using -Game command-line (see the "main.cs" in the root) but to do this, the project in question must create its own Canvas. If you add this to the scroller in a similar manner to the T2D project, you'll no longer be able to run it as a mod as the two canvas collide.
At the moment, some of the common stuff is loaded in the T2D project ("demoDatablocks.cs") so be careful.
Again, we're not restricting people here, you can configure this stuff however you like. We just wanted to provide a system that offered a balance between function, flexibility and simplicity. Whatever you do, try to keep the mods for the editors in the "main.cs" in the root so you've always got editor support.
- Melv.
03/01/2005 (2:32 pm)
@David: There are no fixed rules here. We decided to setup the demos (only one at the moment) as MODs. This means that there's a base (T2D) and mods. Both the editors are mods and run in parallel of everything else. This is a powerful way to develop games but can be confusing at first although there are resources showing minimum apps without all this mod stuff.If you modify the space-scroller, don't forget it runs as a mod to the blank T2D. We were allowing people to create their stuff in T2D.
You can only create one Canvas (window). The only in the T2D code is the correct one to change.
You can run a mod as a base if you want by using -Game command-line (see the "main.cs" in the root) but to do this, the project in question must create its own Canvas. If you add this to the scroller in a similar manner to the T2D project, you'll no longer be able to run it as a mod as the two canvas collide.
At the moment, some of the common stuff is loaded in the T2D project ("demoDatablocks.cs") so be careful.
Again, we're not restricting people here, you can configure this stuff however you like. We just wanted to provide a system that offered a balance between function, flexibility and simplicity. Whatever you do, try to keep the mods for the editors in the "main.cs" in the root so you've always got editor support.
- Melv.
#4
I didn't fully understand how the mods worked and that they would also call client.cs in the T2D example folder.
Cheers for explaining that, much appreciated. Its been one of those days!
- Dave.
03/01/2005 (3:11 pm)
Ah ha - yes, this is a definite "Doh!" moment :-)I didn't fully understand how the mods worked and that they would also call client.cs in the T2D example folder.
Cheers for explaining that, much appreciated. Its been one of those days!
- Dave.
Torque Owner Jason McIntosh