Skip to main content

Posts

Showing posts with the label window

Making Multiple Instances of Windows With Same Window Method

So when developing a small little web-player, I ran into the problem of trying to render multiple instances of the same window function. My plan was for my user interface component to iterate through all the thought components and for each thought, render its contents in a new window. The windows need to be draggable also. My first attempt of this implementation failed. Rect thoughtRect = new Rect(20, 20, 200, 100); void OnGUI(){ for (int i = 0; i < allthoughts.Length; i++){ thoughtRect = GUI.Window(0+i, thoughtRect, DoThoughtWindow, ""+allthoughts[i].GetContent()); } } void DoThoughtWindow(int windowID) { GUI.DragWindow (new Rect(0, 0, 10000, 10000)); } For those who don't see the problem with this, I'll explain. All three windows are using the same Rect  thoughtRect  so all the windows are drawn on top of eachother. You might think this won't pose a problem due to the windows be...

Optimization Tip #1 - Windows As Textures

A lot of games back before the super consoles of PS3 or the XBox 360, companies had to go to extra lengths to save on faces to boost the performance. Technology throughout the past 10 years has grown tremendously advanced for such a short period of time. We are though, still not to the point of having the ability to run the graphics of a PS3's prestige on an everyday tablet and not have major issues. All developers have to optimize their games of course, especially those who are developing for android or IOS. One way everyone has seen is UV mapping entire buildings with a texture. Doors and windows are flat and look like some one cut pictures out of a magazine and glued them on a cardboard box as part of an art project. Now I'm not denouncing the method, its actually kind of crazy to think of trying to model a building in crazy detail. A lot of what makes a realistic looking model is the detail of the texture, instead of the complexity of the it's m...