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

Project1

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

[已经解决] 脚本盲询问这个脚本怎么看的

[复制链接]

Lv1.梦旅人

梦石
0
星屑
65
在线时间
77 小时
注册时间
2015-6-18
帖子
32
跳转到指定楼层
1
发表于 2017-8-8 20:12:37 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 渣小废 于 2017-8-8 20:36 编辑

这是在66其他贴上找到的动态大图标的。想要这种非窗口式的弹出图片来。
把刷新速度变为0倒是可以做到伪静态。
但上自己的图片显示会不完全。
有没有大佬能解释下大概是怎么一个回事?如果刷新速度为0什么样的图片大小和格式才能合适?
怎样才能让我在想要的位置显示出自己想要大小的图片啊。



#==============================================================================

WALK_REFRESH_FRAME_SPEED = 0  # 刷新的速度,越大越慢,你可以改为3左右试试看

#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # 初始化方法
  #--------------------------------------------------------------------------
  alias initialize_walk initialize
  def initialize(x, y, width, height)
    initialize_walk(x, y, width, height)
    @start_walk = false
    @turn_index = 0
    @turn_phase = 0
  end
  #--------------------------------------------------------------------------
  # ★  物品动态图
  #     item : 物品
  #     x     : 描绘的 X 坐标
  #     y     : 描绘的 Y 坐标
  #--------------------------------------------------------------------------
  def draw_walk_item_graphic(item, x, y)
    iconname = item.name
    bitmap=RPG::Cache.icon("#{iconname}")
    cw = bitmap.width
    ch = bitmap.height
    @t = bitmap.width/bitmap.height
    @start_turn = true
    case @turn_phase
    when 0
      x_x = 0
    when 1
      x_x = cw
    when 2
      x_x = cw * 2
    when 3
      x_x = cw * 3
      when 4
      x_x = cw * 4
      when 5
      x_x = cw * 5
      when 6
      x_x = cw * 6
      when 7
      x_x = cw * 7
      when 8
      x_x = cw * 8
      when 9
      x_x = cw * 9
      when 10
      x_x = cw * 10
      when 11
      x_x = cw * 11
      when 12
      x_x = cw * 12
      when 13
      x_x = cw * 13
       when 14
      x_x = cw * 14
       when 15
      x_x = cw * 15
       when 16
      x_x = cw * 16
       when 17
      x_x = cw * 17
       when 18
      x_x = cw * 18
       when 19
      x_x = cw * 19
      when 20
      x_x = cw * 20
      when 21
      x_x = cw * 21
      when 22
      x_x = cw * 22
      when 23
      x_x = cw * 23
      when 24
      x_x = cw * 24
      when 25
      x_x = cw * 25
      when 26
      x_x = cw * 26
      when 27
      x_x = cw * 27
      when 28
      x_x = cw * 28
      when 29
      x_x = cw * 29
      when 30
      x_x = cw * 30
    end
    src_rect = Rect.new(x_x, 0, cw, ch)
    self.contents.blt(x - cw / 4, y - ch, bitmap, src_rect)
  end
  #--------------------------------------------------------------------------
  #  更新(可别使用刷新,玩命耗费内存= =)
  #--------------------------------------------------------------------------
  alias walk_update update
  def update
    walk_update
    if @start_turn == true
      @turn_index += 1
      if @turn_index == WALK_REFRESH_FRAME_SPEED
        refresh
        @turn_index = 0
        @turn_phase = (@turn_phase+1)%@t
      end
    end
  end  
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================



#==============================================================================
# ■ Window_Gold
#------------------------------------------------------------------------------
#  显示金钱的窗口。
#==============================================================================

class Window_itemicon < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize
    super(500, 64, 640, 480)
    @item = nil
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    update
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @item != nil
      self.draw_walk_item_graphic(@item, 200,200)
    end
  end
  def set_item(item)
    @item = item
  end
end

Lv5.捕梦者

梦石
0
星屑
36124
在线时间
10712 小时
注册时间
2009-3-15
帖子
4806
2
发表于 2017-8-8 20:33:49 | 只看该作者
因为图标尺寸有限制?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
65
在线时间
77 小时
注册时间
2015-6-18
帖子
32
3
 楼主| 发表于 2017-8-8 20:40:03 | 只看该作者
嗯尺寸问题。沉了自己已经解决。以后还是想久点再发帖
回复 支持 1 反对 0

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 20:54

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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