I'm trying to add a spritesheet to my Ggez game, and getting the following error when running cargo run
:
Error: ResourceNotFound("/sprites.png", [("/home/pablo/Dev/rust-game/target/debug/resources", IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" })), ("/home/pablo/.local/share/our_game", IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" })), ("/home/pablo/.config/our_game", IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" }))])
From the docs I thought I just had to put my sprites.png in the resources
folder, which I did:
❯ ls resources/
sprites.png
But it doesn't seem to be looking in that folder, instead it looks in .../target/debug/resources
. I guess that makes sense, as that seems to be the folder where the build is placed (I'm new to rust, so just taking a guess here). That folder does not exist:
❯ ls target/debug/resources
ls: cannot access 'target/debug/resources': No such file or directory
For gezz I found cargo-resource-root
but that option no longer exists it seems. And for Rust the include
field in Cargo.toml
also didn't actually make any difference. Are there other things I can try to either let Ggez know to look in the right place, or to let Rust know to include those files?