设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2746|回复: 6
打印 上一主题 下一主题

[已经解决] 求解!!人物像素图在左右移动时会迷之卡一下!?

[复制链接]

Lv4.逐梦者

梦石
1
星屑
14506
在线时间
2086 小时
注册时间
2017-9-28
帖子
662
1
发表于 2020-7-6 12:17:41 | 显示全部楼层
44
  1. ##------
  2. ## 显示舍入错误修正 by Neon Black
  3. ##
  4. ## 当减缓游戏显示速度时,我们就会发现事件移动时会偏离正确位置1像素,虽然很细微
  5. ## 但是也会导致事件图像在画面放大时看起来鬼畜地抖动,这是因为脚本错误的四舍五入。
  6. ## 此脚本修正了此错误。  
  7. ##
  8. ## 该脚本可以免费用于任何工程.
  9. ##
  10. ## -- 原始话题帖子:
  11. ## http://forums.rpgmakerweb.com/index.php?/topic/17448-event-jitter-fix-display-rounding-error-fix
  12. ##------
  13. class Game_Map ## Rounds X and Y display values DOWN so the nearest 32 is found.
  14.   def display_x
  15.     (@display_x * 32).floor.to_f / 32
  16.   end
  17.   
  18.   def display_y
  19.     (@display_y * 32).floor.to_f / 32
  20.   end
  21.   
  22.   def adjust_x(x)
  23.     if loop_horizontal? && x < display_x - (width - screen_tile_x) / 2
  24.       x - display_x + @map.width
  25.     else
  26.       x - display_x
  27.     end
  28.   end
  29.   
  30.   def adjust_y(y)
  31.     if loop_vertical? && y < display_y - (height - screen_tile_y) / 2
  32.       y - display_y + @map.height
  33.     else
  34.       y - display_y
  35.     end
  36.   end
  37. end
复制代码

评分

参与人数 1星屑 +100 收起 理由
VIPArcher + 100 认可答案

查看全部评分

VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-7 01:47

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表