加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
x
 
我想做一個角色的血量條, 但我在做的時候出了一個的問題. 
 
即使我知道長度是這樣子: 
 
@actor_hp = $game_variables[2] #角色當前HP @actor_mhp = $game_variables[22] #角色最大HP @slot_width = (@actor_hp-@actor_mhp)/@actor_mhp 
 
 @actor_hp = $game_variables[2]  
#角色當前HP  
@actor_mhp = $game_variables[22]  
#角色最大HP  
@slot_width = (@actor_hp-@actor_mhp)/@actor_mhp  
 
  
 
但是, 我後來在設置新建圖像時不知如何去用Bitmap中的那個width函數, 那段腳本是這樣子的: 
#--------------------------------------------------------------------------- #新建圖像:hp_slot #---------------------------------------------------------------------------     $hp_slot = Sprite.new     $hp_slot.bitmap = Bitmap.new("Graphics/Pictures/hp.png")     #新增一個Sprite的實例       $hp_slot.bitmap.width=Bitmap.width($hp_slot.bitmap,@slot_width) 
 
 #---------------------------------------------------------------------------  
#新建圖像:hp_slot  
#---------------------------------------------------------------------------  
    $hp_slot = Sprite.new  
    $hp_slot.bitmap = Bitmap.new("Graphics/Pictures/hp.png")  
    #新增一個Sprite的實例  
   
    $hp_slot.bitmap.width=Bitmap.width($hp_slot.bitmap,@slot_width)  
 
  
 
他一直說我少了參數...到底參數要放在那裡...? |