Project Rott is a game development project using Unity for the Iphone/Itouch and eventually the android platform. This blog will act as the place where I will provide solutions to problems I encounter in the process of developing this game.

Report RSS First post: my approach to linking gui elements.

Posted by on

I ran into issues with my Dialog GUI in regards to Unity’s method of handling GUI elements. Apparently, unlike other GUI builders in other development environments (such as Visual studio) elements aren't attached to each other. I needed to come up with a way of moving the background element of the GUI and having all the elements on top of it move along with it. 
 I’ve solved this problem by creating a base element (similar to a form in visual studio) made from a GUI.Box element and assigning it a X and Y screen coordinate variable. On all elements in that box element I’ve taken their x and y coordinates and augmented them with this value, for instance: Button one has a x coordinate of UniX + ButtonOneX (UniX is the x coordinate of the box element) so when the box element moves the button element will always augment itself based on that changing variable.
This was the problem I solved today.

AlexH

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: