battle sprites resize

This commit is contained in:
infinitefusion
2021-07-15 10:46:13 -04:00
parent abfad12b0a
commit 17c136e050
4 changed files with 30 additions and 12 deletions

View File

@@ -18,15 +18,6 @@ class AnimatedBitmap
end
end
# def initialize(file,hue=0)
# raise "filename is nil" if file==nil
# if file[/^\[(\d+)\]/]
# @bitmap=PngAnimatedBitmap.new(file,hue)
# else
# @bitmap=GifBitmap.new(file,hue)
# end
# end
def pbSetColor(r = 0, g = 0, b = 0, a = 255)
for i in 0..@bitmap.bitmap.width
for j in 0..@bitmap.bitmap.height
@@ -90,6 +81,22 @@ class AnimatedBitmap
@bitmap.copy;
end
def scale_bitmap(scale)
return if scale == 1
new_width = @bitmap.bitmap.width * scale
new_height = @bitmap.bitmap.height * scale
destination_rect = Rect.new(0, 0, new_width, new_height)
source_rect = Rect.new(0, 0, @bitmap.bitmap.width, @bitmap.bitmap.height)
new_bitmap = Bitmap.new(new_width,new_height)
new_bitmap.stretch_blt(
destination_rect,
@bitmap.bitmap,
source_rect
)
@bitmap.bitmap = new_bitmap
end
def mirror
for x in 0..@bitmap.bitmap.width / 2
for y in 0..@bitmap.bitmap.height - 2