Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Visually debugging by drawing shapes

Give us your input on how we may improve the ScriptAPI in the game in future versions.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
Posts: 495
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Age: 21

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).
3 x

Post Reply