What is the practice in regards to gui and code?
by CdnGater · in Torque Game Engine · 04/29/2004 (5:45 pm) · 2 replies
I was wondering what the practice was in regards to gui and code.
If I create a .gui file and need to incorporate code for that gui. What is the prefered practice? include it in the .gui file? or create a seperate .cs file?
I know it does not realy matter, I was just wondering what everyone else does.
If I create a .gui file and need to incorporate code for that gui. What is the prefered practice? include it in the .gui file? or create a seperate .cs file?
I know it does not realy matter, I was just wondering what everyone else does.
#2
04/30/2004 (2:06 am)
I agree with John - no standard practice :-) For me, ususally scripts that only relates to that .gui file get stuffed in the .gui file. Scripts that can relate to any other gui / section of the scripting gets stuck in it's own or another .cs file.
Torque Owner John Vanderbeck
VanderGames
Generally though i'd say its better to keep it in the GUI file, IF it is a small amount of code and is very GUI specific. For example toggling the status of controls, or initializing values. If you start attacking GUI controls to application functions, its probably better to split them off.