赞 | 5 |
VIP | 620 |
好人卡 | 38 |
积分 | 69 |
经验 | 125468 |
最后登录 | 2015-7-27 |
在线时间 | 1666 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 6875
- 在线时间
- 1666 小时
- 注册时间
- 2008-10-29
- 帖子
- 6710
|
class Spriteset_Map
alias :set_zhiwawa :initialize
def initialize
set_zhiwawa
if $game_switches[1] == true
@character_sprites.push(Zhiwawatoufa.new(@viewport1, $game_player))
end
end
end
#利用实现游戏纸娃娃系统,默认游戏,染发范例.
#by 66Rpg学习
class Game_Character
attr_accessor :头发颜色 # 头发颜色
alias :set_char :initialize
def initialize
if $game_switches[1] == true
@头发颜色 = 0
end
set_char
end
end
class Zhiwawatoufa < RPG::Sprite
def initialize(viewport, char = nil)
super(viewport)
@char = char
end
def update
super
if @yanse != $game_player.头发颜色
@yanse = $game_player.头发颜色
self.bitmap = RPG::Cache.character(@char.character_name,@yanse)
@cw = bitmap.width / 4
@ch = bitmap.height / 4
self.ox = @cw / 2
self.oy = @ch
end
self.visible = (not @char.transparent)
sx = @char.pattern * @cw
sy = (@char.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch - 32)
self.x = @char.screen_x
self.y = @char.screen_y
self.z = @char.screen_z(@ch)
self.opacity = @char.opacity
self.blend_type = @char.blend_type
self.bush_depth = @char.bush_depth
end
end
我怎么感觉你没有把完整脚本放上来- -!
报告错误别来问我为什么- -! |
|