Skip to content

Conversation

@luis605
Copy link
Contributor

@luis605 luis605 commented Sep 30, 2025

I added a new function to raylib's API called DrawLineDashed(). This function takes the following arguments:

Vector2 startPos    // 2D coordinate that tells where the line starts
Vector2 endPos      // 2D coordinate that tells where the line must end
int dashSize        // The length of each dash
int whiteSpaceSize  // The space between each dash
Color color         // The color of the dash

This new functions draws a line with interrupted spaces which can be useful to highlight text or draw UI borders.

Additionally, a new example that shows how to use this new function was also written. The example allows the user to modify the line properties at runtime and play with it.

Areas that must be reviewed:

  • Function argument names. Clarity can be improved.
  • Possible new argument: lineWidth.
  • Missing optimization opportunities and possible edge cases or security vulnerabilities I may have missed.

@raysan5 raysan5 merged commit f680776 into raysan5:master Oct 1, 2025
17 checks passed
@raysan5
Copy link
Owner

raysan5 commented Oct 1, 2025

@luis605 Thanks! Nice addition!

psxdev pushed a commit to raylib4Consoles/raylib that referenced this pull request Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants