| 赞 | 0 |
| VIP | 0 |
| 好人卡 | 0 |
| 积分 | 1 |
| 经验 | 11149 |
| 最后登录 | 2012-4-6 |
| 在线时间 | 0 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 0 小时
- 注册时间
- 2007-6-3
- 帖子
- 522
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
做了个简单的在地图上显示状态的窗口。可是发觉,当人物快走到地图边缘,地图不会再移动。
于是,主角便走到新窗口下面去了。![]()
这个该怎么解决呢?
(本来想找那个 小地图 脚本来看下,结果找了很久没找到。)
- class ShowMoney < Window_Base
- #--------------------------------------------------------------------------
- # ● 类常量定义
- #--------------------------------------------------------------------------
- # 窗口位置设定
- GOLD_X =470 # 矩形左上顶点X坐标
- GOLD_Y = 2 # 矩形左上顶点Y坐标
- GOLD_W = 175 # 矩形宽
- GOLD_H = 145 # 矩形高
- #--------------------------------------------------------------------------
- # ● 初始化状态
- #--------------------------------------------------------------------------
- def initialize
- super(GOLD_X , GOLD_Y, GOLD_W, GOLD_H)
- @actor = $game_party.actors[0]
- # 初始化窗口透明度
- self.back_opacity=0
- self.opacity=0
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.size=18
- self.contents.font.color=system_color
-
- @nRunTime=0
- #-------------------显示图片------------------------
- backPicture=Bitmap.new("Graphics/Heads/通用_yuhuan_1_0.png")
- cw=backPicture.width
- ch=backPicture.height
- back_picture=Rect.new(0,0,cw,ch)
- self.contents.blt(20,0,backPicture,back_picture)
- end
- def draw_hp
- self.contents.draw_text(20, 90 , 100, 32, "HP:" + @actor.hp.to_s + "/" + @actor.maxhp.to_s , 1)
- end
-
- #--------------------------引用自 66《黑暗圣剑传说》--------------
- def draw_actor_hp( x, y, width = 144) #这个用于战斗的描绘
- hp_length = 85*@actor.hp / @actor.maxhp #HP槽的长度
- hp_lv1_bitmap = Bitmap.new("Graphics/Pictures/bars/HP2_lv1_long.png")
- cw_lv1 = hp_lv1_bitmap.width
- ch_lv1 = hp_lv1_bitmap.height
- src_rect_lv1 = Rect.new(0, 0, cw_lv1, ch_lv1)
- self.contents.blt(x , y , hp_lv1_bitmap, src_rect_lv1)
- #————绘制血————
- hp_lv2_bitmap = Bitmap.new("Graphics/Pictures/bars/HP2_lv2_long(blood).png")
- ch_lv2 = hp_lv2_bitmap.height
- ch_lv2a=hp_lv2_bitmap.width
- src_rect_lv2 = Rect.new(0, 0, 26+hp_length, ch_lv2)
- self.contents.blt(x , y-1 , hp_lv2_bitmap, src_rect_lv2)
- end
- end
- #---------------------------------------------------------------------
- #------------------------------------------------------------------------------
- class Scene_Map
- alias smn_mainl main
- def main
- @a_wwPP = ShowMoney.new
- smn_mainl
-
- @a_wwPP.dispose
- end
-
- alias smn_updatel update
- def update
- @a_wwPP.draw_actor_hp(5,90)
- @a_wwPP.draw_hp
- smn_updatel
- end
- end
复制代码 版务信息:本贴由楼主自主结贴~ |
|