# Setting Krypton Light to Screen Pixels

So a few days back, I started playing around with Krypton XNA for 2D lighting in my game.

I noticed in general, that spawning a light at (0,0) with Krypton causes the light to appear in, pretty much, the centre of the game screen. Is there any way to change this so a Krypton light's "starting point" at [0,0] would spawn at the top left of the screen, and thus follow the standard screen co-ordinates for position?

I ask because currently I'm busy working on my game where my spawn point is [512,512]. With hard code, the closest I've got to the light being "central" to this point is the vector position [12,-20], which makes no sense and is impossible to craft, mathematically, if I want the light to move with the camera (the position [480,512] maps roughly to [10,-20]).

So, is there any way to "normalise" the krypton lights to use standard screen co-ordinates?

If you guys can, play around with the demo from the site and please see if you can find anything out about it. Documentation on the engine is rather scarce, so it's difficult to find anything relevant to my "pixel-perfect" need. It might just also be something in the code with regards to the matrices that I'm not fully understanding.

Any help would be useful.

Thanks.

• You can't simply take the width of your screen and subtract that from the starting point? ie spawn a light at [-450,-720] if your screen is 900x1440 and it will be in the top left corner. I'm not used to xna (hence im only commenting) but is there no way to get the screen's height and length? Commented Jul 23, 2012 at 21:00
• Alas, no luck there. Again, this all comes down to, I think, Krypton's non-pixel based vector co-ordinate system where, for example, 12 units along the X axis is actually around 512 pixels. Like I said, however, this measurement system feels fairly arbitrary and I can't figure out the math behind it. Commented Jul 23, 2012 at 21:44
• Oh I see, 12 units is equal to 512ish. I didnt get that from the question. Hmmm, seems like an unusual problem indeed. Commented Jul 23, 2012 at 21:46

• by enabling "SpriteBatch" mode on Krypton by doing this: KryptonEngine.SpriteBatchCompatablityEnabled = true; ? Commented Sep 21, 2012 at 0:00