Hi,
I want to make some kind of indicators on the screen that shows me the exact positions of the players. If the players are on the screen, these indicators are above their heads. If they're off screen, these indicators should be on the side of the screen in the right direction. I tried with this code :
(for each player :)
CameraProject e_cam\cam,EntityX(pl\entity),EntityY(pl\entity)+1.8,EntityZ(pl\entity)
cx#=ProjectedX#()
cy#=ProjectedY#()
If cx<0 Then cx=0
If cx>GraphicsWidth() Then cx=GraphicsWidth()
If cy<0 Then cy=0
If cy>GraphicsHeight() Then cy=GraphicsHeight()
DrawImage pl\cross,cx-16,cy-16
The problem with this is, if the value of ProjectedY() gets too big, then both ProjectedY() and ProjectedX() return 0. I can't seem to think of another way to get the exact 2d positions of my 3D characters, so a little help would be appreciated. Thanks.
I want to make some kind of indicators on the screen that shows me the exact positions of the players. If the players are on the screen, these indicators are above their heads. If they're off screen, these indicators should be on the side of the screen in the right direction. I tried with this code :
(for each player :)
CameraProject e_cam\cam,EntityX(pl\entity),EntityY(pl\entity)+1.8,EntityZ(pl\entity)
cx#=ProjectedX#()
cy#=ProjectedY#()
If cx<0 Then cx=0
If cx>GraphicsWidth() Then cx=GraphicsWidth()
If cy<0 Then cy=0
If cy>GraphicsHeight() Then cy=GraphicsHeight()
DrawImage pl\cross,cx-16,cy-16
The problem with this is, if the value of ProjectedY() gets too big, then both ProjectedY() and ProjectedX() return 0. I can't seem to think of another way to get the exact 2d positions of my 3D characters, so a little help would be appreciated. Thanks.