|
So what I'm trying to do is create 4 Textures overlap each other, so they have the same x and y position as well share a height and width. But I'm using GUILayout for screen resizing and placement issues that GUI just wasn't solving. Here is a snippet of code... So those Boxes I want to be overlapping each other in the same position on the screen. But I want to be able to place those boxes in a position on the screen using the GUILayout. I'm hoping for anyone that can give me some good alternatives, but please no one responding with telling me to switch over to GUI.DrawTexture. I know that I can do it with that, but I get sizing and spacing issues with the screen resizing itself if I do that.
(comments are locked)
|
|
Hi, i think you can make the window no-resizable...not 100% sure though. Now that I think I may be interested in. I'll have to look more into that, thanks for the suggestion.
Dec 11 '11 at 07:23 AM
Nerull22
If anyone knows how to make it so that the player can't resize the window, then I'm very interested in this. Thanks for any info, I'm still researching trying to find out how, but let me know.
Dec 11 '11 at 07:57 AM
Nerull22
Ok, sorry, this is my misunderstanding. Since i'm learning C# at same time as using Unity 3D, i mixed resizing mode in C# and GUI.Window in Unity. But, knowing that Unity allows native language imported scripts, you should be able to make a script using this C# property and make the window not unresizable. Here's the link : Windows Class
Dec 11 '11 at 07:48 PM
ks13
(comments are locked)
|
|
I know this is an old thread, but you can use GUILayoutUtility.GetLastRect().
(comments are locked)
|
|
As no one has posted yet, I'll just add my two cents. I don't see why you need the GUILayout if you want them stacked... I think it'd be more ideal if you were to use the normal GUI.DrawTexture, stack them that way, and find work arounds to work with different resizes... GUILayout is for automatic layouting, not for putting things where you want them to be... Whether you just make the location the Screen.width/2 and Screen.height/2 or make the location simple 0,0 and then change the sizes to change with the Screen.width/Screen.height. I just can't see resizing being such an issue unless you're making your screen small as no other... A general rule (In my opinion) is if it works in the Web View, you're fine. That's the smallest anyone will be going unless you're developing for Android/iOS, which you could be, in that case, I'd still suggest finding a work around hah. But yeah. Good luck! (Look around the API/search Google, I'm sure someone has had this problem lol). Well I'm no exactly positive about this, but it's going to be a standalone application first. And I'm trying to compensate for the user being a dick when it's in windowed mode, and finding a way to break the game, and then bitching about it. What I like about GUILayout is that if you just supply a min and max of the images, then it will resize the images and their spacing with one another while keeping the ratio of the images, without having to do a lot of math and adding to the complexity of the code. So that's why I was hoping to do it with GUILayout and not GUI. But looks like I'm going to have to do just that one part in GUI over top GUILayout. And that makes me sad.
Dec 09 '11 at 02:53 AM
Nerull22
Well, could check every one in a while if the screen was resized, if so, put a registry key in to disable running the game, shut it off, then when he restarts it, give a warning that if it's done again, that he won't be able to play again... Dick move, but works too ;).
Dec 09 '11 at 03:43 AM
Justin Warner
Hahaha, I want people to keep playing my game though. :P I'll figure something out. Thanks for the options and opinions though.
Dec 09 '11 at 08:38 PM
Nerull22
Dec 11 '11 at 02:34 PM
Justin Warner
(comments are locked)
|
