It is currently Tue Apr 25, 2017 7:22 pm

All times are UTC - 5 hours




 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: Shader VMK 69 - Gui Layout Grid
PostPosted: Sun Jan 25, 2015 8:59 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1094
Location: Ontario Canada
In this video the second GuiLayout object class is created. The GuiLayoutGrid is used to place Gui objects in a grid. All children inserted into the layout will be grouped into the specified number of columns.


Offline
 Profile  
 
 Post subject: Re: Shader VMK 69 - Gui Layout Grid
PostPosted: Mon Jan 26, 2015 8:42 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1094
Location: Ontario Canada
I just remembered that I forgot to mention that I noticed a divide by zero bug in the code in this VMK. Notice what will happen if you start with a grid that has children, but then you go and remove them all. Just need to add some protection to the code to prevent dividing by zero.

You can also optimize the code by passing in the total width and height of the grid into the function that calculates the children's offset so that you don't have to calculate it each time inside the loop.


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 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