lib/cyberarm_engine/common.rb in cyberarm_engine-0.3.0 vs lib/cyberarm_engine/common.rb in cyberarm_engine-0.4.0
- old
+ new
@@ -46,9 +46,15 @@
else
return Gosu::Color.rgb(color.red-amount, color.green-amount, color.blue-amount)
end
end
+ def opacity(color, ratio = 1.0)
+ alpha = 255 * ratio
+
+ return Gosu::Color.rgba(color.red, color.green, color.blue, alpha)
+ end
+
def get_asset(path, hash, klass)
asset = nil
hash.detect do |_asset, instance|
if _asset == path
asset = instance
\ No newline at end of file