예제 #1
0
        public void Draw(SpriteBatch spriteBatch)
        {
            camera.BeginDraw(spriteBatch);
            background.Draw(spriteBatch);
            spriteBatch.End();

            LightPolygon.BeginDraw();

            foreach (Light light in lights)
            {
                light.Draw();
            }

            LightPolygon.EndDraw(spriteBatch);

            camera.BeginDraw(spriteBatch);

            player.Draw(spriteBatch);

            foreach (IObstacle obstacle in obstacles)
            {
                obstacle.Draw(spriteBatch);
            }

            spriteBatch.End();
        }
예제 #2
0
        public static void Initialize(GraphicsDevice GraphicsDevice, ContentManager Content)
        {
            camera = new Camera();

            LightPolygonUnused.Initialize(GraphicsDevice, camera);
            LightPolygon.Initialize(GraphicsDevice, camera);
            EdgelessPolygon.Initialize(GraphicsDevice, camera);
            Image.Initialize(Content);
        }
예제 #3
0
파일: Light.cs 프로젝트: JonasAAA/Lighting
        public Light(Vector2 position, float mainAngle, float maxAngleDiff, float strength, Color color)
        {
            this.position = position;

            this.mainAngle = mainAngle;

            this.maxAngleDiff = maxAngleDiff;
            castObjects       = new List <IShadowCastingObject>();
            polygon           = new LightPolygon(strength, color);
        }
예제 #4
0
파일: Game1.cs 프로젝트: JonasAAA/Lighting
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.PreferredBackBufferWidth  = C.screenWidth;
            graphics.PreferredBackBufferHeight = C.screenHeight;
            graphics.IsFullScreen = true;

            LightPolygon.EarlyInitialize(graphics);
        }
예제 #5
0
 public static void Initialize(GraphicsDevice GraphicsDevice, Camera camera)
 {
     LightPolygon.Initialize(GraphicsDevice, camera);
 }
예제 #6
0
 public static void EarlyInitialize(GraphicsDeviceManager graphics)
 {
     LightPolygon.EarlyInitialize(graphics);
 }
예제 #7
0
 public static void EndDraw(SpriteBatch spriteBatch)
 {
     LightPolygon.EndDraw(spriteBatch);
 }
예제 #8
0
 public static void BeginDraw()
 {
     LightPolygon.BeginDraw();
 }