コード例 #1
0
        private void LoadAtlas()
        {
            string  ext      = Path.GetExtension(this.m_file);
            string  fileName = m_file.Substring(0, m_file.Length - ext.Length);
            Texture tex      = null;
            Texture alphaTex = null;

            tex = (Texture)m_owner.m_loadFunc(fileName, ext, typeof(Texture));
            if (tex == null)
            {
                Debug.LogWarning("FairyGUI: texture '" + m_file + "' not found in " + m_name);
            }

            fileName = fileName + "!a";
            alphaTex = (Texture2D)m_owner.m_loadFunc(fileName, ext, typeof(Texture2D));

            if (tex == null)
            {
                tex = FUITexture.CreateEmptyTexture();
            }

            if (m_fTexture == null)
            {
                m_fTexture = new FUITexture(tex, alphaTex, (float)tex.width / m_width, (float)tex.height / m_height);
            }
            else
            {
                m_fTexture.Reload(tex, alphaTex);
            }
        }
コード例 #2
0
        // public PixelHitTestData pixelHitTestData;

        private void LoadImage()
        {
            FUIAtlasSprite sprite;

            if (m_owner.SpriteDic.TryGetValue(m_id, out sprite))
            {
                m_fTexture = new FUITexture(sprite.m_atlas.LoadAsset(), sprite.m_rect, sprite.m_rotated);
            }
            else
            {
                m_fTexture = FUITexture.Empty();
            }
        }
コード例 #3
0
        private void LoadFont()
        {
            FUIBitmapFont font = new FUIBitmapFont(this);

            m_bitmapFont = font;
            // m_rawData操作
            bool ttf = true; // m_rawData.ReadBool();

            float          texScaleX   = 1;
            float          texScaleY   = 1;
            FUITexture     mainTexture = null;
            FUIAtlasSprite mainSprite  = null;

            if (ttf && m_owner.SpriteDic.TryGetValue(m_id, out mainSprite))
            {
                mainTexture = mainSprite.m_atlas.LoadAsset();
                texScaleX   = mainTexture.Root.m_uvRect.width / mainTexture.Width;
                texScaleY   = mainTexture.Root.m_uvRect.height / mainTexture.Height;
            }
        }
コード例 #4
0
 public FUITexture(FUITexture root, Rect region, bool rotated)
 {
 }