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

images MUST be in directory assets #28

Open
GavinB-hpe opened this issue Jul 29, 2019 · 2 comments
Open

images MUST be in directory assets #28

GavinB-hpe opened this issue Jul 29, 2019 · 2 comments

Comments

@GavinB-hpe
Copy link

The tutorial text says re. the location of city.png :

directory, called assets (you can also name it res, or any name you like)

However the code does not work unless the directory is called assets :

Unable to load texture: resource not loaded by `FileLoader`: "textures/city.png"
panic: value method github.com/EngoEngine/engo/common.Texture.Width called using nil *Texture pointer
@Noofbiz
Copy link
Member

Noofbiz commented Jul 29, 2019

Ah I can see how that's a bit confusing! It's true, but it takes a little bit of work. When you setup your run options you can use the AssetRoot option to change it to whatever you want. You can also use 'engo.Files.SetRoot("res")' for example to set the asset root to something else on the fly. I'll see if I can work that in there somewhere! Thanks!

@GavinB-hpe
Copy link
Author

I thought it might be something like that. I would suggest just adding

engo.Files.SetRoot("assets")

into Preload() with the comment that the default is "assets" if not specified.

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

No branches or pull requests

2 participants