Default font for TextBox should be stored as a constant.
Closed this issue · 2 comments
RavensKrag commented
This constant can not be declared as it depends on the global $window. $window is initialized when the main Gosu::Window object is created. However, the call to Gosu::Font is made when the file containing TextBox is loaded. This file is loaded before the Gosu::Window object is initialized, thus the problem.
RavensKrag commented
Thinking about moving this to some external Gosu::Font managing class, much like ArtManager.
RavensKrag commented
Font was being passed as a parameter for a while, so I felt odd about this. But it was changed to being hard-coded somewhere along the line, and it seems like I neglected to notice I made that change. Don't know how that happened....
Thus, went ahead and made it a class variable. Issue closed.