I’m trying to implement a day/night cycle on the game i’m working on, and i’m a little confuse about point lights radius.
How does they work ?
Because when i’m adding a point and i set its radius to 150, on screen the light circle has a diameter of 230px. And when i set it to 75, it disappears.
If it is not a pixel parameter, it is not proportional, what it is bind to ?
Is it bind to the intensity (In my case set to 10) ? The coordinates ? The screen size ?
It seems to be the length between the light and the camera view, but i don’t know what uCamera.w is…
Too much complicated for me xD
I use a lot the Lights in my games, but i just find the good values by try and errors.
And you need to know that the Lights will be deprecated on next Phaser version…sadly
Camera.w is certainly the camera width, so as I said the radius is certainly directly bind to the canvas size. It would be better if everything worked the same way, maybe it is the reason why it will be deprecated.
I hope it is for a rework
Anyway I will search for an alternative, mask is a good one I think
The game canvas always fill the page, so to keep the same scale i apply a ratio to every objects (Position and size).
When i resize the page, every objects change their width and height to have the good size, except lights which have weird changements.
I made an example: https://jsfiddle.net/ZauChoco/7uxoag48
Try to resize the result page on the width, the light radius scale change oddly compared to the base image. (With this edit layout if possible: )