示例#1
0
        public void DrawRacersTime(int racer, DrawingSurface ds, int x, int y)
        {
            float total_time = Racers[racer].Time;
            int   minutes    = FloatToInt(total_time / 60.0f, eRoundDown);
            int   seconds    = FloatToInt(total_time - IntToFloat(minutes) * 60.0f, eRoundDown);
            int   subsecs    = FloatToInt((total_time - IntToFloat(minutes) * 60.0f - IntToFloat(seconds)) * 60.0f, eRoundDown);

            AzureItalicFont.DrawText(StringFormatAGS("%02d:%02d:%02d", minutes, seconds, subsecs), ds, x, y);
        }
示例#2
0
        // Fields

        // Methods
        public override void game_start()
        {
            Mouse.Mode    = eModePointer;
            Mouse.Visible = false;
            DynamicSprite font = DynamicSprite.CreateFromExistingSprite(13);

            AzureItalicFont.CreateFromSprite(font, 13, 13, 0, 126, null, null);
            font.Delete();
            font = DynamicSprite.CreateFromExistingSprite(22);
            PurpleItalicFont.CreateFromSprite(font, 13, 13, 0, 126, null, null);
            font.Delete();
            font = DynamicSprite.CreateFromExistingSprite(14);
            int last  = 126;
            int total = last + 1;

            int[] offs   = new int[total];
            int[] widths = new int[total];
            int   i      = 0;

            for (i = 0; i < total; i += 1)
            {
                offs[i] = 0;
            }
            for (i = 0; i < total; i += 1)
            {
                widths[i] = 28;
            }
            offs['t']    = 3;
            offs['!']    = 9;
            offs['`']    = 9;
            offs['.']    = 9;
            offs[',']    = 9;
            offs['I']    = 9;
            offs['i']    = 9;
            offs['j']    = 0;
            offs['l']    = 9;
            offs[':']    = 9;
            offs[';']    = 9;
            offs['|']    = 9;
            widths['t'] -= (3 + 7) - 4;
            widths['!'] -= 18 - 4;
            widths['`'] -= 18 - 4;
            widths['.'] -= 18 - 4;
            widths[','] -= 18 - 4;
            widths['I'] -= 18 - 4;
            widths['i'] -= 18 - 4;
            widths['j'] -= 9 - 4;
            widths['l'] -= 18 - 4;
            widths[':'] -= 18 - 4;
            widths[';'] -= 18 - 4;
            widths['|'] -= 18 - 4;
            SilverFont.CreateFromSprite(font, 32, 34, 0, last, offs, widths);
            font.Delete();
            SetDefaultOptions();
            LoadOptions();
        }
示例#3
0
        public void DrawRaceOverlay(bool firstDraw)
        {
            //int COLOR_TRANSPARENT = 35000;
            DrawingSurface ds = RaceOverlay.GetDrawingSurface();

            if (firstDraw)
            {
                int y1 = (1 + ThisRace.Opponents) * 53;
                int y2 = 6 * 53;
                if (y1 < y2)
                {
                    ds.DrawingColor = COLOR_TRANSPARENT;
                    ds.DrawRectangle(0, y1, 160, y2);
                }
            }
            int i = 0;

            for (i = 0; i < MAX_RACING_CARS; i += 1)
            {
                int racer = ThisRace.DriverPositions[i];
                if (racer < 0 || !Racers[racer].IsActive)
                {
                    continue;
                }
                int x = 0;
                int y = 53 * i;
                ds.DrawImage(x + 4, y + 2, 100 + Racers[racer].Driver);
                if (Racers[racer].Finished > 0)
                {
                    ds.DrawingColor = COLOR_TRANSPARENT;
                    ds.DrawRectangle(x + 36, y + 17, x + 102, y + 51);
                    DrawRacersTime(racer, ds, x + 42, y + 22);
                }
            }
            ds.DrawingColor = COLOR_TRANSPARENT;
            ds.DrawRectangle(50, 369, 160, 400);
            AzureItalicFont.DrawText(StringFormatAGS("%02d/%02d", Racers[0].Lap, ThisRace.Laps), ds, 52, 377);
            DrawRacersTime(0, ds, 52, 389);
            ds.Release();
        }