| 
 
| 赞 | 2 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 28 |  
| 经验 | 11644 |  
| 最后登录 | 2025-10-31 |  
| 在线时间 | 654 小时 |  
 Lv3.寻梦者 
	梦石0 星屑2769 在线时间654 小时注册时间2012-5-3帖子107 
 | 
| 
本帖最后由 邱小谦 于 2016-3-29 19:29 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 此脚本效果已经实现,但是我不知道怎样释放窗口。比如我打开了A窗口,紧接着打开B窗口,再从B窗口点击技能打开仙灵店铺。但是,A、B两个窗口没有被释放掉,必须等待一段时间才能消失,很影响效果。。
 
 
 这是脚本:
 class Rw_Jn
 def initialize
 @index = 0
 @view = Viewport.new(20,0,451,465)
 @view.z = 9998
 @back2 = Sprite.new(@view)
 @back2.bitmap = RPG::Cache.picture("辅助技能框.png")
 @叉号 = Press.new("叉号",430,5,9998,@view)
 #描绘
 @actor = $game_party.actors[0]
 @data = []
 for i in [email protected]
 skill = $data_skills[@actor.skills]
 if skill != nil
 @data.push(skill)
 end
 end
 @sprite = Sprite.new(@view)
 @sprite.bitmap = Bitmap.new(451,465)
 for i in [email protected]
 x = 14+i%7*60
 y = 271+i/7*78
 bitmap = RPG::Cache.icon(@data.icon_name)
 @sprite.bitmap.blt(x, y + 4, bitmap, Rect.new(0, 0, 47, 47))
 @view2 = Viewport.new(130,60,300,450)
 @view2.z = 10000
 @text = Sprite.new(@view2)
 @text.bitmap = Bitmap.new(450,450)
 @text.bitmap.font.size = 15
 @text.bitmap.font.name = ["宋体"]
 @text.bitmap.font.bold = true
 end
 end
 def update
 mouse_x, mouse_y = Mouse.get_mouse_pos
 @叉号.update
 if @叉号.pressed or Mouse.trigger?(Mouse::RIGHT)
 $ext = true
 end
 if mouse_x>1 and mouse_x<32 and mouse_y>1 and mouse_y<32
 if Mouse.trigger?(Mouse::LEFT)
 common_event_id =  196
 #设置事件
 common_event = $data_common_events[common_event_id]
 $game_system.map_interpreter.setup(common_event.list, 0)
 $game_system.map_interpreter.update
 end
 end
 if mouse_x>15 and mouse_x<443 and mouse_y>280 and mouse_y<416
 #(坐标x,坐标y,横个数,纵个数,单格w,单格h,间隔w,间隔h)
 n = 判断格子(20,270,7,2,41,42,22,22)
 if @index != n
 @index = n
 if @index !=0 and @data[@index-1]
 @x = 70+(@index)%5*30+10
 @y = 30+(@index)/7*30+40
 @name = @data[@index-1].name
 @cost = @data[@index-1].sp_cost
 @description = @data[@index-1].description
 refresh
 else
 if @back and @Edge and @back.visible = true
 @text.bitmap.clear
 @back.visible = @edge.visible = false
 end
 end
 end
 else
 @index = 99
 if @back and @edge and @back.visible = true
 @text.bitmap.clear
 @back.visible = @edge.visible = false
 end
 end
 end
 def refresh
 if @back and @edge and
 @back.visible = @edge.visible = false
 end
 @text.bitmap.clear
 @text.bitmap.font.size = 17
 @text.bitmap.font.color = Color.new(0,255,0)
 @text.bitmap.draw_text(@x-81,@y-60,80,32,@name)
 @text.bitmap.font.size = 15
 @text.bitmap.font.color = Color.new(255,255,255)
 description = @description.scan(/./)
 hang = 0
 @xx = @x
 for i in 0...description.size
 cx = @text.bitmap.text_size(description).width
 if @xx > @x+cx*12
 hang +=1
 @xx = @x
 end
 @text.bitmap.draw_text(@xx-81,@y-42 + hang*17,cx,32,description)
 @xx +=cx
 end
 @back,@edge = System.draw_skin(@x+40,@y,9999,200,44+(hang+1)*17,Color.new(255,255,255), Color.new(17,17,17,125))
 @back.visible = @edge.visible = true
 @text.bitmap.draw_text(@x-81,@y-42 + (hang+1)*17,100,32,"消耗:MP:#{@cost}")
 end
 def dispose
 @叉号.dispose
 @back2.dispose
 @view.dispose
 if @view2
 @view2.dispose
 end
 if @text
 @text.dispose
 end
 if @sprite
 @sprite.dispose
 end
 end
 end
  (ΦωΦ) | 
 |