Added hollow shapes.

This commit is contained in:
Kapendev 2024-12-28 02:15:59 +02:00
parent 355b1cf908
commit 9a57f42d6f
3 changed files with 22 additions and 3 deletions

View file

@ -1,6 +1,7 @@
# Preferences
This file provides an overview of my likes and dislikes to help others understand what I am trying to make/avoid.
The ideas here are just for Parin and nothing else.
## Things I Like
@ -13,6 +14,6 @@ This file provides an overview of my likes and dislikes to help others understan
* Godot 3+: Error handling, file system, resources, signals, tile maps, sprite animations... The list is too long.
* Scripting Languages: You already have a good programming language.
* OOP/SOLID/DAD: Just focus on the data, the procedures and the goal. Everything else is bureaucracy.
* OOP/SOLID/DOD/DAD: Just focus on the data, the procedures and the goal. Everything else is bureaucracy or someone trying to sell you something.
* Safe Code: Most people have a different idea about what it means, so it's usually not worth thinking about it.
* RAII: One of the solutions to make code "safe". Not worth thinking about it.
* RAII: One of the solutions to make code "safe". Not my style.

View file

@ -1,6 +1,6 @@
# Projects Made With Parin
This is a place for people to showcase their projects built with Parin.
This is a place for people to showcase their projects built with Parin.
If you would like your project listed here, feel free to add it and submit a PR!
* [Clean & Haunted](https://kapendev.itch.io/clean-haunted)

View file

@ -2137,6 +2137,15 @@ void drawRect(Rect area, Color color = white) {
}
}
@trusted
void drawHollowRect(Rect area, float thickness, Color color = white) {
if (isPixelSnapped || isPixelPerfect) {
rl.DrawRectangleLinesEx(area.floor().toRl(), thickness, color.toRl());
} else {
rl.DrawRectangleLinesEx(area.toRl(), thickness, color.toRl());
}
}
/// Draws a point at the specified location with the given size and color.
void drawVec2(Vec2 point, float size, Color color = white) {
drawRect(Rect(point, size, size).centerArea, color);
@ -2152,6 +2161,15 @@ void drawCirc(Circ area, Color color = white) {
}
}
@trusted
void drawHollowCirc(Circ area, float thickness, Color color = white) {
if (isPixelSnapped || isPixelPerfect) {
rl.DrawRing(area.position.floor().toRl(), area.radius - thickness, area.radius, 0.0f, 360.0f, 30, color.toRl());
} else {
rl.DrawRing(area.position.toRl(), area.radius - thickness, area.radius, 0.0f, 360.0f, 30, color.toRl());
}
}
/// Draws a line with the specified area, thickness, and color.
@trusted
void drawLine(Line area, float size, Color color = white) {