I’m looking to do some GUI elements, but the scripts are already written in C# and instead of converting everything that already IS working into JavaScript… I want to figure out how to use 2d textures in C#.
I’ve managed to figure out the difference in scripting for the most part of the GUI except for implementing images into the it.
I’ve searched through the forums and Documentation, but EVERYTHING is in JavaScript!!??
Can you be a little more specific than “I want to figure out how to use 2d textures in C#.”
I script exclusively in C# (by preference) and I understand the frustration of all the documentation being in JavaScript. I’ve done all types of work with C# and Unity, including GUI for 3 different prototypes, so I’ll be more than happy to help.
I have a GUI group. Within the group I have a box drawn and within it a label with some text. Within that same “menu” type box I want to place an image or images of a map that is about 256x256.
Although this is for a background for a start page, something along these lines in JavaScript but would like it C#.
Here’s the GUI I’m working with…
void OnGUI()
{
if( shouldDisplay ){
// Welcome screen group
GUI.BeginGroup (new Rect (50, 50, 700, 400));
// Make a box so you can see where the group is on-screen.
GUI.Box (new Rect (0,0,700,400), "");
GUI.Label (new Rect (10,0,650,300), "whatever text goes here");
// End Welcome group
GUI.EndGroup ();
}
}
i’m just looking to place a 2D texture image within that group.
that’s funny I just figured out to put the public in front of it. I was starting to wonder why JavaScript variables allowed the image to be selected through the inspector but the C# was not. It is doing what I need now… It’s always the little things… lol