Added all the callbacks to Window and GameState, removed all but one usage of global variables ().

This commit is contained in:
2022-06-05 09:19:30 -05:00
parent 0a62e5180a
commit ca73a2d8e8
11 changed files with 178 additions and 97 deletions

View File

@@ -43,9 +43,9 @@ module CyberarmEngine
when :left
@x = 0 + BUTTON_PADDING
when :center
@x = ($window.width / 2) - (@textobject.text_width(@text) / 2)
@x = (CyberarmEngine::Window.instance.width / 2) - (@textobject.text_width(@text) / 2)
when :right
@x = $window.width - BUTTON_PADDING - @textobject.text_width(@text)
@x = CyberarmEngine::Window.instance.width - BUTTON_PADDING - @textobject.text_width(@text)
end
end
end