Показать сообщение отдельно
Старый 07.02.2013, 13:13   #1275
seaman
Знающий
 
Регистрация: 08.01.2013
Адрес: Самара
Сообщений: 284
Написано 104 полезных сообщений
(для 180 пользователей)
Ответ: Вопросы от новичка

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 = "";
            }
        }
    }
}
(Offline)
 
Ответить с цитированием
Сообщение было полезно следующим пользователям:
Amatsu (07.02.2013)