veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

Couldnot load the font #499

Closed nabinkhanal00 closed 2 years ago

nabinkhanal00 commented 2 years ago

panic: Couldn't open ./assets/Impact.ttf

goroutine 1 [running, locked to thread]: main.main() main.go:90 +0x24b exit status 2

[Process exited 1]

veeableful commented 2 years ago

Hi @khanalnabin, could you share a minimal example code that re-produces this problem? I will investigate it. Thanks!

nabinkhanal00 commented 2 years ago

Thank you @veeableful for your concern. The directory where I put the assets was inside the folder where i was writing a go file. When I transferred to the main package level, it worked. I think since I was using go run . at package level, the assets folder needed to be in that same package level, not inside folder where the go file accessing the assets is present. Once again thanks.