商店横排买卖取消,怎么变成竖排如图
class Window_ShopCommand < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(0, 0, 128, 150)#★★★★★★★★★★★★★★★★★ self.contents = Bitmap.new(width - 32, height - 32) @item_max = 3 @row_max = 3 @commands = ["买", "卖", "取消"]# @commands.x=0 # s1 = "买" # s2 = "卖" # s3 = "卖" # command = Window_Command.new(90,[s1,s2,s3]) # command.x = 320-Command.width/2 # command.y = 240-Command.height/2 refresh self.index = 0 end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # ● 描绘项目 # index : 项目编号 #-------------------------------------------------------------------------- def draw_item(index) y = 4 + index * 64 self.contents.draw_text(x, index * 32, 128, 32, @commands[index]) endend
class Window_ShopCommand < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(0, 0, 128, 150)#★★★★★★★★★★★★★★★★★ self.contents = Bitmap.new(width - 32, height - 32) @item_max = 3 @row_max = 3 @commands = ["买", "卖", "取消"] # @commands.x=0 # s1 = "买" # s2 = "卖" # s3 = "卖" # command = Window_Command.new(90,[s1,s2,s3]) # command.x = 320-Command.width/2 # command.y = 240-Command.height/2 refresh self.index = 0 end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # ● 描绘项目 # index : 项目编号 #-------------------------------------------------------------------------- def draw_item(index) y = 4 + index * 64 self.contents.draw_text(x, index * 32, 128, 32, @commands[index]) end end
2222.png (195.24 KB, 下载次数: 5)
下载附件 保存到相册
2023-5-7 14:43 上传
333.png (31.68 KB, 下载次数: 6)
2023-5-7 14:55 上传
查看全部评分
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-5-12 08:23
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.