
namespace iGUI
{
using System;
using UnityEngine;
public class iGUIImage : iGUIElement
{
public bool alpha = true;
public float aspectRatio = 0f;
public Texture image;
public ScaleMode scaleMode;
internal override void draw()
{
this.beforeDraw();
if (this.image != null)
{
Color backgroundColor = base.backgroundColor;
backgroundColor.a = GUI.color.a;
GUI.color = backgroundColor;
GUI.DrawTexture(base.rect, this.image, this.scaleMode, this.alpha, this.aspectRatio);
GUI.Label(base.rect, base.label);
GUI.color = base.newColor;
}
base.draw();
}
public override void onCreate()
{
if ((Mathf.Approximately(this.positionAndSize.x, 0.5f) && Mathf.Approximately(this.positionAndSize.y, 0.5f)) && (Mathf.Approximately(this.positionAndSize.width, 0.5f) && Mathf.Approximately(this.positionAndSize.height, 0.5f)))
{
this.positionAndSize.width = 1f;
this.positionAndSize.height = 1f;
}
if (!Application.isPlaying && (this.image == null))
{
this.image = iGUIRoot.getTexture("iGUILogoTransparent");
base.label.text = "";
}
}
}
}