- Home /
Best way to show an image
Im making a slot machine and I want to display the simbols of the slots. How's the best way to show the images without using any plugin like 2D Toolkit? By now Im loading the images as Texture2D and displaying them through OnGUI with GUI.DrawTexture. Is that the best way? Is there another?
Im using Unity 3D 4.2
$$anonymous$$ake that image is Background image, and every other thing in front of it. See how to creat a background here: http://answers.unity3d.com/questions/9729/how-can-i-display-a-flat-background-2d-image-not-a.html.
Answer by Thionix · Sep 13, 2013 at 01:01 PM
I think you could use:
void OnGUI()
{
GUILayout.BeguinArea(new Rect(width, height, pos.x, pos.y));
GUILayout.DrawTexture(image);
GUILayout.EndArea();
}
an why that's better than just drawtexture? can explain? thanks! :) is better in performance or in getting a better code?
Answer by YoungDeveloper · Sep 13, 2013 at 01:12 PM
Just use DrawTexture, It's best for rendering images.
http://docs.unity3d.com/Documentation/ScriptReference/GUI.DrawTexture.html
Your answer
Follow this Question
Related Questions
How to script GUI Texture Window to see it in Script (Object's component) 1 Answer
How to save screenshot then use it as a gui texture? 2 Answers
scale textures using scrollbars that show/enable when texture is clicked on 0 Answers
How to render subtexture on GUI 2 Answers
more guitexture in void ongui 1 Answer