コード例 #1
0
ファイル: Bar.cs プロジェクト: jmfb/XComGenerations
 public void Render(GraphicsBuffer buffer)
 {
     buffer.DrawHorizontalLine(topRow, leftColumn, width, borderColor);
     buffer.DrawHorizontalLine(topRow + height - 1, leftColumn, width, borderColor);
     buffer.DrawVerticalLine(topRow, leftColumn + width, height, borderColor);
     buffer.FillRect(topRow + 1, leftColumn, position, height - 2, fillColor);
     if (unfilledColor != null)
         buffer.FillRect(topRow + 1, leftColumn + position, width - position, height - 2, unfilledColor.Value);
 }
コード例 #2
0
ファイル: Button.cs プロジェクト: jmfb/XComGenerations
        public override void Render(GraphicsBuffer buffer)
        {
            if (!Visible)
                return;

            var colorScheme = Pushed ? scheme.Inverse : scheme;

            buffer.DrawHorizontalLine(topRow, leftColumn, width - 1, colorScheme.Lighter);
            buffer.DrawVerticalLine(topRow, leftColumn, height, colorScheme.Lighter);
            buffer.DrawHorizontalLine(topRow + 1, leftColumn + 1, width - 3, colorScheme.Light);
            buffer.DrawVerticalLine(topRow + 1, leftColumn + 1, height - 2, colorScheme.Light);
            buffer.FillRect(topRow + 2, leftColumn + 2, width - 4, height - 4, colorScheme.LightDark);
            buffer.DrawHorizontalLine(topRow + height - 2, leftColumn + 2, width - 3, colorScheme.Dark);
            buffer.DrawVerticalLine(topRow + 1, leftColumn + width - 2, height - 2, colorScheme.Dark);
            buffer.DrawHorizontalLine(topRow + height - 1, leftColumn + 1, width - 1, colorScheme.Darker);
            buffer.DrawVerticalLine(topRow, leftColumn + width - 1, height, colorScheme.Darker);

            var textTopRow = topRow + (height - font.Height + 1) / 2;
            var textLeftColumn = leftColumn + (width - font.MeasureString(text)) / 2;
            font.DrawString(buffer, textTopRow, textLeftColumn, text, colorScheme);
        }
コード例 #3
0
ファイル: Inventory.cs プロジェクト: jmfb/XComGenerations
 private void DrawNotEnoughTimeUnits(GraphicsBuffer buffer)
 {
     if (!notEnoughTimeUnits)
         return;
     if (stopwatch.ElapsedMilliseconds > 2000)
     {
         notEnoughTimeUnits = false;
         return;
     }
     var blink = (int)(stopwatch.ElapsedMilliseconds / 20) % 8;
     buffer.FillRect(176, 48, 320 - 48 * 2, 200 - 176, Palette.GetPalette(1).GetColor(40 + blink));
     Font.Normal.DrawString(buffer, 184, 109, "Not Enough Time Units!", ColorScheme.Yellow);
 }