Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

More rectangle functions, more @safe, and default values of Camera2D #57

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

LiamM32
Copy link
Contributor

@LiamM32 LiamM32 commented Jun 1, 2024

These are the changes:

  • dub.json now says to include raylib, as Raylib-D isn't usable without it.
  • More functions added to Rectangle, including top, bottom, left, and right.
  • Rectangle functions marked @safe.
  • Camera2D.zoom set to 1.0f by default. This would make it easy to figure-out how to use.

I think it makes sense for Camera2D.zoom to be set to 1.0f by default, because that is what it is usually set to straight away. The documentation for Raylib even says that it should be set to 1.0f by default, which a new D programmer not experienced in C may interpret this to mean that it is set to 1.0f by default.

Let's just hope that there aren't any projects out there that use the value of Camera2D.zoom to detect whether a camera has been initialized, as that would result in a breaking change here. However, I think it's unlikely that there are any programs that do that. I considered having an "enhancedD" configuration that would set things to be more D-like while keeping the default configuration to be in-line with Raylib. However, I decided to drop this idea as a new user of Raylib-D probably wouldn't think to set this configuration when starting a new project.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant