Hey guys, I downloaded a light script that creates a picture as a light, but the script doesn't set the blend type for the light picture, so its just on normal blending. I want it to be on add blend, so I was trying to figure out how to change the picture's blend type to add.
Here's what I tried:
But it didn't work, I got an undefined method error. Any help would be greatly appreciated, thanks!
Here's what I tried:
def initialize(event, radius, tone, flicker, glow, brightness, filename)
super()
self.z = 1000
self.tone = tone
self.opacity = brightness
self.x = (event.real_x - radius * 2 - $game_map.display_x) / 4 + 12
self.y = (event.real_y - radius * 2 - $game_map.display_y) / 4 + 6
bmp = filename == nil ? RPG::Cache.picture(DEFAULT) : RPG::Cache.picture(filename)
self.bitmap = Bitmap.new(radius, radius)
self.bitmap.stretch_blt(Rect.new(0, 0, radius, radius), bmp, bmp.rect)
picture.blend_type = 1
@radius = radius
@brightness = brightness
@event = event
@flicker = flicker
@glow = glow
@step = 0.001
@flicker_count = -1
@count = 0
end
super()
self.z = 1000
self.tone = tone
self.opacity = brightness
self.x = (event.real_x - radius * 2 - $game_map.display_x) / 4 + 12
self.y = (event.real_y - radius * 2 - $game_map.display_y) / 4 + 6
bmp = filename == nil ? RPG::Cache.picture(DEFAULT) : RPG::Cache.picture(filename)
self.bitmap = Bitmap.new(radius, radius)
self.bitmap.stretch_blt(Rect.new(0, 0, radius, radius), bmp, bmp.rect)
picture.blend_type = 1
@radius = radius
@brightness = brightness
@event = event
@flicker = flicker
@glow = glow
@step = 0.001
@flicker_count = -1
@count = 0
end
But it didn't work, I got an undefined method error. Any help would be greatly appreciated, thanks!