Exemplo n.º 1
0
        /// <summary>
        /// Fills the level with dots and energizers
        /// </summary>
        private void Fill()
        {
            var dotSource       = new DrawingRectangle(7, 33, 11, 11);
            var energizerSource = new DrawingRectangle(1, 1, 24, 24);

            for (int y = 0; y < TilesHigh; y++)
            {
                for (int x = 0; x < TilesWide; x++)
                {
                    var pos = new Vector2(x * PacmanGame.TileWidth + PacmanGame.TileWidth / 2f, y * PacmanGame.TileWidth + PacmanGame.TileWidth / 2f);

                    if (DotTiles[x, y] == (int)TileItem.Dot)
                    {
                        _tileItems[x, y] = new ScoreItem(TileItem.Dot, 0, this, ScreenManager.DotEnergizerTexture, pos,
                                                         dotSource);
                        DotsLeft++;
                    }
                    else if (DotTiles[x, y] == (int)TileItem.Energizer)
                    {
                        _tileItems[x, y] = new ScoreItem(TileItem.Energizer, 0, this, ScreenManager.DotEnergizerTexture, pos,
                                                         energizerSource);
                        EnergizersLeft++;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public PacMan(Level level, Texture2D texture, Vector2 position)
            : base(level, texture, position, new DrawingRectangle(3, 57, 48, 48))
        {
            Direction = Direction.Left;

            FlashSourceRect = new DrawingRectangle(56, 3, 48, 48);

            // Set speeds
            int currentLevel = Level.ScreenManager.CurrentLevel;

            if (currentLevel == 1)
            {
                SpeedModifier       = 0.8f;
                FrightSpeedModifier = 0.9f;
            }
            else if (currentLevel >= 2 && currentLevel <= 4)
            {
                SpeedModifier       = 0.9f;
                FrightSpeedModifier = 0.95f;
            }
            else if (currentLevel >= 5 && currentLevel <= 20)
            {
                SpeedModifier       = 1f;
                FrightSpeedModifier = 1f;
            }
            else
            {
                SpeedModifier       = 0.9f;
                FrightSpeedModifier = SpeedModifier;
            }

            Velocity = Vector2.Zero;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Runs the test drawing and formatting images.
        /// </summary>
        private static void RunTestDrawingAndFormattingImages()
        {
            //// =====================================================
            //// =====================================================
            ////            Drawing And Formatting Images
            //// =====================================================
            //// =====================================================

            Console.WriteLine("Running drawing and formatting images tests:");

            DrawingUsingGraphics.Run();
            DrawingUsingGraphicsPath.Run();
            DrawingRectangle.Run();
            DrawingArc.Run();
            DrawingEllipse.Run();
            DrawingBezier.Run();
            CombineImages.Run();
            DrawingLines.Run();
            CreatingAnImageBySettingPath.Run();
            CreatingImageUsingStream.Run();
            DrawImagesUsingCoreFunctionality.Run();
            Imagetransparency.Run();
            DrawRasterImageOnWMF.Run();
            DrawRasterImageOnEMF.Run();
            DrawRasterImageOnSVG.Run();
            DrawVectorImageToRasterImage.Run();
        }
Exemplo n.º 4
0
 public DecorationRectangle(DrawingRectangle rect)
 {
     if (rect == null)
     {
         throw new ArgumentNullException("rect");
     }
     _rect = rect;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Set points depending on which item type it is.
        /// </summary>
        private void SetPoints()
        {
            switch (ItemType)
            {
            case TileItem.Dot:
                Points = 10;
                break;

            case TileItem.Energizer:
                Points = 50;
                break;

            case TileItem.Cherries:
                Points          = 100;
                FlashSourceRect = new DrawingRectangle(59, 3, 42, 49);
                break;

            case TileItem.Strawberry:
                Points          = 300;
                FlashSourceRect = new DrawingRectangle(168, 2, 45, 50);
                break;

            case TileItem.Peach:
                Points          = 500;
                FlashSourceRect = new DrawingRectangle(166, 55, 47, 52);
                break;

            case TileItem.Apple:
                Points          = 700;
                FlashSourceRect = new DrawingRectangle(57, 55, 47, 51);
                break;

            case TileItem.Grapes:
                Points          = 1000;
                FlashSourceRect = new DrawingRectangle(56, 111, 50, 49);
                break;

            case TileItem.Galaxian:
                Points          = 2000;
                FlashSourceRect = new DrawingRectangle(163, 111, 52, 49);
                break;

            case TileItem.Bell:
                Points          = 3000;
                FlashSourceRect = new DrawingRectangle(56, 164, 49, 50);
                break;

            case TileItem.Key:
                Points          = 5000;
                FlashSourceRect = new DrawingRectangle(175, 166, 29, 50);
                break;
            }
        }
Exemplo n.º 6
0
        public override void Draw(GameTime gameTime)
        {
            var screenRect = new DrawingRectangle(0, 0, Level.TilesWide * PacmanGame.TileWidth, Level.TilesHigh * PacmanGame.TileWidth);

            const string gameOverText = "Game Over";
            Vector2      size         = ScreenManager.GameFont.MeasureString(gameOverText);
            var          pos          = new Vector2(PacmanGame.ScreenWidth / 2f - size.X / 2f, PacmanGame.ScreenHeight / 2f - size.Y);

            SpriteBatch.Begin();
            SpriteBatch.Draw(ScreenManager.BlankTexture, screenRect, new Color(0, 0, 0, 150));
            SpriteBatch.DrawString(ScreenManager.GameFont, gameOverText, pos, Color.White);
            SpriteBatch.End();
        }
Exemplo n.º 7
0
        private void BeginDrawingObject(MouseButtonEventArgs e)
        {
            Vector mousePos = (Vector)e.GetPosition(MainImageContainer);

            switch (currentlyPressedButton.Name)
            {
            case "DrawLineButon":
                ILine line = new ClippedLine((Vector)e.GetPosition(MainImageContainer), (Vector)e.GetPosition(MainImageContainer), 2, CurrentColor, ClipRectangles);
                currentlyDrawnObject = line;
                DrawingObjects.Add(currentlyDrawnObject);
                currentlyDrawnPoint = line.Point2;
                break;

            case "DrawCircleButton":
                MidpointCircle circle = new MidpointCircle((Vector)e.GetPosition(MainImageContainer), (Vector)e.GetPosition(MainImageContainer), CurrentColor);
                currentlyDrawnObject = circle;
                DrawingObjects.Add(currentlyDrawnObject);
                currentlyDrawnPoint = circle.radiusUtilityPoint;
                break;

            case "DrawPolygonButton":
                Polygon poly = new FilledPolygon(CurrentColor, 2, ClipRectangles, (Vector)e.GetPosition(MainImageContainer), (Vector)e.GetPosition(MainImageContainer));
                currentlyDrawnObject = poly;
                DrawingObjects.Add(currentlyDrawnObject);
                currentlyDrawnPoint = poly.Points[1];
                break;

            case "DrawCapsuleButton":
                Capsule cap = new Capsule(mousePos, mousePos, 0, CurrentColor);
                currentlyDrawnObject = cap;
                DrawingObjects.Add(currentlyDrawnObject);
                currentlyDrawnPoint = cap.Point2;
                break;

            case "DrawRectangleButton":
                DrawingRectangle rec = new DrawingRectangle(CurrentColor, 2, mousePos, mousePos);
                currentlyDrawnObject = rec;
                DrawingObjects.Add(currentlyDrawnObject);
                currentlyDrawnPoint = rec.Points[2];
                break;

            case "FloodFillButton":
                FloodFill fill = new FloodFill(mousePos, CurrentColor);
                DrawingObjects.Add(fill);
                currentState = UIState.PreparingToDraw;
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 8
0
        public void SpawnFruit(int currentLevel)
        {
            DrawingRectangle source = DrawingRectangle.Empty;
            TileItem         type;

            if (currentLevel == 1)
            {
                type   = TileItem.Cherries;
                source = new DrawingRectangle(5, 3, 42, 48);
            }
            else if (currentLevel == 2)
            {
                type   = TileItem.Strawberry;
                source = new DrawingRectangle(114, 2, 45, 50);
            }
            else if (currentLevel >= 3 && currentLevel <= 4)
            {
                type   = TileItem.Peach;
                source = new DrawingRectangle(112, 55, 46, 52);
            }
            else if (currentLevel >= 5 && currentLevel <= 6)
            {
                type   = TileItem.Apple;
                source = new DrawingRectangle(3, 55, 47, 51);
            }
            else if (currentLevel >= 7 && currentLevel <= 8)
            {
                type   = TileItem.Grapes;
                source = new DrawingRectangle(2, 111, 50, 49);
            }
            else if (currentLevel >= 9 && currentLevel <= 10)
            {
                type   = TileItem.Galaxian;
                source = new DrawingRectangle(109, 111, 52, 48);
            }
            else if (currentLevel >= 11 && currentLevel <= 12)
            {
                type   = TileItem.Bell;
                source = new DrawingRectangle(2, 164, 49, 50);
            }
            else
            {
                type   = TileItem.Key;
                source = new DrawingRectangle(120, 164, 30, 51);
            }

            var position = new Vector2(14 * PacmanGame.TileWidth, 20 * PacmanGame.TileWidth + PacmanGame.TileWidth / 2f);

            Fruit = new ScoreItem(type, 10, this, ScreenManager.BonusItemsTileset, position, source);
        }
Exemplo n.º 9
0
 public override void Update()
 {
     if (DrawingRectangle.Contains(Mouse.GetState().Position))
     {
         OnHover();
         isHover = true;
         if (Mouse.GetState().LeftButton == ButtonState.Pressed)
         {
             OnClick();
         }
     }
     else
     {
         isHover = false;
     }
     base.Update();
 }
Exemplo n.º 10
0
        /// <summary>
        /// Graphics operations basics examples.
        /// </summary>
        private static void GraphicOperationsBasics()
        {
            Console.WriteLine("Starting Graphic Operations Basics Example");

            //Drawing Images
            DrawingLines.Run();
            DrawingEllipse.Run();
            DrawingRectangle.Run();
            DrawingArc.Run();
            DrawingBezier.Run();
            CoreDrawingFeatures.Run();
            DrawingUsingGraphics.Run();
            DrawingUsingGraphicsPath.Run();

            // Filters
            ApplyMedianAndWienerFilters.Run();
            ApplyGausWienerFilters.Run();
            ApplyGausWienerFiltersForColorImage.Run();
            ApplyMotionWienerFilters.Run();
            BinarizationWithFixedThreshold.Run();
            BinarizationWithOtsuThreshold.Run();
            Grayscaling.Run();
            DitheringforRasterImages.Run();
            AdjustingBrightness.Run();
            AdjustingContrast.Run();
            AdjustingGamma.Run();
            BluranImage.Run();

            // Crop, Resize, Rotate
            CroppingbyShifts.Run();
            CroppingbyRectangle.Run();
            RotatinganImage.Run();
            RotatinganImageonaSpecificAngle.Run();
            SimpleResizing.Run();
            ResizingwithResizeTypeEnumeration.Run();
            ResizeImageProportionally.Run();

            // Common operations
            VerifyImageTransparency.Run();
            AddSignatureToImage.Run();
            AddWatermark.Run();
            AddDiagnolWatermark.Run();

            CombiningImages.Run();
            ExpandandCropImages.Run();
        }
Exemplo n.º 11
0
        public Ghost(Level level, Texture2D texture, Vector2 position, Rectangle sourceRect)
            : base(level, texture, position, sourceRect)
        {
            _random = new Random();

            ForceNewDirection = false;

            IsDead = false;

            DefaultSource    = SourceRect;
            FrightenedSource = new DrawingRectangle(3, 110, 48, 51);
            FlashSourceRect  = new DrawingRectangle(111, 110, 48, 51);

            UpdateTarget();

            // Set speeds
            int currentLevel = Level.ScreenManager.CurrentLevel;

            if (currentLevel == 1)
            {
                BaseSpeedModifier   = 0.75f;
                FrightSpeedModifier = 0.5f;
                TunnelSpeedModifier = 0.4f;
            }
            else if (currentLevel >= 2 && currentLevel <= 4)
            {
                BaseSpeedModifier   = 0.85f;
                FrightSpeedModifier = 0.55f;
                TunnelSpeedModifier = 0.45f;
            }
            else if (currentLevel >= 5 && currentLevel <= 20)
            {
                BaseSpeedModifier   = 0.95f;
                FrightSpeedModifier = 0.60f;
                TunnelSpeedModifier = 0.50f;
            }
            else
            {
                BaseSpeedModifier   = 0.95f;
                FrightSpeedModifier = SpeedModifier;
                TunnelSpeedModifier = 0.5f;
            }

            SpeedModifier = BaseSpeedModifier;
        }
Exemplo n.º 12
0
        private void DrawGhostTargets(SpriteBatch spriteBatch)
        {
            // No need to draw targets in frightened mode
            if (Level.GhostMode == GhostMode.Frightened)
            {
                return;
            }

            DrawingRectangle targetTileRect;

            // Blinky's target tile
            if (!Level.HideBlinky)
            {
                targetTileRect = new DrawingRectangle(
                    (int)(Level.Blinky.TargetTile.X * PacmanGame.TileWidth),
                    (int)(Level.Blinky.TargetTile.Y * PacmanGame.TileWidth), PacmanGame.TileWidth, PacmanGame.TileWidth);
                spriteBatch.Draw(ScreenManager.BlankTexture, targetTileRect, Color.Red);
            }

            // Pinky's target tile
            if (!Level.HidePinky)
            {
                targetTileRect = new DrawingRectangle(
                    (int)(Level.Pinky.TargetTile.X * PacmanGame.TileWidth), (int)(Level.Pinky.TargetTile.Y * PacmanGame.TileWidth), PacmanGame.TileWidth, PacmanGame.TileWidth);
                spriteBatch.Draw(ScreenManager.BlankTexture, targetTileRect, Color.Pink);
            }

            // Inky's target tile
            if (!Level.HideInky)
            {
                targetTileRect = new DrawingRectangle(
                    (int)(Level.Inky.TargetTile.X * PacmanGame.TileWidth), (int)(Level.Inky.TargetTile.Y * PacmanGame.TileWidth), PacmanGame.TileWidth, PacmanGame.TileWidth);
                spriteBatch.Draw(ScreenManager.BlankTexture, targetTileRect, Color.Blue);
            }

            // Clyde's target tile
            if (!Level.HideClyde)
            {
                targetTileRect = new DrawingRectangle(
                    (int)(Level.Clyde.TargetTile.X * PacmanGame.TileWidth), (int)(Level.Clyde.TargetTile.Y * PacmanGame.TileWidth), PacmanGame.TileWidth, PacmanGame.TileWidth);
                spriteBatch.Draw(ScreenManager.BlankTexture, targetTileRect, Color.Orange);
            }
        }
Exemplo n.º 13
0
        private void DrawBoard(SpriteBatch spriteBatch)
        {
            var backgroundRect = new DrawingRectangle(0, 0, TilesWide * PacmanGame.TileWidth, TilesHigh * PacmanGame.TileWidth);

            spriteBatch.Draw(ScreenManager.LevelBackground, backgroundRect, Color.White);

#if DEBUG
            // Mouse grid position highlight
            var mouseGrid = Utils.AbsToGrid(ScreenManager.MousePosition);

            var rect = new DrawingRectangle((int)mouseGrid.X * PacmanGame.TileWidth, (int)mouseGrid.Y * PacmanGame.TileWidth, PacmanGame.TileWidth,
                                            PacmanGame.TileWidth);
            spriteBatch.Draw(ScreenManager.BlankTexture, rect, new Color(200, 200, 200, 255));

            // Draw grid lines
            for (int x = 0; x < TilesWide; x++)
            {
                for (int y = 0; y < TilesHigh; y++)
                {
                    for (int i = 0; i < 30; i += 6)
                    {
                        spriteBatch.Draw(ScreenManager.BlankTexture,
                                         new DrawingRectangle(x * PacmanGame.TileWidth + i, y * PacmanGame.TileWidth, 2, 1),
                                         DebugBorderColor);
                    }

                    for (int i = 0; i < 30; i += 6)
                    {
                        spriteBatch.Draw(ScreenManager.BlankTexture,
                                         new DrawingRectangle(x * PacmanGame.TileWidth, y * PacmanGame.TileWidth + i, 1, 2),
                                         DebugBorderColor);
                    }
                }
            }
#endif

            spriteBatch.Draw(ScreenManager.BlankTexture, new DrawingRectangle(TilesWide * PacmanGame.TileWidth, 0, 1, TilesHigh * PacmanGame.TileWidth), DebugBorderColor);
        }
Exemplo n.º 14
0
        internal unsafe void DrawSprite(BaseTexture texture, CubeMapFace?face, ref DrawingRectangleF destination, bool scaleDestination, ref DrawingRectangle?sourceRectangle, Color color, float rotation, ref Vector2 origin, SpriteEffects effects, float depth)
        {
            // Check that texture is not null
            if (texture == null || texture.NativePointer == IntPtr.Zero)
            {
                throw new ArgumentNullException("texture");
            }

            // Make sure that Begin was called
            if (!isBeginCalled)
            {
                throw new InvalidOperationException("Begin must be called before draw");
            }

            // Resize the buffer of SpriteInfo
            if (spriteQueueCount >= spriteQueue.Length)
            {
                Array.Resize(ref spriteQueue, spriteQueue.Length * 2);
            }

            // Gets the resource information from the view (width, height).
            // Cache the result in order to avoid this request if the texture is reused
            // inside a same Begin/End block.
            TextureInfo textureInfo;

            if (!textureInfos.TryGetValue(texture.NativePointer.ToInt64(), out textureInfo))
            {
                textureInfo.Texture = texture;
                textureInfo.Face    = face;

                SurfaceDescription description2D;
                if (face.HasValue)
                {
                    Surface cubeSurface = ((CubeTexture)texture).GetCubeMapSurface(face.Value, 0);
                    description2D = cubeSurface.Description;
                    cubeSurface.Dispose();
                }
                else
                {
                    description2D = ((Texture)texture).GetLevelDescription(0);
                }

                textureInfo.Width  = description2D.Width;
                textureInfo.Height = description2D.Height;

                textureInfos.Add(texture.NativePointer.ToInt64(), textureInfo);
            }

            // Put values in next SpriteInfo
            fixed(SpriteInfo *spriteInfo = &(spriteQueue[spriteQueueCount]))
            {
                float width;
                float height;

                // If the source rectangle has a value, then use it.
                if (sourceRectangle.HasValue)
                {
                    DrawingRectangle rectangle = sourceRectangle.Value;
                    spriteInfo->Source.X = rectangle.X;
                    spriteInfo->Source.Y = rectangle.Y;
                    width  = rectangle.Width;
                    height = rectangle.Height;
                }
                else
                {
                    // Else, use directly the size of the texture
                    spriteInfo->Source.X = 0.0f;
                    spriteInfo->Source.Y = 0.0f;
                    width  = textureInfo.Width;
                    height = textureInfo.Height;
                }

                // Sets the width and height
                spriteInfo->Source.Width  = width;
                spriteInfo->Source.Height = height;

                // Scale the destination box
                if (scaleDestination)
                {
                    destination.Width  *= width;
                    destination.Height *= height;
                }

                // Sets the destination
                spriteInfo->Destination = destination;

                // Copy all other values.
                spriteInfo->Origin.X      = origin.X;
                spriteInfo->Origin.Y      = origin.Y;
                spriteInfo->Rotation      = rotation;
                spriteInfo->Depth         = depth;
                spriteInfo->SpriteEffects = effects;
                spriteInfo->Color         = color;
            }

            // If we are in immediate mode, render the sprite directly
            if (spriteSortMode == SpriteSortMode.Immediate)
            {
                DrawBatchPerTexture(ref textureInfo, spriteQueue, 0, 1);
            }
            else
            {
                if (spriteTextures.Length < spriteQueue.Length)
                {
                    Array.Resize(ref spriteTextures, spriteQueue.Length);
                }
                spriteTextures[spriteQueueCount] = textureInfo;
                spriteQueueCount++;
            }
        }
Exemplo n.º 15
0
 /// <summary>
 /// Copies pixel data using the supplied input parameters.
 /// </summary>
 /// <param name="rectangle">The rectangle.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="guidDstFormat">The GUID DST format.</param>
 /// <param name="dstTransform">The DST transform.</param>
 /// <param name="stride">The stride.</param>
 /// <param name="output">The output.</param>
 /// <returns></returns>
 /// <unmanaged>HRESULT IWICBitmapSourceTransform::CopyPixels([In, Optional] const WICRect* prc,[In] unsigned int uiWidth,[In] unsigned int uiHeight,[In, Optional] GUID* pguidDstFormat,[In] WICBitmapTransformOptions dstTransform,[In] unsigned int nStride,[In] unsigned int cbBufferSize,[In] void* pbBuffer)</unmanaged>
 public void CopyPixels(DrawingRectangle rectangle, int width, int height, System.Guid guidDstFormat, SharpDX.WIC.BitmapTransformOptions dstTransform, int stride, DataStream output)
 {
     CopyPixels(rectangle, width, height, guidDstFormat, dstTransform, stride, (int) output.Length,
                output.DataPointer);
 }
Exemplo n.º 16
0
        protected override void Draw(GameTime gameTime)
        {
            // Clears the screen with the Color.CornflowerBlue
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // Precalculate some constants
            int textureHalfSize = ballsTexture.Width / 2;
            int spriteSceneWidth = GraphicsDevice.BackBuffer.Width / 2;
            int spriteSceneHeight = GraphicsDevice.BackBuffer.Height / 2;
            int spriteSceneRadiusWidth = GraphicsDevice.BackBuffer.Width / 2 - textureHalfSize;
            int spriteSceneRadiusHeight = GraphicsDevice.BackBuffer.Height / 2 - textureHalfSize;

            // Time used to animate the balls
            var time = (float)gameTime.TotalGameTime.TotalSeconds;

            // Draw sprites on the screen
            var random = new Random(0);
            const int SpriteCount = 5000;
            spriteBatch.Begin(SpriteSortMode.Deferred, GraphicsDevice.BlendStates.NonPremultiplied);  // Use NonPremultiplied, as this sprite texture is not premultiplied

            for (int i = 0; i < SpriteCount; i++)
            {
                var angleOffset = (float)random.NextDouble() * Math.PI * 2.0f;
                var radiusOffset = (float)random.NextDouble() * 0.8f + 0.2f;
                var spriteSpeed = (float)random.NextDouble() + 0.1f;

                var position = new Vector2
                {
                    X = spriteSceneWidth + spriteSceneRadiusWidth * radiusOffset * (float)Math.Cos(time * spriteSpeed + angleOffset),
                    Y = spriteSceneHeight + spriteSceneRadiusHeight * radiusOffset * (float)Math.Sin(time * spriteSpeed + angleOffset)
                };

                var sourceRectangle = new DrawingRectangle(0, (int)((float)random.NextDouble() * 31) * 32, 32, 32);
                spriteBatch.Draw(ballsTexture, position, sourceRectangle, Color.White, 0.0f, new Vector2(textureHalfSize, textureHalfSize), Vector2.One, SpriteEffects.None, 0f);
            }
            spriteBatch.End();

            // Update the FPS text
            frameCount++;
            if (fpsClock.ElapsedMilliseconds > 1000.0f)
            {
                fpsText = string.Format("{0:F2} FPS", (float)frameCount * 1000 / fpsClock.ElapsedMilliseconds);
                frameCount = 0;
                fpsClock.Restart();
            }

            // Render the text
            spriteBatch.Begin();
            spriteBatch.DrawString(arial16BMFont, "  " + SpriteCount + "\nSprites", new Vector2(spriteSceneWidth - 32, spriteSceneHeight- 24), Color.White);
            spriteBatch.DrawString(arial16BMFont, fpsText, new Vector2(0, 0), Color.White);
            spriteBatch.End();

            // Handle base.Draw
            base.Draw(gameTime);
        }
Exemplo n.º 17
0
        internal override void Initialize(object windowContext)
        {
            nativeWindow = windowContext;

            if (windowContext != null)
            {
                var swapChainBackgroundPanel = windowContext as SwapChainBackgroundPanel;
                if (swapChainBackgroundPanel == null)
                {
                    throw new NotSupportedException(string.Format("Unsupported window context [{0}]. Only null or SwapChainBackgroundPanel", nativeWindow.GetType().FullName));
                }

                clientBounds = new DrawingRectangle(0, 0, (int)swapChainBackgroundPanel.ActualWidth, (int)swapChainBackgroundPanel.ActualHeight);
                IsSwapChainBackgroundPanel = true;
            }
        }
Exemplo n.º 18
0
 public void DrawRectangle(DrawingRectangle rect, int padNumber)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 19
0
        /// <summary>
        /// Adds a sprite to a batch of sprites for rendering using the specified texture, destination rectangle, source rectangle, color, rotation, origin, effects and layer.
        /// </summary>
        /// <param name="texture">A texture.</param>
        /// <param name="destinationRectangle">A rectangle that specifies (in screen coordinates) the destination for drawing the sprite. If this rectangle is not the same size as the source rectangle, the sprite will be scaled to fit.</param>
        /// <param name="sourceRectangle">A rectangle that specifies (in texels) the source texels from a texture. Use null to draw the entire texture. </param>
        /// <param name="color">The color to tint a sprite. Use Color.White for full color with no tinting.</param>
        /// <param name="rotation">Specifies the angle (in radians) to rotate the sprite about its center.</param>
        /// <param name="origin">The sprite origin; the default is (0,0) which represents the upper-left corner.</param>
        /// <param name="effects">Effects to apply.</param>
        /// <param name="layerDepth">The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing.</param>
        public void Draw(Texture texture, DrawingRectangle destinationRectangle, DrawingRectangle?sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth)
        {
            var destination = new DrawingRectangleF(destinationRectangle.X, destinationRectangle.Y, destinationRectangle.Width, destinationRectangle.Height);

            DrawSprite(texture, null, ref destination, false, ref sourceRectangle, color, rotation, ref origin, effects, layerDepth);
        }
Exemplo n.º 20
0
        public void Draw(CubeTexture texture, CubeMapFace face, DrawingRectangle destinationRectangle, Color color)
        {
            var destination = new DrawingRectangleF(destinationRectangle.X, destinationRectangle.Y, destinationRectangle.Width, destinationRectangle.Height);

            DrawSprite(texture, face, ref destination, false, ref nullRectangle, color, 0f, ref vector2Zero, SpriteEffects.None, 0f);
        }