lib/cyberarm_engine/common.rb in cyberarm_engine-0.18.0 vs lib/cyberarm_engine/common.rb in cyberarm_engine-0.19.0
- old
+ new
@@ -26,12 +26,12 @@
def show_cursor=(boolean)
window.show_cursor = boolean
end
- def draw_rect(x, y, width, height, color, z = 0)
- Gosu.draw_rect(x, y, width, height, color, z)
+ def draw_rect(x, y, width, height, color, z = 0, mode = :default)
+ Gosu.draw_rect(x, y, width, height, color, z, mode)
end
def fill(color, z = 0)
draw_rect(0, 0, window.width, window.height, color, z)
end
@@ -94,8 +94,20 @@
get_asset(path, Window::SONGS, Gosu::Song)
end
def window
$window
+ end
+
+ def control_down?
+ Gosu.button_down?(Gosu::KB_LEFT_CONTROL) || Gosu.button_down?(Gosu::KB_RIGHT_CONTROL)
+ end
+
+ def shift_down?
+ Gosu.button_down?(Gosu::KB_LEFT_SHIFT) || Gosu.button_down?(Gosu::KB_RIGHT_SHIFT)
+ end
+
+ def alt_down?
+ Gosu.button_down?(Gosu::KB_LEFT_ALT) || Gosu.button_down?(Gosu::KB_RIGHT_ALT)
end
end
end