Is it possible to use blending modes (Add and Subtract, the options for sprites) when combining bitmaps in a window?
I made a method using get_pixel and set_pixel, like this ...
... but it's horribly time-consuming. Is there a better way?
I made a method using get_pixel and set_pixel, like this ...
# Adds bitmap to otherbitmap and displays in a window
bitmap = RPG::Cache.fog('006-Sandstorm02', 0)
otherbitmap = RPG::Cache.fog('007-Water01', 0)
windowfun = Window_Base.new(0, 0, 300, 300)
windowfun.contents = Bitmap.new(bitmap.width, bitmap.height)
for x in 0...bitmap.width
for y in 0...bitmap.height
color1 = bitmap.get_pixel(x, y)
color2 = otherbitmap.get_pixel(x, y)
newcolor = Color.new(color1.red + color2.red, color1.green +
color2.green, color1.blue + color2.blue)
windowfun.contents.set_pixel(x, y, newcolor)
end
end
bitmap = RPG::Cache.fog('006-Sandstorm02', 0)
otherbitmap = RPG::Cache.fog('007-Water01', 0)
windowfun = Window_Base.new(0, 0, 300, 300)
windowfun.contents = Bitmap.new(bitmap.width, bitmap.height)
for x in 0...bitmap.width
for y in 0...bitmap.height
color1 = bitmap.get_pixel(x, y)
color2 = otherbitmap.get_pixel(x, y)
newcolor = Color.new(color1.red + color2.red, color1.green +
color2.green, color1.blue + color2.blue)
windowfun.contents.set_pixel(x, y, newcolor)
end
end
... but it's horribly time-consuming. Is there a better way?