Beispiel #1
0
 protected internal override bool HitTest(int x, int y)
 {
     if (!this.m_CanHitTest)
     {
         return(false);
     }
     if (!base.m_Clip)
     {
         return(true);
     }
     if (base.m_Relative)
     {
         return(Clipper.TemporaryInstance(base.m_xClipOffset, base.m_yClipOffset, base.m_xClipWidth, base.m_yClipHeight).Evaluate(x, y));
     }
     return((base.m_Clipper == null) || base.m_Clipper.Evaluate(base.PointToScreen(new Point(x, y))));
 }
Beispiel #2
0
        protected internal override void Draw(int X, int Y)
        {
            base.Draw(X, Y);
            int x     = X + 2;
            int num2  = base.m_Height - 2;
            int count = Engine.m_Journal.Count;
            int num4  = (int)this.m_Scroller.GetValue();

            if (num4 >= count)
            {
                num4 = count - 1;
            }
            UnicodeFont uniFont = Engine.GetUniFont(3);

            for (int i = num4; (i >= 0) && (i < count); i--)
            {
                Texture      image;
                JournalEntry entry = (JournalEntry)Engine.m_Journal[i];
                if (entry.Width != this.m_CropWidth)
                {
                    string str = Engine.WrapText(entry.Text, this.m_CropWidth, uniFont);
                    image       = uniFont.GetString(str, entry.Hue);
                    entry.Width = this.m_CropWidth;
                    entry.Image = image;
                }
                else
                {
                    image = entry.Image;
                }
                if ((image != null) && !image.IsEmpty())
                {
                    num2 -= image.Height;
                    if (num2 < 3)
                    {
                        image.DrawClipped(x, Y + num2, Clipper.TemporaryInstance(X, Y + 1, this.Width, this.Height));
                        break;
                    }
                    m_vCache.Draw(image, x, Y + num2);
                    num2 -= 4;
                }
            }
        }