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

Project1

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

[已经解决] 请帮忙修改个坐标,谢谢

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
439 小时
注册时间
2013-3-2
帖子
710
跳转到指定楼层
1
发表于 2013-12-22 00:22:17 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
不知道怎么改了
我想把它放在图片红圈的位置
请帮帮忙
@myownroc @芯☆淡茹水 @天地有正气 @美丽晨露




脚本附上
  1. #==========================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==========================================================================
  4. #蜂蜜蚂蚁略有修改
  5. #个人水平有限若有错误之处,还请指出或联系蜂蜜蚂蚁 谢谢

  6. module Momo_IconCommand
  7.   # 图标名称设定
  8.   ATTACK_ICON_NAME = "攻击" # 攻撃
  9.   SKILL_ICON_NAME = "特技"   # 特技
  10.   GUARD_ICON_NAME = "防御"  # 防御
  11.   ITEM_ICON_NAME = "物品"     # 物品
  12.    
  13.   # X坐标修正
  14.   X_PLUS = -320
  15.   # Y坐标修正
  16.   Y_PLUS = -100
  17.   # 选择时图标的动作
  18.   # 0:静止 1:放大
  19.   SELECT_TYPE = 0
  20.   # 闪烁时光芒的颜色
  21.   FLASH_COLOR = Color.new(236, 251, 4, 100)
  22.   # 闪烁时间
  23.   FLASH_DURATION = 10
  24.   # 闪烁间隔
  25.   FLASH_INTERVAL = 20
  26.   # 是否写出文字的名称
  27.   COM_NAME_DROW = true#false#
  28.   # 文字名称是否移动
  29.   COM_NAME_MOVE = false#true
  30.   # 文字内容
  31.   ATTACK_NAME = "攻击"    # 攻击
  32.   SKILL_NAME = "奇术"   # 特技
  33.   GUARD_NAME = "防御"     # 防御
  34.   ITEM_NAME = "物品"  # 物品
  35.   #PAO_NAME = "逃跑"  # 物品
  36.   # 文字颜色
  37.   COM_NAME_COLOR = Color.new(255, 255, 255, 255)
  38.   # 文字坐标修正
  39.   COM_NAME_X_PLUS = 0
  40.   COM_NAME_Y_PLUS = 0
  41. end

  42. class Window_CommandIcon < Window_Selectable
  43.   attr_accessor :last_index
  44.   #------------------------------------------------------------------------
  45.   # ● オブジェクト初期化
  46.   #------------------------------------------------------------------------
  47.   def initialize(x, y, commands)
  48.     super(x, y, 32, 32)
  49.     # ウィンドウスキンに空文字列を指定してウィンドウを描画しないようにする
  50.     self.windowskin = RPG::Cache.windowskin("")
  51.     @item_max = commands.size
  52.     @commands = commands
  53.    
  54.     @column_max = 1
  55.     @index_max = 0
  56.     @last_index = nil
  57.     @name_sprite = nil
  58.     [url=home.php?mod=space&uid=114926]@sprite[/url] = []
  59.    
  60.    
  61.     refresh
  62.   end
  63.   def dispose
  64.     super
  65.     for sprite in @sprite
  66.       sprite.dispose unless sprite.nil?
  67.     end
  68.      
  69.    
  70.     @name_sprite.dispose unless @name_sprite.nil?

  71.   
  72.   end
  73.   #------------------------------------------------------------------------
  74.   # ● リフレッシュ
  75.   #------------------------------------------------------------------------
  76.   def refresh

  77.     @name_sprite.dispose unless @name_sprite.nil?

  78.   
  79.     for sprite in @sprite
  80.       sprite.dispose unless sprite.nil?
  81.     end
  82.     @name_sprite = nil
  83.     draw_com_name if Momo_IconCommand::COM_NAME_DROW
  84.     @sprite = []

  85.     for i in 0...@item_max
  86.       draw_item(i)
  87.     end
  88.   end
  89.   #------------------------------------------------------------------------
  90.   # ● 項目の描画
  91.   #------------------------------------------------------------------------
  92.   def draw_item(index)
  93.     @sprite[index] = Sprite_Icon.new(nil, @commands[index])
  94.     @sprite[index].z = self.z + 1
  95.   end
  96.   def draw_com_name
  97.     @name_sprite = Sprite_Comm_Name.new(nil, get_com_name)
  98.   end
  99.   
  100.   # 更新
  101.   def update
  102.     super
  103.     icon_update
  104.     com_name_update if Momo_IconCommand::COM_NAME_DROW
  105.   #  if move_index?
  106.   if self.active
  107.     # 判断当前光标位置
  108.     case @last_index
  109.      when 0 # 攻击
  110.       # 方向键下被按下的情况下
  111.       if Input.repeat?(Input::DOWN)
  112.           # 光标指向物品
  113.           $game_system.se_play($data_system.cursor_se)
  114.           [url=home.php?mod=space&uid=370741]@Index[/url] = 3      
  115.       end
  116.       # 方向键上被按下的情况下
  117.       if Input.repeat?(Input::UP)
  118.         # 光标指向攻击
  119.           $game_system.se_play($data_system.cursor_se)
  120.           @index = 3      
  121.       end
  122.       # 方向键右被按下的情况下
  123.       if Input.repeat?(Input::RIGHT)
  124.           # 光标指向防御
  125.           $game_system.se_play($data_system.cursor_se)
  126.           @index = 2      
  127.       end
  128.       # 方向键左被按下的情况下
  129.       if Input.repeat?(Input::LEFT)
  130.         # 光标指向法术
  131.           $game_system.se_play($data_system.cursor_se)
  132.           @index = 1
  133.       end
  134.      when 1 # 法术
  135.       # 方向键下被按下的情况下
  136.       if Input.repeat?(Input::DOWN)
  137.           # 光标指向物品
  138.           $game_system.se_play($data_system.cursor_se)
  139.           @index = 3      
  140.       end
  141.       # 方向键上被按下的情况下
  142.       if Input.repeat?(Input::UP)
  143.         # 光标指向攻击
  144.           $game_system.se_play($data_system.cursor_se)
  145.           @index = 0      
  146.       end
  147.       # 方向键右被按下的情况下
  148.       if Input.repeat?(Input::RIGHT)
  149.           # 光标指向防御
  150.           $game_system.se_play($data_system.cursor_se)
  151.           @index = 2      
  152.       end
  153.       # 方向键左被按下的情况下
  154.       if Input.repeat?(Input::LEFT)
  155.         # 光标指向法术
  156.           $game_system.se_play($data_system.cursor_se)
  157.           @index = 2
  158.       end
  159.      when 2 # 防御
  160.       # 方向键下被按下的情况下
  161.       if Input.repeat?(Input::DOWN)
  162.           # 光标指向物品
  163.           $game_system.se_play($data_system.cursor_se)
  164.           @index = 3      
  165.       end
  166.       # 方向键上被按下的情况下
  167.       if Input.repeat?(Input::UP)
  168.         # 光标指向攻击
  169.           $game_system.se_play($data_system.cursor_se)
  170.           @index = 0      
  171.       end
  172.       # 方向键右被按下的情况下
  173.       if Input.repeat?(Input::RIGHT)
  174.           # 光标指向防御
  175.           $game_system.se_play($data_system.cursor_se)
  176.           @index = 1      
  177.       end
  178.       # 方向键左被按下的情况下
  179.       if Input.repeat?(Input::LEFT)
  180.         # 光标指向技能
  181.           $game_system.se_play($data_system.cursor_se)
  182.           @index = 1
  183.       end
  184.      when 3 # 物品
  185.       # 方向键下被按下的情况下
  186.       if Input.repeat?(Input::DOWN)
  187.           # 光标指向物品
  188.           $game_system.se_play($data_system.cursor_se)
  189.           @index = 0      
  190.       end
  191.       # 方向键上被按下的情况下
  192.       if Input.repeat?(Input::UP)
  193.         # 光标指向攻击
  194.           $game_system.se_play($data_system.cursor_se)
  195.           @index = 0      
  196.       end
  197.       # 方向键右被按下的情况下
  198.       if Input.repeat?(Input::RIGHT)
  199.           # 光标指向防御
  200.           $game_system.se_play($data_system.cursor_se)
  201.           @index = 2      
  202.       end
  203.       # 方向键左被按下的情况下
  204.       if Input.repeat?(Input::LEFT)
  205.         # 光标指向法术
  206.           $game_system.se_play($data_system.cursor_se)
  207.           @index = 1
  208.       end
  209. #     when 4 # 逃跑
  210. #      # 方向键下被按下的情况下
  211. #      if Input.repeat?(Input::DOWN)
  212. #          # 光标指向攻击
  213. #         $game_system.se_play($data_system.cursor_se)
  214. #          @index = 0      
  215. #      end
  216. #      # 方向键上被按下的情况下
  217. #      if Input.repeat?(Input::UP)
  218. #        # 光标指向逃跑
  219. #          $game_system.se_play($data_system.cursor_se)
  220. #          @index = 4      
  221. #      end
  222. #      # 方向键右被按下的情况下
  223. #      if Input.repeat?(Input::RIGHT)
  224. #          # 光标指向防御
  225. #          $game_system.se_play($data_system.cursor_se)
  226. #          @index = 2      
  227. #      end
  228. #      # 方向键左被按下的情况下
  229. #      if Input.repeat?(Input::LEFT)
  230.         # 光标指向法术
  231. #          $game_system.se_play($data_system.cursor_se)
  232. #          @index = 1
  233. #      end
  234.     end      
  235.       @last_index = self.index
  236.    end
  237.   end

  238.   # アイコンの更新
  239.   def icon_update
  240.     qx = 20
  241.     qy = 500
  242.     for i in [email protected]
  243.       @sprite[i].active = (self.index == i)
  244.       @sprite[0].x = 300 +qx
  245.       @sprite[0].y = -140 +qy
  246.       @sprite[1].x = 260 + qx
  247.       @sprite[1].y = -100 + qy
  248.       @sprite[3].x = 300 + qx
  249.       @sprite[3].y = -60 + qy
  250.       @sprite[2].x = 340 + qx
  251.       @sprite[2].y = -100 + qy
  252.       #@sprite[i].x = self.x + i * 56
  253.       #@sprite[i].y = self.y + 0
  254.       @sprite[i].z = (self.index == i) ? self.z + 2 : self.z + 1
  255.       @sprite[i].visible = self.visible
  256.       @sprite[i].update
  257.     end
  258.   end
  259.   # コマンドネームの更新

  260.   
  261.   def com_name_update
  262. #    if move_index?
  263.       @name_sprite.name = get_com_name
  264. #   end



  265.   #- 12 + Momo_IconCommand::COM_NAME_X_PLUS
  266. #  @name_sprite.x = 510 #actor_index - 1
  267. # elsif @active_battler.id == 5
  268. # @name_sprite.x = 410 #320 + self.x - 12 #+ Momo_IconCommand::COM_NAME_X_PLUS
  269.   
  270. # else
  271. #  @name_sprite[actor_index].x = 110
  272.    
  273. if self.x<100#80
  274.     @name_sprite.x =  self.x + 275
  275.   elsif self.x < 200#150
  276.     @name_sprite.x = self.x + 279
  277.     else self.x < 300#220
  278.     @name_sprite.x = self.x + 282
  279.       end

  280.    if self.y<200#190
  281.     @name_sprite.y =  145
  282.   elsif self.y < 300#250
  283.     @name_sprite.y = 210
  284.     else self.y < 400#320
  285.     @name_sprite.y= 295
  286.       end
  287.    
  288.    
  289. # 文字出现的坐标 以固定在下面

  290.     #+ Momo_IconCommand::COM_NAME_Y_PLUS
  291.     @name_sprite.z = 9998 #self.z + 1
  292.     @name_sprite.active = self.active
  293.     @name_sprite.visible = self.visible
  294.     @name_sprite.update
  295. end
  296.   def get_com_name
  297.     make_name_set if @name_set.nil?
  298.     name = @name_set[self.index]   
  299.     name = "" if name.nil?
  300.     return name
  301.   end
  302.   def make_name_set
  303.     @name_set = []
  304.     @name_set[0] = Momo_IconCommand::ATTACK_NAME
  305.     @name_set[1] = Momo_IconCommand::SKILL_NAME
  306.     @name_set[2] = Momo_IconCommand::GUARD_NAME
  307.     @name_set[3] = Momo_IconCommand::ITEM_NAME
  308.     #@name_set[4] = Momo_IconCommand::ESCAPE_NAME
  309.   end
  310.   def move_index?
  311.     return self.index != @last_index
  312.   end
  313.   def need_reset
  314.     @name_sprite.need_reset = true if Momo_IconCommand::COM_NAME_DROW
  315.   end
  316. end

  317. # アイコン用スプライト
  318. class Sprite_Icon < Sprite
  319.   attr_accessor :active
  320.   attr_accessor :icon_name
  321.   #------------------------------------------------------------------------
  322.   # ● オブジェクト初期化
  323.   #------------------------------------------------------------------------
  324.   def initialize(viewport, icon_name)
  325.     super(viewport)
  326.     @icon_name = icon_name
  327.     @last_icon = @icon_name
  328.     @count = 0
  329.     self.bitmap = RPG::Cache.icon(@icon_name)
  330.     self.ox = self.bitmap.width / 2
  331.     self.oy = self.bitmap.height / 2
  332.     @active = false
  333.   end
  334.   #------------------------------------------------------------------------
  335.   # ● 解放
  336.   #------------------------------------------------------------------------
  337.   def dispose
  338.     if self.bitmap != nil
  339.       self.bitmap.dispose
  340.     end
  341.     super
  342.   end
  343.   #------------------------------------------------------------------------
  344.   # ● フレーム更新
  345.   #------------------------------------------------------------------------
  346.   def update
  347.     super
  348.     if @icon_name != @last_icon
  349.       @last_icon = @icon_name
  350.       self.bitmap = RPG::Cache.icon(@icon_name)
  351.     end
  352.     if @active
  353.       @count += 1
  354.       case Momo_IconCommand::SELECT_TYPE
  355.       when 0
  356.         icon_flash
  357.          icon_zoom
  358.       when 1
  359.         icon_zoom
  360.       end
  361.       @count = 0 if @count == 20
  362.     else
  363.       icon_reset
  364.     end
  365.   end
  366.   def icon_flash
  367.     if @count % Momo_IconCommand::FLASH_INTERVAL == 0 or @count == 2
  368.       self.flash(Momo_IconCommand::FLASH_COLOR, Momo_IconCommand::FLASH_DURATION)
  369.     end
  370.   end
  371.   def icon_zoom
  372.     case @count
  373.     when 1..10
  374.       zoom = 1.1#0 + @count / 10.0
  375.     when 11..20
  376.       zoom = 1.1#2.0 - (@count - 10) / 10.0
  377.     end
  378.     self.zoom_x = zoom
  379.     self.zoom_y = zoom
  380.   end
  381.   def icon_reset
  382.     @count = 0
  383.     self.zoom_x = 1.0
  384.     self.zoom_y = 1.0
  385.   end
  386. end

  387. # コマンドネーム用スプライト
  388. class Sprite_Comm_Name < Sprite
  389.   attr_accessor :active
  390.   attr_accessor :name
  391.   attr_accessor :need_reset
  392.   #------------------------------------------------------------------------
  393.   # ● オブジェクト初期化
  394.   #------------------------------------------------------------------------
  395.   def initialize(viewport, name)
  396.     super(viewport)
  397.     @name = name
  398.     @last_name = nil
  399.     @count = 0
  400.     @x_plus = 0
  401.     @opa_plus = 0
  402.     @need_reset = false
  403.     @active = false
  404.      
  405.     self.bitmap = Bitmap.new(125, 32)
  406.   end
  407.   #------------------------------------------------------------------------
  408.   # ● 解放
  409.   #------------------------------------------------------------------------
  410.   def dispose
  411.     if self.bitmap != nil
  412.       self.bitmap.dispose
  413.     end
  414.     super
  415.   end

  416.   #------------------------------------------------------------------------
  417.   # ● フレーム更新
  418.   #------------------------------------------------------------------------
  419.   def update
  420.     super
  421.     if @active
  422.       if need_reset?
  423.         @need_reset = false
  424.         @last_name = @name
  425.         text_reset
  426.       end
  427.       move_text if Momo_IconCommand::COM_NAME_MOVE
  428.     end
  429.   end
  430.    def move_text
  431.     @count += 1
  432.     @x_plus = [@count * 8, 80].min
  433.     self.x = self.x - 80 + @x_plus
  434.     self.opacity = @count * 25
  435.   end
  436.   def text_reset
  437.     @count = 0
  438.     @x_plus = 0
  439.     self.bitmap.clear
  440.      src_rect = Rect.new(0, -5, 560, 128)
  441.       back_help = Bitmap.new("Graphics/system/menu/back/特技框.png")
  442.       self.bitmap.blt(0, -5, back_help, src_rect, 255)
  443.    
  444.     #定义蓝色(很PL 不是吗?) Momo_IconCommand::COM_NAME_COLOR
  445.       self.bitmap.font.size = 16
  446.       #文字的大小
  447.    
  448.    
  449.     case @name
  450.     when "攻击"
  451.    
  452.       self.bitmap.font.color = Color.new(255, 10, 10, 255)
  453.    
  454.   when "奇术"
  455.       self.bitmap.font.color = Color.new(255, 255, 0, 255)
  456.       
  457.    when "物品"
  458.       self.bitmap.font.color = Color.new(5, 255, 0, 255)
  459.      
  460.       when"防御"
  461.       self.bitmap.font.color = Color.new(5, 20, 255, 255)

  462.       end
  463.      self.bitmap.draw_text(25, 0, 260, 32, @name)
  464.   end
  465.   def need_reset?
  466.     return (@name != @last_name or @need_reset)
  467.   end
  468. end

  469. class Scene_Battle
  470.   #------------------------------------------------------------------------
  471.   # ● プレバトルフェーズ開始
  472.   #------------------------------------------------------------------------
  473.   alias scene_battle_icon_command_start_phase1 start_phase1
  474.   def start_phase1
  475.     com1 = Momo_IconCommand::ATTACK_ICON_NAME
  476.     com2 = Momo_IconCommand::SKILL_ICON_NAME
  477.     com3 = Momo_IconCommand::GUARD_ICON_NAME
  478.     com4 = Momo_IconCommand::ITEM_ICON_NAME
  479. #    com5 = Momo_IconCommand::ESCAPE_ICON_NAME
  480.     @actor_command_window = Window_CommandIcon.new(0, 0, [com1, com2, com3, com4])
  481.     @actor_command_window.y = 128
  482.     @actor_command_window.z = 200
  483.     @actor_command_window.back_opacity = 160
  484.     @actor_command_window.active = false
  485.     @actor_command_window.visible = false
  486.    
  487.     @actor_command_window.update

  488.    
  489.     scene_battle_icon_command_start_phase1
  490.   end
  491.   #------------------------------------------------------------------------
  492.   # ● アクターコマンドウィンドウのセットアップ
  493.   #------------------------------------------------------------------------
  494.   alias scene_battle_icon_command_phase3_setup_command_window phase3_setup_command_window
  495.   def phase3_setup_command_window
  496.     scene_battle_icon_command_phase3_setup_command_window
  497.     # アクターコマンドウィンドウの位置を設定
  498.     @actor_command_window.x = command_window_actor_x(@actor_index)
  499.     @actor_command_window.y = command_window_actor_y(@actor_index)
  500.     @actor_command_window.need_reset
  501.   
  502.   end
  503.   def command_window_actor_x(index)
  504.     $game_party.actors[index].screen_x + Momo_IconCommand::X_PLUS
  505.   end
  506.   def command_window_actor_y(index)
  507.     $game_party.actors[index].screen_y + Momo_IconCommand::Y_PLUS
  508.   end
  509. end
  510. #==========================================================================
  511. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  512. #==========================================================================
复制代码

   
【RMXP共享】50个脚本整合的系统

Lv3.寻梦者

梦石
0
星屑
3841
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
2
发表于 2013-12-22 03:29:23 | 只看该作者
修改脚本的15行和17行就可以调整坐标,这个我想是不用别人改的

点评

谢谢前辈的耐心指点,虽然246-260不是正确的,但我在下面的284-298那里摸索出来并修改成功了,谢谢  发表于 2013-12-23 12:35

评分

参与人数 2星屑 +110 收起 理由
myownroc + 90 认可答案
guoyq1988 + 20 认可答案,谢谢指点

查看全部评分

《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
439 小时
注册时间
2013-3-2
帖子
710
3
 楼主| 发表于 2013-12-22 07:57:54 手机端发表。 | 只看该作者
本帖最后由 guoyq1988 于 2013-12-22 12:43 编辑
紫英晓狼1130 发表于 2013-12-22 03:29
修改脚本的15行和17行就可以调整坐标,这个我想是不用别人改的


恩,我中午去修改试试(脚本盲,一直以为是修改456那几行)




补充



问题解决,谢谢小狼前辈指点

@myownroc


结贴
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
775
在线时间
924 小时
注册时间
2006-6-26
帖子
1529
4
发表于 2013-12-22 13:13:00 | 只看该作者
这脚本第60行又出错。又是那个URL 不懂怎么改。。


PS:楼主这素材是??哪儿来的?

点评

你的脚本出错,那是因为没有其他脚本支持,这个好像是有配套的脚本  发表于 2013-12-22 13:54
人物素材么?冒险岛纸娃娃自己做的  发表于 2013-12-22 13:54
我是不是可以签名了?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

进击的屌丝
中二同好会长

梦石
0
星屑
50
在线时间
628 小时
注册时间
2013-10-8
帖子
1246

贵宾

5
发表于 2013-12-22 13:16:31 | 只看该作者
在转移坐标的同时也要更改写着攻击的那个窗口的尺寸。

点评

能否详细指点下呢?  发表于 2013-12-22 13:55
吾乃不明事理之人,疯狂之人。


才怪咧,当时是怎么想到这么中二的句子233
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
775
在线时间
924 小时
注册时间
2006-6-26
帖子
1529
6
发表于 2013-12-22 16:50:18 | 只看该作者
那请楼主给我个完整脚本。

点评

请自己搜索(隋唐乱)我是从那里提出来,自己整合的  发表于 2013-12-22 19:12
不是解决了么……你在伸手么?  发表于 2013-12-22 19:01
我是不是可以签名了?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
439 小时
注册时间
2013-3-2
帖子
710
7
 楼主| 发表于 2013-12-22 22:19:48 | 只看该作者
紫英晓狼1130 发表于 2013-12-22 03:29
修改脚本的15行和17行就可以调整坐标,这个我想是不用别人改的

谢谢前辈指点,我更改了角色的X坐标,发现那个框框会出现移动,不知道能否让那个框框固定在一个位置
而不会随角色选择改变坐标

点评

应该是在246行到260行调  发表于 2013-12-23 06:34

   
【RMXP共享】50个脚本整合的系统
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-6-8 21:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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