本帖最后由 KB.Driver 于 2019-10-6 02:08 编辑
$calendar99 ||= {} $calendar99[:Bitmap] = $calendar99["Bitmap"] = 20190302 class Bitmap DEFAULT_COLOR = Color.new(77,88,99) def para_blt(src_bitmap, src_rect, color = DEFAULT_COLOR, color2 = nil) self.width.times do |x| self.height.times do |y| next unless get_pixel(x, y) == color x2 = src_rect.x + x ; y2 = src_rect.y + y src_color = src_bitmap.get_pixel(x2, y2) next if color2 && src_color == color2 set_pixel(x, y, src_color) end end end def para_blt_r(src_bitmap, color = DEFAULT_COLOR, differ = 0) self.width.times do |x| self.height.times do |y| next unless get_pixel(x, y).difference(color) <= differ src_bitmap.set_pixel(x, y, get_pixel(x, y) ) end end end end
$calendar99 ||= {}
$calendar99[:Bitmap] = $calendar99["Bitmap"] = 20190302
class Bitmap
DEFAULT_COLOR = Color.new(77,88,99)
def para_blt(src_bitmap, src_rect, color = DEFAULT_COLOR, color2 = nil)
self.width.times do |x|
self.height.times do |y|
next unless get_pixel(x, y) == color
x2 = src_rect.x + x ; y2 = src_rect.y + y
src_color = src_bitmap.get_pixel(x2, y2)
next if color2 && src_color == color2
set_pixel(x, y, src_color)
end
end
end
def para_blt_r(src_bitmap, color = DEFAULT_COLOR, differ = 0)
self.width.times do |x|
self.height.times do |y|
next unless get_pixel(x, y).difference(color) <= differ
src_bitmap.set_pixel(x, y, get_pixel(x, y) )
end
end
end
end
module Math def self.mDistance(x1, y1, z1, x2, y2, z2) (x1 - x2).abs + (y1 - y2).abs + (z1 - z2).abs end end class Color def difference(other_color) (Math.mDistance3D(self.red, self.green, self.blue, other_color.red, other_color.green, other_color.blue) + self.alpha - other_color.alpha) / 4 end end
module Math
def self.mDistance(x1, y1, z1, x2, y2, z2)
(x1 - x2).abs + (y1 - y2).abs + (z1 - z2).abs
end
end
class Color
def difference(other_color)
(Math.mDistance3D(self.red, self.green, self.blue,
other_color.red, other_color.green, other_color.blue) +
self.alpha - other_color.alpha) / 4
end
end
Cache = RPG::Cache Sprite = RPG::Sprite def rgss_stop loop{ Graphics.update } end
Cache = RPG::Cache
Sprite = RPG::Sprite
def rgss_stop
loop{ Graphics.update }
end
para_back.png
para_item.png
Take 1
Take 2
Take 3
|