| 赞 | 0  | 
 
| VIP | 0 | 
 
| 好人卡 | 0 | 
 
| 积分 | 10 | 
 
| 经验 | 0 | 
 
| 最后登录 | 2024-2-8 | 
 
| 在线时间 | 43 小时 | 
 
 
 
 
 
Lv3.寻梦者 
	- 梦石
 - 0 
 
        - 星屑
 - 1017 
 
        - 在线时间
 - 43 小时
 
        - 注册时间
 - 2020-10-28
 
        - 帖子
 - 25
 
 
 
 | 
	
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
x
 
萌新抄了一个战斗界面显示特技(就是属性)的窗口 
因为属性特别多,现在让这个窗口里的内容可以翻页,请问如何实现呢? 
谢谢 
以下是代码: 
class Window_Battle_Skill<Window_Selectable 
   def initialize 
       super(0,0,350,600) 
       self.contents=Bitmap.new(width-32,height-32) 
       
       self.visible=false 
       self.contents.font.size=17 
       refresh 
   end 
   def refresh  
       hangjianju=24   
       self.contents.font.size=17 
       self.contents.clear 
       if $skill_xuhao.size>0 
         y=0 
         for i in $skill_xuhao 
            
           name=$data_items[i].name 
           shuzu1=name.scan(/./)  
            
           unless $data_items[i].element_set.include?(150) 
                  shuzu2=$data_items[i].description.scan(/./) 
           else 
                  shuzu2=$game_variables[488][i].scan(/./) 
           end        
           x_initia=0   
           x_temp=0     
           self.contents.font.color=Color.new(32,255,79)   
           for j in 0...shuzu1.size 
              width_next=self.contents.text_size(shuzu1[j]).width  
              if x_temp+width_next>width-24 
                 y+=hangjianju    
                 x_temp=0   
              end    
              self.contents.draw_text(x_temp,y,width_next,24,shuzu1[j]) 
              x_temp+=width_next  
           end 
           y+=32 
           x_temp=0 
           self.contents.font.color=Color.new(255,255,255)  
           for j in 0...shuzu2.size 
              width_next=self.contents.text_size(shuzu2[j]).width  
              if x_temp+width_next>width-24 
                 y+=hangjianju    
                 x_temp=0   
              end    
              self.contents.draw_text(x_temp,y,width_next,24,shuzu2[j]) 
              x_temp+=width_next  
           end 
           y+=40 
        end 
      end 
       end 
      end 
 
 
 
 
 |   
 
 
 
 |