Skip to content

[example] Closes #4901, Fix Problems in 'text_draw_3d.c' #4907

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 26, 2025

Conversation

ZeanKey
Copy link
Contributor

@ZeanKey ZeanKey commented Apr 22, 2025

Fixed multiple problems mentioned in #4901 , now the DrawText3D(), MeasureTextWave3D(), DrawTextWave3D() won't be affected by the base size of the font, which will show same effect as directly invoke DrawText() in 3D drawing.

This could be the expected effect of the 'text_draw_3d.c' as the creator of the example mentioned that they suppose MeasureTextEx() could work but didn't:

// Measure a text in 3D. For some reason `MeasureTextEx()` just doesn't seem to work so i had to use this instead.

As the unexpected scale is removed now MeasureTextEx() can normally function in program so I replaced MeasureText3D() with it.

Also, the "~~" markdown as command in wave text used to be counted for space and calculate character number in line in typer, which is now fixed by let counter only add up in characters not '\n' or '~' in "~~".

The line space and space now would not be scaled by scale factor as these arguments works in 2D text functions, and removed duplicated accumulation for space in MeausreTextWave3D().

@raysan5 raysan5 merged commit 7c6537a into raysan5:master Apr 26, 2025
@raysan5
Copy link
Owner

raysan5 commented Apr 26, 2025

@ZeanKey Thanks for the review! I'm not fully convinced if this should be the expected behaviour but the truth is that it looks good and seems more aligned to raylib 2d text behaviour.

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