赞 | 0 |
VIP | 2 |
好人卡 | 0 |
积分 | 1 |
经验 | 3917 |
最后登录 | 2013-8-12 |
在线时间 | 16 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 16 小时
- 注册时间
- 2009-9-20
- 帖子
- 232
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 p7l8k90 于 2010-8-27 20:48 编辑
我在论坛里找到一个仙剑2战斗菜单,代码如下:
class Window_bacommand1 < Window_Selectable2
def initialize
super(0, 300, 300, 300)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.index = index
refresh
# 主循环
end
#===============================================================================
def refresh
self.contents.clear
onbit = Bitmap.new("Graphics/Pictures/圆盘中__02")
upbit = Bitmap.new("Graphics/Pictures/圆盘上__01")
leftbit = Bitmap.new("Graphics/Pictures/圆盘左__01")
downbit = Bitmap.new("Graphics/Pictures/圆盘下__01")
rightbit = Bitmap.new("Graphics/Pictures/圆盘右__01")
bitmap = Bitmap.new("Graphics/Pictures/圆盘")
src_rect=Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(0, 0, bitmap, src_rect)
self.contents.blt(27, 7, upbit, src_rect)
self.contents.blt(7, 27, leftbit, src_rect)
self.contents.blt(27, 95, downbit, src_rect)
self.contents.blt(95, 27, rightbit, src_rect)
self.contents.blt(49, 49, onbit, src_rect)
case @index
when 0
onbit = Bitmap.new("Graphics/Pictures/圆盘中__02")
upbit = Bitmap.new("Graphics/Pictures/圆盘上__01")
leftbit = Bitmap.new("Graphics/Pictures/圆盘左__01")
downbit = Bitmap.new("Graphics/Pictures/圆盘下__01")
rightbit = Bitmap.new("Graphics/Pictures/圆盘右__01")
bitmap = Bitmap.new("Graphics/Pictures/圆盘")
src_rect=Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(0, 0, bitmap, src_rect)
self.contents.blt(27, 7, upbit, src_rect)
self.contents.blt(7, 27, leftbit, src_rect)
self.contents.blt(27, 95, downbit, src_rect)
self.contents.blt(95, 27, rightbit, src_rect)
self.contents.blt(49, 49, onbit, src_rect)
when 1
onbit = Bitmap.new("Graphics/Pictures/圆盘中__01")
upbit = Bitmap.new("Graphics/Pictures/圆盘上__02")
leftbit = Bitmap.new("Graphics/Pictures/圆盘左__01")
downbit = Bitmap.new("Graphics/Pictures/圆盘下__01")
rightbit = Bitmap.new("Graphics/Pictures/圆盘右__01")
bitmap = Bitmap.new("Graphics/Pictures/圆盘")
src_rect=Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(0, 0, bitmap, src_rect)
self.contents.blt(27, 7, upbit, src_rect)
self.contents.blt(7, 27, leftbit, src_rect)
self.contents.blt(27, 95, downbit, src_rect)
self.contents.blt(95, 27, rightbit, src_rect)
self.contents.blt(49, 49, onbit, src_rect)
when 2
onbit = Bitmap.new("Graphics/Pictures/圆盘中__01")
upbit = Bitmap.new("Graphics/Pictures/圆盘上__01")
leftbit = Bitmap.new("Graphics/Pictures/圆盘左__02")
downbit = Bitmap.new("Graphics/Pictures/圆盘下__01")
rightbit = Bitmap.new("Graphics/Pictures/圆盘右__01")
bitmap = Bitmap.new("Graphics/Pictures/圆盘")
src_rect=Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(0, 0, bitmap, src_rect)
self.contents.blt(27, 7, upbit, src_rect)
self.contents.blt(7, 27, leftbit, src_rect)
self.contents.blt(27, 95, downbit, src_rect)
self.contents.blt(95, 27, rightbit, src_rect)
self.contents.blt(49, 49, onbit, src_rect)
when 3
onbit = Bitmap.new("Graphics/Pictures/圆盘中__01")
upbit = Bitmap.new("Graphics/Pictures/圆盘上__01")
leftbit = Bitmap.new("Graphics/Pictures/圆盘左__01")
downbit = Bitmap.new("Graphics/Pictures/圆盘下__02")
rightbit = Bitmap.new("Graphics/Pictures/圆盘右__01")
bitmap = Bitmap.new("Graphics/Pictures/圆盘")
src_rect=Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(0, 0, bitmap, src_rect)
self.contents.blt(27, 7, upbit, src_rect)
self.contents.blt(7, 27, leftbit, src_rect)
self.contents.blt(27, 95, downbit, src_rect)
self.contents.blt(95, 27, rightbit, src_rect)
self.contents.blt(49, 49, onbit, src_rect)
when 4
onbit = Bitmap.new("Graphics/Pictures/圆盘中__01")
upbit = Bitmap.new("Graphics/Pictures/圆盘上__01")
leftbit = Bitmap.new("Graphics/Pictures/圆盘左__01")
downbit = Bitmap.new("Graphics/Pictures/圆盘下__01")
rightbit = Bitmap.new("Graphics/Pictures/圆盘右__02")
bitmap = Bitmap.new("Graphics/Pictures/圆盘")
src_rect=Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(0, 0, bitmap, src_rect)
self.contents.blt(27, 7, upbit, src_rect)
self.contents.blt(7, 27, leftbit, src_rect)
self.contents.blt(27, 95, downbit, src_rect)
self.contents.blt(95, 27, rightbit, src_rect)
self.contents.blt(49, 49, onbit, src_rect)
end
self.contents.font.size = 16
self.contents.draw_text(55, 14, 64, 32, "1")
self.contents.draw_text(11, 55, 64, 32, "2")
self.contents.draw_text(55, 100, 64, 32, "3")
self.contents.draw_text(100, 55, 64, 32, "4")
self.contents.draw_text(55, 55, 64, 32, "5")
end
#===============================================================================
def update
if @index != self.index
refresh
end
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
if @index == 1
@index = 0
else
@index = 3
end
refresh
end
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
if @index == 3
@index = 0
else
@index = 1
end
refresh
end
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
if @index == 4
@index = 0
else
@index = 2
end
refresh
end
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
if @index == 2
@index = 0
else
@index = 4
end
refresh
end
end
end
请问,这些图片是如何对应上命令的? |
|