Exemple #1
0
        public override void Render(IRenderSurface surface)
        {
            if (!Visible)
                return;
            //  Render shadow and car itself
            surface.RenderBitmap(ShadowBitmap, Location.X + 1, Location.Y + 1);
            base.Render(surface);

            // Calculate and render smoke
            int smokeScale = 0;
            if (smokeRotation > 5)
                smokeScale = 1;
            else if (smokeRotation < -5)
                smokeScale = 0;

            surface.BackGraphics.TranslateTransform(Location.X, Location.Y + 16);
            surface.BackGraphics.RotateTransform((float)smokeRotation);
            surface.BackGraphics.DrawImage(SmokeBitmap,
                new Rectangle(0, 0,
                    SmokeBitmap.Width + smokeScale, SmokeBitmap.Height + smokeScale));
            surface.BackGraphics.ResetTransform();
        }
Exemple #2
0
 public virtual void Render(IRenderSurface surface)
 {
     if (Visible)
         surface.RenderBitmap(Bitmap, Location);
 }