Project1
标题:
有关45度战斗脚本的问题
[打印本页]
作者:
zczche
时间:
2012-7-15 16:55
标题:
有关45度战斗脚本的问题
人物是45度的,但是底下的名字以及生命值什么的,都是横着而且有一个大大的条块,我怎么把他去掉啊?我想要把底下那变成类似仙四那种,有个名字有个头像,不想要现在这样的(现在那底下就是一开始默认那样,图片格式不对……没法上传。)
我有一个脚本可以去掉那个,可是去掉完了是一个大黑块,跟背景对不上,怎么办啊?我主要地下想弄成仙四那样。 dsu_plus_rewardpost_czw
作者:
腐琴琴
时间:
2012-7-15 17:10
本帖最后由 腐琴琴 于 2012-7-18 15:23 编辑
Spriteset_Battle
@viewport1 = Viewport.new(0, 0, 640, 320)
复制代码
@battleback_sprite.src_rect.set(0, 0, 640, 320)
复制代码
把320改成480,再用640*480的战斗背景图
黑色就没了。
头像的话可以试试这个
头像图片以"人物名_f.png"保存在“Graphics\Characters”
60-69行的数字可以调整各项的位置
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 图形的描绘
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
#--------------------------------------------------------------------------
def draw_actor_graphi(actor, x, y)
bitmap = RPG::Cache.character(actor.name+"_f.png", actor.character_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
end
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 显示战斗画面同伴状态的窗口。
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 320, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
refresh
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
super
end
#--------------------------------------------------------------------------
# ● 设置升级标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 160 + 4
draw_actor_graphi(actor, 20 , 20)
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 96)
end
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 主界面的不透明度下降
if $game_temp.battle_main_phase
self.contents_opacity -= 4 if self.contents_opacity > 191
else
self.contents_opacity += 4 if self.contents_opacity < 255
end
end
end
复制代码
���
作者:
pokemonjs
时间:
2012-7-18 09:07
腐琴琴 发表于 2012-7-15 17:10
把320改成480,再用640*480的战斗背景图
黑色就没了。
你好,请问能发一个45度的游戏制作脚本给我么?O(∩_∩)O谢谢了!!!
作者:
腐琴琴
时间:
2012-7-18 15:49
本帖最后由 腐琴琴 于 2012-7-18 15:53 编辑
好吧……
Project6.rar
(331.22 KB, 下载次数: 103)
2012-7-18 15:49 上传
点击文件名下载附件
下面这段脚本直接复制使用也可以。头像的宽度控制在60左右
#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
# 处理战斗画面的活动块的类。本类在 Scene_Battle 类
# 的内部使用。
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_reader :viewport1 # 敌人方的显示端口
attr_reader :viewport2 # 角色方的显示端口
#--------------------------------------------------------------------------
# ● 初始化变量
#--------------------------------------------------------------------------
def initialize
# 生成显示端口
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport4 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 101
@viewport3.z = 200
@viewport4.z = 5000
# 生成战斗背景活动块
@battleback_sprite = Sprite.new(@viewport1)
# 生成敌人活动块
@enemy_sprites = []
for enemy in $game_troop.enemies.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
# 生成敌人活动块
@actor_sprites = []
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
# 生成天候
@weather = RPG::Weather.new(@viewport1)
# 生成图片活动块
@picture_sprites = []
for i in 51..100
@picture_sprites.push(Sprite_Picture.new(@viewport3,
$game_screen.pictures[i]))
end
# 生成计时器块
@timer_sprite = Sprite_Timer.new
# 刷新画面
update
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新角色的活动块 (对应角色的替换)
@actor_sprites[0].battler = $game_party.actors[0]
@actor_sprites[1].battler = $game_party.actors[1]
@actor_sprites[2].battler = $game_party.actors[2]
@actor_sprites[3].battler = $game_party.actors[3]
# 战斗背景的文件名与现在情况有差异的情况下
if @battleback_name != $game_temp.battleback_name
@battleback_name = $game_temp.battleback_name
if @battleback_sprite.bitmap != nil
@battleback_sprite.bitmap.dispose
end
@battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
@battleback_sprite.src_rect.set(0, 0, 640, 480)
end
# 刷新战斗者的活动块
for sprite in @enemy_sprites + @actor_sprites
sprite.update
end
# 刷新天气图形
@weather.type = $game_screen.weather_type
@weather.max = $game_screen.weather_max
@weather.update
# 刷新图片活动块
for sprite in @picture_sprites
sprite.update
end
# 刷新计时器活动块
@timer_sprite.update
# 设置画面的色调与震动位置
@viewport1.tone = $game_screen.tone
@viewport1.ox = $game_screen.shake
# 设置画面的闪烁色
@viewport4.color = $game_screen.flash_color
# 刷新显示端口
@viewport1.update
@viewport2.update
@viewport4.update
end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
def draw_actor_graphi(actor, x, y)
bitmap = RPG::Cache.character(actor.character_name + "_f.png", actor.character_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
end
# ————————————————————————————————————
# 本脚本来自www.66rpg.com,转载请保留此信息
# ————————————————————————————————————
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
# 处理角色的类。本类在 Game_Actors 类 ($game_actors)
# 的内部使用、Game_Party 类请参考 ($game_party) 。
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 取得战斗画面的 X 坐标
#--------------------------------------------------------------------------
def screen_x
case self.index
when 0
return 350
when 1
return 430
when 2
return 510
when 3
return 580
else
return 600
end
end
#--------------------------------------------------------------------------
# ● 取得战斗画面的 Y 坐标
#--------------------------------------------------------------------------
def screen_y
case self.index
when 0
return 430
when 1
return 395
when 2
return 360
when 3
return 325
else
return 1000
end
end
#--------------------------------------------------------------------------
# ● 取得战斗画面的 Z 坐标
#--------------------------------------------------------------------------
def screen_z
case self.index
when 0
return 10
when 1
return 9
when 2
return 8
when 3
return 7
else
return 0
end
end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘 HP
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_hp1(actor, x, y, width = 72)
# 描绘字符串 "HP"
self.contents.font.color = system_color
self.contents.draw_text(x, y, 24, 24, $data_system.words.hp)
# 计算描绘 MaxHP 所需的空间
if width - 24 >= 32
hp_x = x + 32# + width - 24
end
# 描绘 HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 32, 24, actor.hp.to_s, 2)
end
#--------------------------------------------------------------------------
# ● 描绘 SP
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_sp1(actor, x, y, width = 72)
# 描绘字符串 "SP"
self.contents.font.color = system_color
self.contents.draw_text(x, y, 24, 24, $data_system.words.sp)
# 计算描绘 MaxSP 所需的空间
if width - 24 >= 32
sp_x = x + 32# + width - 24
end
# 描绘 SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 32, 24, actor.sp.to_s, 2)
end
end
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 显示战斗画面同伴状态的窗口。
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
#$data_system_level_up_me = "Audio/ME/升级音乐"
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 10, height - 32)
self.opacity = 0
@level_up_flags = [false, false, false, false]
refresh
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
super
end
#--------------------------------------------------------------------------
# ● 设置升级标志
# actor_index : 角色索引
#--------------------------------------------------------------------------
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
x = i * 136 + 100
y = 400
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 80, 24, "LEVEL UP!")
Audio.me_stop
# Audio.me_play($data_system_level_up_me)
else
draw_actor_hp1(actor, x-15, y-15, 80)
draw_actor_sp1(actor, x-15, y+5, 80)
end
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
# 主界面的不透明度下降
if $game_temp.battle_main_phase
self.contents_opacity -= 50 if self.contents_opacity > 1
else
self.contents_opacity += 50 if self.contents_opacity < 255
end
end
end
#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
alias xrxs_bp2_refresh refresh
def refresh
xrxs_bp2_refresh
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
x = i * 136 + 100
y = 400
draw_actor_hp_meter(actor, x, y, 50)
draw_actor_sp_meter(actor, x, y + 8, 50)
draw_actor_graphi(actor, x - 48, y + 40)
end
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● HP描画
#--------------------------------------------------------------------------
def draw_actor_hp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 25))
w = width * actor.hp / actor.maxhp
self.contents.fill_rect(x, y+28, w,1, Color.new(255, 96, 96, 255))
self.contents.fill_rect(x, y+29, w,1, Color.new(255, 0, 0, 255))
self.contents.fill_rect(x, y+30, w,1, Color.new(128, 0, 0, 255))
self.contents.fill_rect(x, y+31, w,1, Color.new(0, 0, 0, 255))
end
#--------------------------------------------------------------------------
# ● SP描画
#--------------------------------------------------------------------------
def draw_actor_sp_meter(actor, x, y, width = 156, type = 0)
if type == 1 and actor.hp == 0
return
end
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
w = width * actor.sp / actor.maxsp
self.contents.fill_rect(x, y+28, w,1, Color.new(128, 255, 255, 255))
self.contents.fill_rect(x, y+29, w,1, Color.new(0, 255, 255, 255))
self.contents.fill_rect(x, y+30, w,1, Color.new(0, 192, 192, 255))
self.contents.fill_rect(x, y+31, w,1, Color.new(0, 128, 128, 255))
end
end
复制代码
作者:
小学生
时间:
2012-7-20 10:36
站长的视频:
http://dl.dbank.com/c057uz8you
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1