I really need some help here. For the past 3 hours I've been trying to get the light to move according to camera. But I just can't seem to do it. I have been reading the topics here a lot and I haven't found anything that helped me.
When I followed the example I managed to see the light. But as soon as I moved the camera it disappeared extremely fast.
This is how I do my camera matrix:
Matrix cameraMatrix = Matrix.CreateTranslation(camera.X, camera.Y, 0);
//krypton.Matrix = ;
spriteBatch.Begin(0, null, null, null, null, null, cameraMatrix);
//Draw everything here
And this is how I move the camera:
if (playerLocation.X > 402.6 && playerLocation.X < 820)
camera.X = (-playerLocation.X / 2 - playerBox.Width / 2) + (windowWidth / 4);
I have also added lights:
this.krypton = new KryptonEngine(this, "KryptonEffect");
Texture2D mLightTexture = LightTextureBuilder.CreatePointLight(this.GraphicsDevice, 512);
light.Position = new Vector2(0, 0);
light.Range = 1;
light.Texture = mLightTexture;
light.IsOn = true;
light.Color = Color.White;
light.Intensity = 10f;
light.Fov = 40f;
I don't really much about how matrices works. So I would be glad if someone could modify this into something small and easy that works with krypton. I only need to move camera sideways and up/down, I don't need scale and rotation.