Author Topic: Two problems with gr.drawSubsystemTargetingBrackets  (Read 543 times)

0 Members and 1 Guest are viewing this topic.

Offline Shivan Hunter

  • 210
  • Dead fascists cannot rig elections
Two problems with gr.drawSubsystemTargetingBrackets
Trying to use this function to do stuff.

Firstly, the function returns a screen-space box (x1, y1, x2, y2) after drawing a targeting bracket - but it refuses to do this if the drawn bracket is a diamond (if the subsys is obscured). All values returned are nil, despite the function OBVIOUSLY computing these values to draw the diamond-bracket. What is a workaround/fix for this, other than projecting the subobject's position into screen space and doing it manually?

Secondly, the drawn bracket is the wrong size for subsystems that are far away. If I draw this box around a subsystem that the player is actively targeting, the box drawn by Lua is distinct from FSO's builtin one - it is both larger and wider. Up close, the difference disappears. It seems both Lua and FSO calculate a minimum size for the target box and Lua does it differently/wrong.

Yes I am aware of the "mark box" script on the Github and it in fact showcases both of these bugs.