- Home /
Dialogue Box Help
I have this script for a dialogue Box:
var showMessage : boolean; var someRect : Rect; var someMessage : String; var speechbubble : Texture2D;
function OnGUI() { if(showMessage){ GUI.Label(someRect,someMessage); GUI.DrawTexture (speechbubble); } } function OnTriggerStay(){ if(Input.GetKeyDown(KeyCode.T)){
showMessage = true; } else if(Input.anyKeyDown){ showMessage = false; } }
But the texture doesn't show up, i get an error in compiling :
Assets/Dialogue Box.js(8,27): BCE0023: No appropriate version of 'UnityEngine.GUI.DrawTexture' for the argument list '(UnityEngine.Texture2D)' was found.
How do I get it to draw the texture, or just a gui box, behind the speech??
Answer by DocSWAB · Oct 18, 2010 at 04:25 PM
That call requires a rect to draw the texture into: http://unity3d.com/support/documentation/ScriptReference/GUI.DrawTexture.html