Project1

标题: 关于分辨率修改之后 战斗画面怪物位置的问题 [打印本页]

作者: 優しの東ちゃん    时间: 2017-1-10 21:57
标题: 关于分辨率修改之后 战斗画面怪物位置的问题
如标题
我把分辨率修改成 1024 x 768了   可是战斗画面的怪物只能在原来的左上角位置   战斗画面的大小没有改变
求大神帮帮忙~
作者: RaidenInfinity    时间: 2017-1-10 22:13
RUBY 代码复制
  1. =begin
  2. ================================================================================
  3.  Title: Battle Sprite Auto-position
  4.  Author: Hime
  5.  Date: Dec 19, 2014
  6. --------------------------------------------------------------------------------
  7.  ** Change log
  8.  Dec 19, 2014
  9.    - Use ratios to adjust the resolutions rather than offsetting by the
  10.      difference between resolutions
  11.  May 6, 2012
  12.    -Initial release
  13. --------------------------------------------------------------------------------
  14.  ** Terms of Use
  15.  * Free to use in non-commercial projects
  16.  * Contact me for commercial use
  17.  * No real support. The script is provided as-is
  18.  * Will do bug fixes, but no compatibility patches
  19.  * Features may be requested but no guarantees, especially if it is non-trivial
  20.  * Credits to Hime Works in your project
  21.  * Preserve this header
  22. --------------------------------------------------------------------------------
  23.  ** Description
  24.  
  25.  This script adjusts the position that the battle sprites are drawn
  26.  relative to the game screen size. This allows you to set your enemy
  27.  positions in the troop editor without having to consider the size of
  28.  your window (544x416 default vs sizes)
  29.  
  30. --------------------------------------------------------------------------------
  31.  ** Installation
  32.  
  33.  In the script editor, place this script below Materials and above Main
  34.  
  35. --------------------------------------------------------------------------------
  36.  ** Usage
  37.  
  38.  Plug-n-play
  39.  
  40. ==============================================================================
  41. =end
  42. $imported = {} if $imported.nil?
  43. $imported[:TH_BattleSpriteAutoPosition] = true
  44. #===============================================================================
  45. # ** Rest of the Script
  46. #===============================================================================
  47. class Game_Troop < Game_Unit
  48.  
  49.   #--------------------------------------------------------------------------
  50.   # alias method
  51.   #--------------------------------------------------------------------------
  52.   alias :th_sprite_autopos_setup :setup
  53.   def setup(troop_id)
  54.     th_sprite_autopos_setup(troop_id)
  55.     adjust_coords
  56.   end
  57.  
  58.   #--------------------------------------------------------------------------
  59.   # new method: adjust enemy battler coords
  60.   #--------------------------------------------------------------------------
  61.   def adjust_coords
  62.     adjust_x = Graphics.width / 544.0
  63.     adjust_y = Graphics.height / 416.0
  64.     @enemies.each do |enemy|
  65.       enemy.screen_x *= adjust_x
  66.       enemy.screen_y *= adjust_y
  67.     end
  68.   end
  69. end

安装此插件脚本:HimeWorks的”战斗图位置自动调整“

运作原理是在在决定战斗图屏幕位置的地方加入处理,对坐标乘上(当前屏幕大小 除于 默认屏幕大小)的比例。
作者: 優しの東ちゃん    时间: 2017-1-10 22:22
RaidenInfinity 发表于 2017-1-10 22:13
=begin
================================================================================
Title: Bat ...

哇~感谢大神!
作者: VIPArcher    时间: 2017-1-11 00:48
5行脚本就能解决,这个帖子里搜索5 “敌人战斗坐标修正”
https://rpg.blue/thread-378738-1-1.html
作者: 優しの東ちゃん    时间: 2017-1-11 08:40
VIPArcher 发表于 2017-1-11 00:48
5行脚本就能解决,这个帖子里搜索5 “敌人战斗坐标修正”
https://rpg.blue/thread-378738-1-1.html ...

感谢大神~
里面还有好多其他有用的东西~





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1