Hi, post to ask if there is a way to use the method button_down(id) out of a class that inherits from Window. Example: I can invoke the method button_down?(id) outside as follows: window.button_down?, returning true if I press a button, but as I do with the method button_down(id)??
I tried to do the following:
def window.button_down(id) if id == KbUp then puts 1 end end
This syntax seems to be for a singleton method defined on the window variable, which might not be what you intend to do. Still, I don't think that should cause any problems.
Can you clarify whether you are attempting to define #button_down() or #button_down?() ?
The former is what you want to be redefining in descendants of Gosu::Window. The latter is used to see if the given key is currently depressed or not.