Question about Game Play Screen tutorial: Complete Guide to Torque X
by Arden · in Torque X 2D · 09/22/2010 (1:37 pm) · 3 replies
Hey guys, hopefully I have a rather simple question about page 339 - 340 of John's book, about creating a Game Play Screen. Here is the code, I've commented the changes I made for it to work:
So my question is, do I even need the GUIStyle anymore, and if so, what further changes do you think I should make to the code for creating the Game Play Screen?
Thanks for any help!
public class GuiPlay:GUISceneview,IGUIScreen
{
public GuiPlay()
{
//create the Style for our play screen
//GUIStyle playStyle = new GUIStyle();
//playStyle.Anchor=AnchorFlags.All; // this as I understand is not valid anymore
GUIControl playStyle = new GUIControl(); //these are the lines I replaced it with
playStyle.HorizSizing = HorizSizing.Center;//these are the lines I replaced it with
playStyle.VertSizing = VertSizing.Center;//these are the lines I replaced it with
// set some info for this control
Name = "GuiPlay";
Style = playStyle; ;//this now gives me an error (cannot implicitely convert)
Size= new SizeF 800,600); // replaced SizeF with Vector2.
}
}So my question is, do I even need the GUIStyle anymore, and if so, what further changes do you think I should make to the code for creating the Game Play Screen?
Thanks for any help!
#2
09/23/2010 (2:46 pm)
hey I made the same discoveries, the book is outdated but if you downloaded the files from the website listed in the book. it will have the correct/updated version, you can easily see the differences and work from there
#3
09/23/2010 (4:33 pm)
Yeah, found it too. I wish I'd looked at that code earlier, but then again allowed me to learn the hard way :)
Torque 3D Owner Aaron Scovel
Best Regards,