Made Vector#operator private, refactored BoundingBox initializer to accept either Vectors or numbers, added #opacity to Common

This commit is contained in:
2019-05-01 13:47:17 -05:00
parent 6b319935d3
commit df2dc25e34
3 changed files with 24 additions and 4 deletions

View File

@@ -48,6 +48,12 @@ module CyberarmEngine
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|