Project1
标题:
请教地图左上角显示文字和变量
[打印本页]
作者:
木许许
时间:
2012-3-2 09:50
标题:
请教地图左上角显示文字和变量
按照地图ID,在相应的地图左上角显示文字和变量,当地图ID为10,左上角显示文字“时间槽:”,然后后面跟一个变量 dsu_plus_rewardpost_czw
作者:
hys111111
时间:
2012-3-2 13:26
请自行修改
Playerdate_SWITCH = 1 # 当1号开关打开,本脚本才开始工作。
Playerdate_magicdef =19
Yellowkey_itemid=1
Bluekey_itemid=2
Redkey_itemid=3
Greenkey_itemid=41
#==============================================================================
# ■ Window_PlayerDate
#------------------------------------------------------------------------------
# 显示玩家状态的窗口。
#==============================================================================
class Window_PlayerDate < Window_Base
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 480)#395)#192,416
self.contents = Bitmap.new(width - 32, height - 32)
self.z =210
self.opacity=0
self.back_opacity =255
# self.contents_opacity = 255
self.visible = false
# self.contents.clear
refresh
# if $game_switches[XY_SWITCH]
# self.contents_opacity = 0
# else
# self.contents_opacity = 5
# end
end
def refresh
if $game_switches[50]#进入屏幕右侧状态栏换到左侧
self.x=0
else#进入屏幕左侧状态栏换到右侧
self.x=480
end
self.contents.clear
x=25
x=30 if !$game_switches[27]
y=75
y=40 if !$game_switches[27]
#actor = $game_party.actors[1]
draw_actor_graphic($game_party.actors[0], 20, 35)
self.contents.font.color = system_color
self.contents.draw_text(40, 11, 25, 20, "第", 0) if $game_switches[36]
self.contents.draw_text(100, 11, 25, 20, "层", 0)if $game_switches[36]
self.contents.draw_text(0, 55, 50, 20, "等级", 0)
if $game_switches[42]
a=$game_variables[1]+81
if $game_variables[1]==3
a=116
end
if $game_variables[a]!=0
bitmap = Bitmap.new("Graphics/Pictures/up.png")
self.contents.blt(40,55 , bitmap, Rect.new(0, 0, 20, 20))
end
end
self.contents.draw_text(4, 65+x, 40, 20, "生命", 0)
self.contents.draw_text(4, 65+x*2, 40, 20, "攻击", 0)
self.contents.draw_text(4, 65+x*3, 40, 20,"防御", 0)
self.contents.draw_text(4, 65+x*4, 40, 20, "魔防", 0) if $game_switches[Playerdate_magicdef]
self.contents.draw_text(4, 65+x*5, 40, 20, "速度", 0) if $game_switches[27]
self.contents.draw_text(4, y+x*6, 40, 20, "经验", 0)
self.contents.draw_text(4, y+x*7, 40, 20, "金币", 0)
if $game_switches[26]
bitmap = RPG::Cache.icon("101-01")#黄钥匙)
self.contents.blt(10, 280, bitmap, Rect.new(0, 0, 32, 32))
bitmap = RPG::Cache.icon("101-02")#蓝钥匙)
self.contents.blt(10, 307, bitmap, Rect.new(0, 0, 32, 32))
bitmap = RPG::Cache.icon("101-03")#红钥匙)
self.contents.blt(10, 334, bitmap, Rect.new(0, 0, 32, 32))
bitmap = RPG::Cache.icon("101-04") if $game_switches[43]#绿钥匙)
self.contents.blt(10, 361, bitmap, Rect.new(0, 0, 32, 32)) if $game_switches[43]
else
self.contents.font.color = text_color(6)
self.contents.draw_text(8, 285, 50, 20, "黄钥匙", 0)
self.contents.font.color = text_color(4)
self.contents.draw_text(8, 313, 50, 20, "蓝钥匙", 0)
self.contents.font.color = text_color(2)
self.contents.draw_text(8, 341, 50, 20, "红钥匙", 0)
self.contents.font.color = text_color(3)
self.contents.draw_text(8, 369, 50, 20, "绿钥匙", 0) if $game_switches[43]
end
@xgraphic=$game_party.actors[0].character_name
@xfloor=$game_variables[2]
@xlevel=$game_actors[$game_variables[1]+1].level
@xlevelup=$game_variables[$game_variables[1]+81] if $game_switches[42]
@xlife=$game_actors[$game_variables[1]+1].hp
@xattact=$game_actors[$game_variables[1]+1].str
@xdefence=$game_actors[$game_variables[1]+1].dex
@xmagicdef=$game_actors[$game_variables[1]+1].int if $game_switches[Playerdate_magicdef]
@xspeed=$game_actors[$game_variables[1]+1].agi if $game_switches[27]
@xexp= $game_actors[$game_variables[1]+1].exp
@xgold=$game_party.gold
@xyellowkey=$game_party.item_number(Yellowkey_itemid)
@xbluekey=$game_party.item_number(Bluekey_itemid)
@xredkey=$game_party.item_number(Redkey_itemid)
@xgreenkey=$game_party.item_number(Greenkey_itemid) if $game_switches[43]
@xpoison=$game_switches[13]
@xpoor=$game_switches[15]
@xcurse=$game_switches[16]
@xslow=$game_switches[12]
@xchange=$game_switches[50]
self.contents.font.color = normal_color
self.contents.draw_text(32, 0, 60, 45, @xfloor.to_s, 2) if $game_switches[36]
self.contents.draw_text(40, 0, 80, 45, @xfloor.to_s, 2) if !$game_switches[36]
self.contents.draw_text(50, 50, 65, 30, @xlevel.to_s, 2)
self.contents.draw_text(50, 50, 20, 35, @xname.to_s, 2)
self.contents.draw_text(43, 65+x, 72, 20,@xlife .to_s, 2)
self.contents.draw_text(50, 65+x*2, 65, 20,@xattact .to_s, 2)
self.contents.draw_text(50, 65+x*3, 65, 20,@xdefence .to_s, 2)
self.contents.draw_text(50, 65+x*4, 65, 20,@xmagicdef .to_s, 2) if $game_switches[Playerdate_magicdef]
self.contents.draw_text(50, 65+x*5, 65, 20,@xspeed .to_s, 2) if $game_switches[27]
self.contents.draw_text(50, y+x*6, 65, 20,@xexp.to_s, 2)
self.contents.draw_text(50, y+x*7, 65, 20, @xgold.to_s, 2)
self.contents.font.color = text_color(6)
self.contents.draw_text(75, 285, 25, 20, @xyellowkey.to_s, 2)
self.contents.font.color = text_color(4)
self.contents.draw_text(75, 313, 25, 20, @xbluekey .to_s, 2)
self.contents.font.color = text_color(2)
self.contents.draw_text(75, 341, 25, 20, @xredkey.to_s, 2)
self.contents.font.color = text_color(3)
self.contents.draw_text(75, 369, 25, 20, @xgreenkey.to_s, 2) if $game_switches[43]
self.contents.font.color = text_color(3)
self.contents.draw_text(8, 390, 30, 30, "毒".to_s, 0) if $game_switches[13]
self.contents.font.color = text_color(5)
self.contents.draw_text(36, 390, 30, 30, "衰".to_s, 0) if $game_switches[15]
self.contents.font.color = text_color(4)
self.contents.draw_text(64, 390, 30, 30, "咒".to_s, 0) if $game_switches[16]
self.contents.font.color = Color.new(rand(255),rand(255),rand(255))
self.contents.draw_text(64, 390, 30, 30, "胡".to_s, 0) if $game_switches[56]
self.contents.font.color = text_color(1)
self.contents.draw_text(92, 390, 30, 30, "慢".to_s, 0) if $game_switches[12]
self.contents.font.color = Color.new(0,255,255)
self.contents.draw_text(92, 390, 30, 30, "反".to_s, 0) if $game_switches[57]
end
def judge#用于判断是否数据变更,节约内存
return true if @xgraphic!=$game_party.actors[0].character_name
return true if @xfloor!=$game_variables[2]
return true if @xlevel!=$game_actors[$game_variables[1]+1].level
return true if @xlevelup!=$game_variables[$game_variables[1]+81] if $game_switches[42]
return true if @xlife!=$game_actors[$game_variables[1]+1].hp
return true if @xattact!=$game_actors[$game_variables[1]+1].str
return true if @xdefence!=$game_actors[$game_variables[1]+1].dex
return true if @xmagicdef!=$game_actors[$game_variables[1]+1].int if $game_switches[Playerdate_magicdef]
return true if @xspeed!=$game_actors[$game_variables[1]+1].agi if $game_switches[27]
return true if @xexp!= $game_actors[$game_variables[1]+1].exp
return true if @xgold!=$game_party.gold
return true if @xyellowkey!=$game_party.item_number(Yellowkey_itemid)
return true if @xbluekey!=$game_party.item_number(Bluekey_itemid)
return true if @xredkey!=$game_party.item_number(Redkey_itemid)
return true if @xgreenkey!=$game_party.item_number(Greenkey_itemid) if $game_switches[43]
return true if @xpoison!=$game_switches[13]
return true if @xpoor!=$game_switches[15]
return true if @xcurse!=$game_switches[16]
return true if @xslow!=$game_switches[12]
return true if @xchange!=$game_switches[50]
return false
end
end
###########################################################################
# 下面的东西不需要掌握~ #
###########################################################################
class Scene_Map
alias xy_66rpg_main main
def main
@Playerdate_window = Window_PlayerDate.new
@Playerdate_window.x = $game_variables[105]
# @xy_window.y = 480 - 96
# @xy_window.opacity = 0
xy_66rpg_main
@Playerdate_window .dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias xy_66rpg_update update
def update
xy_66rpg_update
if $game_switches[Playerdate_SWITCH]
@Playerdate_window .visible = true
@Playerdate_window .refresh if @Playerdate_window.judge
else
@Playerdate_window .visible = false
end
end
end
#==========================================================================
# 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
#==========================================================================
复制代码
作者:
腐琴琴
时间:
2012-3-2 17:09
显示的话是公共事件——并行处理,
变量=地图ID,条件分歧。
显示文字的话如果字没什么变化的话可以把字做成图片显示。
显示变量的话用主站上的一个脚本试试。
#==========================================================================
# 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。
#==========================================================================
VAR_SWITCH = 26 # 26号开关打开此脚本才工作,关闭则停止运算,并且透明
VAR_REFRESH_SWITCH = 27 # 27号开关控制强制刷新,使用时机:1、把窗口由透明变为不透明(包括第一次使用时),2、游戏中用脚本更改了$var
$var = []
$var = [[1,0,0],[2,32,32],[3,64,32]] #所有需要显示在地图并且刷新的变量,可在游戏中用脚本更改。格式:[变量编号,x坐标,y坐标]
#==============================================================================
# ■ Window_XY
#------------------------------------------------------------------------------
# 显示坐标的窗口。
#==============================================================================
class Window_Var < Window_Base#注意前面那个window_var是文件名
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
super(-16, -16, 640+32, 480+32)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255 # 这个是背景透明
self.opacity = 255 # 这个是边框和背景都透明
self.contents_opacity = 255 # 这个是内容透明
self.visible = false
self.z=9999
@var = $var
@var_a = []
for var_draw in $var
@var_a[var_draw[0]] = $game_variables[var_draw[0]]
end
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if $game_switches[VAR_SWITCH]
@var = $var # 记录现在变量数组结构
self.contents.clear # 清除以前的东西
for var_draw in @var
@var_a[var_draw[0]] = $game_variables[var_draw[0]] # 记录现在的游戏变量
self.contents.draw_text(var_draw[1],var_draw[2],640,32,@var_a[var_draw[0]].to_s)
end
end
end
#--------------------------------------------------------------------------
# ● 判断文字刷新。节约内存用
#--------------------------------------------------------------------------
def judge
for var_draw in $var
if @var_a[var_draw[0]] != $game_variables[var_draw[0]] #如果现在记录的变量和游戏变量不同,刷新
return true
end
end
if $game_switches[VAR_REFRESH_SWITCH] # 强制刷新的时候,刷新
$game_switches[VAR_REFRESH_SWITCH] = false
return true
end
return false
end
end
class Scene_Map
alias var_66rpg_main main
def main
@var_window = Window_Var.new
@var_window.opacity = 0
var_66rpg_main
@var_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias var_66rpg_update update
def update
var_66rpg_update
if $game_switches[VAR_SWITCH]
@var_window.visible = true
@var_window.refresh if @var_window.judge
else
@var_window.visible = false
end
end
end
#==========================================================================
# 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。
#==========================================================================
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1