tcod-rs
tcod-rs copied to clipboard
terminal.png not provided
The tcod-rs build script could copy it to the root of the project?
I'm not sure what you mean. terminal.png
is checked into the tcod-rs
repo:
https://github.com/tomassedovic/tcod-rs/blob/master/terminal.png
But if you mean your own projects that use the tcod
crate, you should copy it yourself (either from tcod-rs
or libtcod
) or choose another font using tcod::Console::set_custom_font
. terminal.png
kind of sucks and it's there just to be able to run tests and examples easily. But in general, you should pick a font from libtcod/data/fonts/
or download a font in the same format from the internet.
What I meant that the version checked out with the repo should be findable by the library by default.
So a solution that would use the one included when another isn't available would make most sense, perhaps? I just feel that for a total newbie, the absence of terminal.png could be confusing, especially when one is included with TCOD itself.
I propose adding a check that if the terminal.png isn't available, the provided one is used and a warning is generated in place of the "SDL : cannot load terminal.png" warning :)
Sorry, I'm still not sure what your exact problem is.
Do you mean having a project that depends on the tcod
crate? And when you try to run in, you get the cannot load terminal.png
message? Or do you mean something else?
If that is the case, then the tcod
crate and/or its build script can't really produce or load its own terminal.png
. See here:
http://doc.crates.io/build-script.html
the build script has no way of knowing where the project that uses it is and it shouldn't interfere with it at all. The error message itself comes from libtcod
-- the C version that tcod-rs
provides Rust bindings for.
And you have the same problem with your C, C++ or Python libtcod code:
http://www.roguebasin.com/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod,_part_1
I understand this can be frustrating for a Rust / libtcod newbie, but the best think we can do I think is just document this. Or maybe provide an engine-like function that looks for the font and if it isn't there and there isn't an alternative set, we could bail out.
But strictly speaking, with this library you're supposed to provide the fonts (just like any other assets) and the right calls yourself. Libtcod isn't as much an engine as it is a library that you write your roguelike engine on top of.
Sorry for the latency.
Yeah, you raise some valid points there. Providing a default font with the library is probably not desirable.
Feel free to mark this as resolved ^^
Cool :-). I'll keep this open because we should mention this in the docs and/or the examples.
I'd like people who aren't familiar with libtcod to use this with as few issues as possible.
Hey, I started working on https://tomassedovic.github.io/roguelike-tutorial/part-1-graphics.html and I got stuck with the same issue as above. Not knowing enough Rust, it took me a while to find this issue which helped me solve the problem. Can the tutorial be updated to point to this issue?