Skip to content
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

ebitenutil: a utility function to draw texts #3113

Open
11 tasks
hajimehoshi opened this issue Sep 21, 2024 · 1 comment
Open
11 tasks

ebitenutil: a utility function to draw texts #3113

hajimehoshi opened this issue Sep 21, 2024 · 1 comment
Labels
Milestone

Comments

@hajimehoshi
Copy link
Owner

hajimehoshi commented Sep 21, 2024

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

What feature would you like to be added?

Now rendering a text is a little troublesome with text/v2 to be honest. So, what about having a utility function like this?

func DrawText(dst *ebiten.Image, fontFilePath string, text string, x, y int, fontSize int, clr color.Color)
func DrawTextWithFileSystem(dst *ebiten.Image, fontFilePath string, fs fs.FS, text string, x, y int, fontSize int, clr color.Color)

This is inspired by a Reddit post https://www.reddit.com/r/golang/comments/1exl1bi/my_experience_with_ebitengine_and_raylibgo_gmtk/

Why is this needed?

No response

@hajimehoshi
Copy link
Owner Author

DrawText without a file system argument is not portable. NewImageFromFile is not defined on mobiles, and I am not confident this situation is fine.

@hajimehoshi hajimehoshi modified the milestones: v2.8.0, v2.9.0 Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant