| 赞 | 0  | 
 
| VIP | 0 | 
 
| 好人卡 | 0 | 
 
| 积分 | 1 | 
 
| 经验 | 26568 | 
 
| 最后登录 | 2019-11-8 | 
 
| 在线时间 | 36 小时 | 
 
 
 
 
 
Lv1.梦旅人 
	- 梦石
 - 0 
 
        - 星屑
 - 72 
 
        - 在线时间
 - 36 小时
 
        - 注册时间
 - 2008-5-19
 
        - 帖子
 - 186
 
 
 
 | 
	
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
x
 
如何让宠物的图片自适应大小放在这个固定尺寸的框里?不要拉长变形,保持原图的比例,如果战斗图长宽比例对不上就以比较长的一边充满框体 
 
宠物系统ver1.2 
http://rpg.blue/web/htm/news169.htm 
![]()  
 
 
以下好像是描绘宠物战斗图的脚本部分 
#============================================================================== 
# ■ Window_Base 
#------------------------------------------------------------------------------ 
#  游戏中全部窗口的超级类。 
#============================================================================== 
class Window_Base < Window 
  ############################################################################# 
  def draw_actor_pet(actor, x, y)#——绘制宠物图形 
    if actor.pet_id != 0 
      src_bitmap = RPG::Cache.battler($data_enemies[actor.pet_id].battler_name, $data_enemies[actor.pet_id].battler_hue)            
      cw = src_bitmap.width 
      ch = src_bitmap.height 
      src_rect = Rect.new(0, 0, cw*1.8, ch*1.8) 
      dest_rect = Rect.new(450, 250, src_bitmap.width, src_bitmap.height) 
      self.contents.stretch_blt(dest_rect, src_bitmap, src_rect)  
    end 
  end 
  ###################################### |   
 
 
 
 |