Hey Guys,
I have been working on an engine using alot of the concepts from the 4th edition of the book and am having trouble thinking up how to do something.
I have a Custom GUI that I have been working on and it works well, it uses tinyXML to read in things like
<GUIButton PosX="300" PosY="400"/>
So far it works really well, but I do not know how I will go about connecting these controls to anything, here is my current xml file
<?xml version="1.0" ?>
<root>
<Font File="centabel.ttf" Size="16"/>
<GUIContainer PosX="200" PosY="100" Width="800" Height="400" Colour="30AA45FF">
<GUITitleBar PosX="0" PosY="0" Width="800" Height="25" Colour="50CC70FF">
<GUIStaticText PosX="5" PosY="5" Colour="DDFFDDFF" Text="Window Title"/>
<GUIButton PosX="777" PosY="2" Width="20" Height="20" Colour="AADDDDFF">
<GUIStaticText PosX="5" Colour="30FF30FF" Text="x"/>
</GUIButton>
</GUITitleBar>
</GUIContainer>
</root>
How would I link these controls to either a function or controlling a variable, I can't just read in an attribute and convert it to a variable name, and the same for a function. I could only think of something for buttons, ie, on my button put say
<GUIButton type="Close" id="button1"/>
And to close a container say,
<GUIContainer controller="button1"/>
Which would allow it to close the GUIContainer through the event manager, but, how would I map these to say, a variable.
If I have a slider or a check box, I can't just add an id to a boolean. Am I going about this the wrong way, even with fully embedding the initial positioning in XML, do you think I am losing out on too much control doing it this way?
I have been working on an engine using alot of the concepts from the 4th edition of the book and am having trouble thinking up how to do something.
I have a Custom GUI that I have been working on and it works well, it uses tinyXML to read in things like
<GUIButton PosX="300" PosY="400"/>
So far it works really well, but I do not know how I will go about connecting these controls to anything, here is my current xml file
<?xml version="1.0" ?>
<root>
<Font File="centabel.ttf" Size="16"/>
<GUIContainer PosX="200" PosY="100" Width="800" Height="400" Colour="30AA45FF">
<GUITitleBar PosX="0" PosY="0" Width="800" Height="25" Colour="50CC70FF">
<GUIStaticText PosX="5" PosY="5" Colour="DDFFDDFF" Text="Window Title"/>
<GUIButton PosX="777" PosY="2" Width="20" Height="20" Colour="AADDDDFF">
<GUIStaticText PosX="5" Colour="30FF30FF" Text="x"/>
</GUIButton>
</GUITitleBar>
</GUIContainer>
</root>
How would I link these controls to either a function or controlling a variable, I can't just read in an attribute and convert it to a variable name, and the same for a function. I could only think of something for buttons, ie, on my button put say
<GUIButton type="Close" id="button1"/>
And to close a container say,
<GUIContainer controller="button1"/>
Which would allow it to close the GUIContainer through the event manager, but, how would I map these to say, a variable.
If I have a slider or a check box, I can't just add an id to a boolean. Am I going about this the wrong way, even with fully embedding the initial positioning in XML, do you think I am losing out on too much control doing it this way?
PC - Custom Built
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz
The post was edited 1 time, last by mholley519 ().