Project1

标题: 关于脚本 [打印本页]

作者: Arche    时间: 2009-8-3 21:30
标题: 关于脚本
module RPG
  class Sprite < ::Sprite
RPG::Sprite
   def animation_set_sprites(sprites, cell_data, position)
      for i in 0..15
        sprite = sprites
        pattern = cell_data[i, 0]
        if sprite == nil or pattern == nil or pattern == -1
          sprite.visible = false if sprite != nil
          next
        end
        sprite.visible = true
        sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
        
          if position == 3
          if self.viewport != nil
            sprite.x = self.viewport.rect.width / 2
            sprite.y = self.viewport.rect.height - 160
          else
            sprite.x = 320
            sprite.y = 240
          end
        else
          sprite.x = self.x - self.ox + self.src_rect.width / 2
          sprite.y = self.y - self.oy + self.src_rect.height / 2
          sprite.y -= self.src_rect.height / 4 if position == 0
          sprite.y += self.src_rect.height / 4 if position == 2
        end
        sprite.x += cell_data[i, 1]
        sprite.y += cell_data[i, 2]
        sprite.z = 2000
        sprite.ox = 96
        sprite.oy = 96
        sprite.zoom_x = cell_data[i, 3] / 100.0
        sprite.zoom_y = cell_data[i, 3] / 100.0
        sprite.angle = cell_data[i, 4]
        sprite.mirror = (cell_data[i, 5] == 1)
        sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
        sprite.blend_type = cell_data[i, 7]
      end
    end

请问这一段是在哪里
Spriteset_Battle没有
Sprite_Battler没有
Sprite_Character也没有
作者: 蓝の星辰    时间: 2009-8-3 21:32
提示: 作者被禁止或删除 内容自动屏蔽
作者: Arche    时间: 2009-8-3 21:35
多谢,找到了
但是我想修改以下部分的坐标
if self.viewport != nil
            sprite.x = self.viewport.rect.width / 2
            sprite.y = self.viewport.rect.height - 160
          else
            sprite.x = 320
            sprite.y = 240

怎么改的?
作者: 白鬼    时间: 2009-8-3 21:39
你想改到多少,就直接修改数字呗。
作者: Arche    时间: 2009-8-3 21:43
按f1搜到的改不了
只能复制。。
作者: IamI    时间: 2009-8-4 08:20
复制下来,粘贴到脚本编辑器里,然后把数据改掉就行= =




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