Icedmetal57
Member
I was working on a script for someone and needed to know how to change the zoom for an image, so basically change it's resolution. I've tried creating a sprite like so...
That didn't work. Then I tried calling it within the scene that this window was being displayed on instead of in the window, but for some reason it wasn't working, and I've done it before in other scenes but it didn't work this time. I know for a fact that it isn't the image because I could set it up in the window like so...
But, I want to get a zoom effect on it, or basically just lower it's resolution, because I don't want to have more than one of the same image, but smaller in my pictures folder. Any ideas as to how I can shrink an image?
Code:
def refresh
self.contents.clear
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.picture('test')
@sprite.zoom_x = 0.5
@sprite.zoom_y = 0.5
end
def dispose
super
@sprite.dispose
@sprite.bitmap.dispose
end
That didn't work. Then I tried calling it within the scene that this window was being displayed on instead of in the window, but for some reason it wasn't working, and I've done it before in other scenes but it didn't work this time. I know for a fact that it isn't the image because I could set it up in the window like so...
Code:
def refresh
self.contents.clear
test = RPG::Cache.picture('test')
w = test.width + 4
h = test.height + 4
src_rect = Rect.new(0, 0, w, h)
self.contents.blt(0, 8, test, src_rect)
end