Hands-on Rust: ".with_dimensions()" vs. ".with_simple_console" (page 97)

Hi,

Fantastic book! Question:

On page 97, when building a BTerm, why is it necessary to specify the terminal’s dimensions in two ways: first, here:

.with_dimensions(DISPLAY_WIDTH, DISPLAY_HEIGHT)

and then again here

.with_simply_console(DISPLAY_WIDTH, DISPLAY_HEIGHT, etc.

Mostly just curious. And is there an API reference for bracket-lib anywhere? I couldn’t find one here: (bracket-lib/bracket-terminal at master · amethyst/bracket-lib · GitHub)

Thank you,

Lazza

1 Like

There’s the beginning of a guide here: https://bfnightly.bracketproductions.com/bracket-lib/

I’ve had a heck of a month, hopefully I’ll get it finished soon. The resolution is specified on the console to force it to scale appropriately to the character size on the font. You can usually skip it, I tend to put it in there for safety (occasionally programs run into some ODD display settings!)

2 Likes

Thank you Herbert!

2 Likes