drawing a line through a GUI label


i was trying to find out how i would go about drawing a line through a label from code.
do i draw a line then place it in the right place and activate it when i need or can i do it in the GUI.label?


I would just go into Photoshop/Paint.NET or another image-editor and make an image with a transperent background. Then, you should get the Text tool, and type your text and adjust font/size/color/etc. as you wish. Then, save this image.

Next, make a copy of the previous image, and draw a line through it in the image program. Save this as a different file.

You should now have 2 different text images, one with a line through it and one without a line through it.

Now, you can display the first image as a GUITexture. Then, make a new script:

var strikedImage : Texture2D; // Assign this variable wit the image with a line through it.
function Update() {
   if (Input.GetKeyDown("space")) { // Or another trigger, it does not matter
      this.texture = strikedImage;

Next, create a new GUITexture from GameObject -> Create Other... -> GUITexture (is that right?) and for the Texture variable, assign the first image (the one without the line through it) to it. Then, drag the above script onto it. Set the strikedImage variable to the image WITH the line through it.

Finally, when you run the game, pressing space will change the image.

Use this for drawing lines in OnGUI functions.