when calling an expression like “object.X()” we can read the position X of the object in its layer, and depending on the camera position, it is different from the coordinates on the screen.
what about an expression to read the SCREEN COORDINATES, maybe can be useful.
Well, just to say, Darkbasic Pro can convert a point of a 3d world to a screen x and y coord of a specified camera.
my intended use: i’ve many levels, objects, zoom and unzoom situations. Over all this madness i’ve a not moving level, with an user interface, displaying data and maps. i would like to place near some objects a badge, with some info, but it must be always of the same size and without the layer’s effect i chosed.
so, if i can read the relative screen x and y position of objects, i can place those info in the user interface level.
i don’t know about the comand “DifferenceBetweenTwoAngles(ScreenWidth()/2, Object.X())” , i will check.
You have to subtract camera position to object position and calculate the distance using zoom proportion
Something like
1:zoom=(camera position- half camera size) - object position: screen position