New to the forum? Say hello in this topic! Make sure to read the rules.
RULE NR 3 UPDATED: Don't hurt, harass or provoke other forum members or people.

Visually debugging by drawing shapes

Share questions and tutorials related to the ScriptAPI and give suggestions for new functions you want to see.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
JakSparro98
Superfighter
Superfighter
Posts: 257
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 19

Visually debugging by drawing shapes

Post by JakSparro98 » Tue Nov 28, 2017 5:35 pm

I would suggest a way for drawing debugging shapes on map editor, primitive shapes like straight lines, rectangles or circles that can be used to see visively some code algorith difficult to adjust, the color should be similar to the already existent mouse debug line used for moving objects in the editor.

A possible implementation could be:

Game.DrawLine(Vector2 FirstPoint, Vector2 SecondPoint);

Game.DrawCircle(Vector2 Position, float radius);

Game.DrawRectangle(Vector2 Min, Vector2 Max); or Game.DrawRectangle(Area Dimensions);

Typical situations where this could be useful is when you need to handle precise bounding boxes checks, visualize linked objects by a trigger/ joint (the latter is already present for joints, but the drawn links behave in a non intuitive manner, maybe related to some internal Box2D calculations) and so on.

EDIT: It could be also nice the possibility to choose if the drawing need to be filled or not (only borders or completely filled with a semi transparent layer).
2 x

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest