| 
 
| 赞 | 274 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 153 |  
| 经验 | 515 |  
| 最后登录 | 2025-10-8 |  
| 在线时间 | 2108 小时 |  
 Lv4.逐梦者 
	梦石1 星屑14293 在线时间2108 小时注册时间2017-9-28帖子663 | 
| 44 
 复制代码##------
## 显示舍入错误修正 by Neon Black
##
## 当减缓游戏显示速度时,我们就会发现事件移动时会偏离正确位置1像素,虽然很细微
## 但是也会导致事件图像在画面放大时看起来鬼畜地抖动,这是因为脚本错误的四舍五入。
## 此脚本修正了此错误。  
##
## 该脚本可以免费用于任何工程.
##
## -- 原始话题帖子:
## http://forums.rpgmakerweb.com/index.php?/topic/17448-event-jitter-fix-display-rounding-error-fix
##------
class Game_Map ## Rounds X and Y display values DOWN so the nearest 32 is found.
  def display_x
    (@display_x * 32).floor.to_f / 32
  end
  
  def display_y
    (@display_y * 32).floor.to_f / 32
  end
  
  def adjust_x(x)
    if loop_horizontal? && x < display_x - (width - screen_tile_x) / 2
      x - display_x + @map.width
    else
      x - display_x
    end
  end
  
  def adjust_y(y)
    if loop_vertical? && y < display_y - (height - screen_tile_y) / 2
      y - display_y + @map.height
    else
      y - display_y
    end
  end
end
 | 
 评分
查看全部评分
 |