It is currently Tue Oct 17, 2017 2:30 am

All times are UTC - 5 hours




 Page 1 of 1 [ 5 posts ] 
Author Message
 Post subject: Shader VMK 68 - Fix Gui Removal Code
PostPosted: Fri Jan 16, 2015 7:41 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
In this video I show how to clean up the GUI code that we currently have so that we can delete parent and children objects correctly. I also remove the restriction where you can only have on parent per gui object in this VMK.


Offline
 Profile  
 
 Post subject: Re: Shader VMK 68 - Fix Gui Removal Code
PostPosted: Sat Jan 17, 2015 1:09 am 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 449
Just finished up with this video and everything is working good on my end. The versatility to have multiple parents is great. I do not know if this is a bug or more of a concern: The GuiLayout class does have member variables that are used in relation to its Parent and since this object can now have multiple parents; would the factors such as the offsetFromParent and the paddingSize stay consistent to every parent or would it be more flexible for it to keep track of its relationship to each parent individually?


Offline
 Profile  
 
 Post subject: Re: Shader VMK 68 - Fix Gui Removal Code
PostPosted: Sat Jan 17, 2015 7:01 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
skilz80 wrote:
The GuiLayout class does have member variables that are used in relation to its Parent and since this object can now have multiple parents; would the factors such as the offsetFromParent and the paddingSize stay consistent to every parent or would it be more flexible for it to keep track of its relationship to each parent individually?


I noticed that too when I was testing the code. I decided to leave it as is for now since I don't anticipate using the multi parent feature very much in my games. If I wanted something to be located in 2 different spots on the gui then I would have 2 different guiLayout objects but each of them would share the same children just as shown in the vmk. I can't think of a good use case where I would want to share guiLayout objects. That being said, feel free to add this support if you want it in your version of the Shader game engine. Once you have it working post a tutorial in the forum here viewforum.php?f=11


Offline
 Profile  
 
 Post subject: Re: Shader VMK 68 - Fix Gui Removal Code
PostPosted: Sat Jan 17, 2015 4:51 pm 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 449
That makes sense since in most general cases the GuiLayout will belong to a GuiScreen object, the only case that might come up is if you had split screen view for multiplayer on the same monitor but even then you could just use one screen and have multiple layouts instead of having two screen objects, but it would be nice to keep each parent child relationship independent of each other.


Offline
 Profile  
 
 Post subject: Re: Shader VMK 68 - Fix Gui Removal Code
PostPosted: Sat Jan 17, 2015 5:07 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
In the split screen case, I would have 2 gui Screven objects and render them both each frame.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron