mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2026-03-22 12:06:13 +00:00
Initial support for using cyberarm_engine as a mruby mrbgem: Remove/disable usages of defined?, update old gosu mouse and keyboard constants, and replace one usage of window.button_down? with proper Gosu.button_down?
This commit is contained in:
@@ -52,7 +52,7 @@ module CyberarmEngine
|
||||
end
|
||||
|
||||
def lighten(color, amount = 25)
|
||||
if defined?(color.alpha)
|
||||
if color.respond_to?(:alpha)
|
||||
Gosu::Color.rgba(color.red + amount, color.green + amount, color.blue + amount, color.alpha)
|
||||
else
|
||||
Gosu::Color.rgb(color.red + amount, color.green + amount, color.blue + amount)
|
||||
@@ -60,7 +60,7 @@ module CyberarmEngine
|
||||
end
|
||||
|
||||
def darken(color, amount = 25)
|
||||
if defined?(color.alpha)
|
||||
if color.respond_to?(:alpha)
|
||||
Gosu::Color.rgba(color.red - amount, color.green - amount, color.blue - amount, color.alpha)
|
||||
else
|
||||
Gosu::Color.rgb(color.red - amount, color.green - amount, color.blue - amount)
|
||||
|
||||
Reference in New Issue
Block a user