예제 #1
0
        public override void Draw(Screen screen)
        {
            Position = screen.ToWorldPosition(InputManager.GetMousePosition());
            screen.Draw(
                texture: Texture,
                position: screen.ToExactPosition(Position),
                layerDepth: LayerDepth,
                rotationAngle: RotationAngle,
                rotationOrigin: RotationOrigin,
                exactPosition: true
                );

            if (Debug) // TODO move to screen
                TextureManager.Font.DrawText(
                    screen.SpriteBatch,
                    "X: " + Position.X + "; Y: " + Position.Y + ";",
                    12,
                    screen.ToExactPosition(Position + new Vector2(0, 20)),
                    Color.Red,
                    LayerDepth + 0.01f,
                    false
                );
        }
예제 #2
0
        public override void Draw(Screen screen)
        {
            Texture2D texture = Texture;
            Vector2 textureScale = TextureScale;

            for (float x=0; x< BlockAmountX; x++)
            {
                for (float y=0; y<BlockAmountY; y++)
                {
                    Vector2 position = Position + new Vector2(x * Size.X / BlockAmountX, y * Size.Y / BlockAmountY);

                    screen.Draw(
                        texture: texture,
                        position: position,
                        layerDepth: LayerDepth,
                        color: _colorBehaviour.Value,
                        objectScale: textureScale,
                        rotationAngle: RotationAngle,
                        rotationOrigin: RotationOrigin
                        );
                    //screen.SpriteBatch.Draw(
                    //    texture,
                    //    position: screen.ToExactPosition(position + RotationOrigin * textureScale),
                    //    scale: screen.Scale * textureScale,
                    //    color:_colorBehaviour.Value,
                    //    rotation: RotationAngle,
                    //    origin: RotationOrigin,
                    //    layerDepth: LayerDepth
                    //    );
                }
            }
        }
예제 #3
0
 public override void Draw(Screen screen)
 {
     screen.Draw(
         Texture,
         this,
         TextureScale
         );
 }