tag:blogger.com,1999:blog-8935780327334775165.post4503342884540058932..comments2023-08-07T22:48:57.800+08:00Comments on Entity Crisis: Automagic GUI Scaling in Unity3DUnknownnoreply@blogger.comBlogger11125tag:blogger.com,1999:blog-8935780327334775165.post-54586262132920871192014-07-12T20:32:18.862+08:002014-07-12T20:32:18.862+08:00@Virgilia this is just a demonstration, in my own ...@Virgilia this is just a demonstration, in my own library I use something similar to what you have described.<br /><br />The stack will not grow forever if you call make matching BeginGUI and EndGUI calls.<br /><br />Also all the variables in the method are value types which come from the stack, and are not allocated.Simon Wittberhttps://www.blogger.com/profile/02730025645144151014noreply@blogger.comtag:blogger.com,1999:blog-8935780327334775165.post-69261007015445585872014-07-12T17:09:18.885+08:002014-07-12T17:09:18.885+08:00The code is unfortunately not optimized at all. Cr...The code is unfortunately not optimized at all. Creating new temporary variables and recalculating the matrix every time BeginGUI is called (multiple times per frame per script that uses it), as well as your unnecessary stack array whose size gets increased and causes crashes due to memory usage.<br />Just in case anyone needs a more optimized version of the script:<br />-Changed BeginGUI to BeginGUI(width,height) for more flexibility.<br />-Made the matrix calculations only occur at the beginning, and when the resolution changes.<br />-Removed the stack thing.<br />http://pastebin.com/RZByVEVTVirgilianoreply@blogger.comtag:blogger.com,1999:blog-8935780327334775165.post-38624505204994373962013-09-18T06:56:31.005+08:002013-09-18T06:56:31.005+08:00Hi,
I have implemented this GUISizer and it work...Hi, <br /><br />I have implemented this GUISizer and it works very well with one exception and I would like to get your thoughts on it?<br /><br />The exception is when I try to display a GUI Box with an x, y derived from Camera.main.WorldToScreenPoint. If I run the game with screen Maximise on Play everything is fine however, if I run with out it, the GUI Box is way off screen in the middle of nowhere. I would appreciate any insight?<br /><br />Regards,<br /><br />GaryMeanest Man in England (Previously America)https://www.blogger.com/profile/14315789140242486452noreply@blogger.comtag:blogger.com,1999:blog-8935780327334775165.post-15727489909061423912012-09-07T01:40:16.956+08:002012-09-07T01:40:16.956+08:00I love this, thank you so much.I love this, thank you so much.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8935780327334775165.post-39884816866966599432012-05-26T23:04:12.216+08:002012-05-26T23:04:12.216+08:00Thank you very much! The script saved me a lot of ...Thank you very much! The script saved me a lot of timeAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8935780327334775165.post-29049287097669298862012-04-23T16:30:15.336+08:002012-04-23T16:30:15.336+08:00Hey thanks for your script, very usefull.
I just ...Hey thanks for your script, very usefull.<br /><br />I just have an issue.<br />The "GUIUtility.RotateAroundPivot" doesn't work well after a resize, do you know a solution ?<br /><br />ThanksRobin Bonhourehttps://www.blogger.com/profile/07580865377459361352noreply@blogger.comtag:blogger.com,1999:blog-8935780327334775165.post-71427226673463948942012-01-20T07:26:25.819+08:002012-01-20T07:26:25.819+08:00Thanks this was very helpful!Thanks this was very helpful!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8935780327334775165.post-1208081532499831112011-05-03T06:11:00.827+08:002011-05-03T06:11:00.827+08:00Assets/GUISizer.cs(9,14): error CS1519: Unexpected...Assets/GUISizer.cs(9,14): error CS1519: Unexpected symbol `static' in class, struct, or interface member declarationAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8935780327334775165.post-56169200646636777102011-02-13T14:35:13.651+08:002011-02-13T14:35:13.651+08:00The filename needs to be the same as the class nam...The filename needs to be the same as the class name, so try renaming the file to GUISizer.cs and it should work.Simon Wittberhttps://www.blogger.com/profile/02730025645144151014noreply@blogger.comtag:blogger.com,1999:blog-8935780327334775165.post-16848337954244238152011-02-11T01:17:15.985+08:002011-02-11T01:17:15.985+08:00Sorry, i m a noob,
I make a "GUIMatrixSaler.c...Sorry, i m a noob,<br />I make a "GUIMatrixSaler.cs" and fill in your script. Now it in the Asset folder and i give it to an GuiTexture. But if i type in "GuiMatrixScaler.BeginGUI();"<br />the compiler said Unknown identifier.<br />Please can you explain me how to handle this?<br />thanks a lotAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8935780327334775165.post-46099227478675024222011-01-14T18:52:28.989+08:002011-01-14T18:52:28.989+08:00awesome automagic, it works great! thanks!awesome <b>automagic</b>, it works great! thanks!Anonymousnoreply@blogger.com