I'm a total beginner with RGSS, what I'm trying to do is I have an image displayed that is really big, but you can only see some of it in the viewport. I want to make it where when you hold UP on your keyboard, the part of the image that you see in the viewport will go up, basically like pressing up will scroll the image up. this is done in a menu. here is what I have as my window
This part is my (failed) attempt at doing what I want it to do, I don't know if I'm even on the right track or where it should really go, i Just kind of guessed.
if Input.repeat?(Input::UP)
@view.ox = @view.ox + 100
end
class Window_Image < Window_Base
def initialize
super(10, 10, 620, 460)
self.contents = Bitmap.new(width - 32, height - 32)
@map = RPG::Cache.picture("image.png")
@rect = Rect.new(20, 20, 600, 440)
@view = Viewport.new(@rect)
@sprite = Sprite.new(@view)
@sprite.z = 0
@sprite.bitmap = @map
@view.z = 5001
@view.oy = 2000
@view.ox = 1500
refresh
end
def refresh
if Input.repeat?(Input::UP)
@view.ox = @view.ox + 100
end
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = 20
end
end
def initialize
super(10, 10, 620, 460)
self.contents = Bitmap.new(width - 32, height - 32)
@map = RPG::Cache.picture("image.png")
@rect = Rect.new(20, 20, 600, 440)
@view = Viewport.new(@rect)
@sprite = Sprite.new(@view)
@sprite.z = 0
@sprite.bitmap = @map
@view.z = 5001
@view.oy = 2000
@view.ox = 1500
refresh
end
def refresh
if Input.repeat?(Input::UP)
@view.ox = @view.ox + 100
end
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = 20
end
end
This part is my (failed) attempt at doing what I want it to do, I don't know if I'm even on the right track or where it should really go, i Just kind of guessed.
if Input.repeat?(Input::UP)
@view.ox = @view.ox + 100
end