My character jump off the screen and suddenly the visibility range gone just for a moment. At first I thought it was the glitch from the script itself, but I then I tried to reproduce the error and I succeed
The glitch is, when you have a sprite and a tilemap which has same viewport, if the sprite the value Y has less than zero, the sprite will gone completely. I can not easily noticable since you already know that most of Sprite_Character has the oy at the bottom of the sprite.
If you want to test, here is the test code I made
Spoiler
class Sprite_Test < Sprite def initialize(v) super(v) self.bitmap = Bitmap.new(450,450) bitmap.fill_rect(bitmap.rect, Color.new(0,0,0,120)) rect = Rect.new(width/2 - 100, height/2 - 100, 200, 200) bitmap.fill_rect(rect, Color.new(255,255,255,120)) self.ox = width/2 self.oy = height/2 self.x = Graphics.width/2 self.y = Graphics.height/2#~ self.zoom_x = self.zoom_y = 2.5 end def update super case Input.dir4 when 2 self.y += 5 when 4 self.x -= 5 when 6 self.x += 5 when 8 self.y -= 5 end end endDataManager.initdef updates Graphics.update Input.update @vport.update @vport2.update @spr.update @tile.updateend@vport = Viewport.new@vport2 = Viewport.new@vport.z = 50@spr = Sprite_Test.new(@vport)map = load_data(sprintf("Data/Map%03d.rvdata2", 1))@tile = Tilemap.new(@vport)@tile.map_data = map.data$data_tilesets[2].tileset_names.each_with_index do |name, i| @tile.bitmaps = Cache.tileset(name)endupdates while true
Is anyone aware of this?
To overcome this problem might simply assign a different viewport for the sprite, but it's not a neat solusion I guess. I hope the next generation of RGSS will fix the tilemap class better.
Thought?