赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 0 |
最后登录 | 2016-8-4 |
在线时间 | 0 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 640
- 在线时间
- 0 小时
- 注册时间
- 2016-8-4
- 帖子
- 1
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
显示头像的时候图片上的留白处也被一起显示了,怎么才能把这些空白忽略掉?
所用脚本如下
#——头像设置
if (/\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
@face_file = $1 + ".png"
@x = @face_indent = 128
if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
end
@now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
end
#——左半身像设置
if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then
@face = $1
if $加密 == true
if @left_picture != nil
@left_picture.dispose
end
@left_picture = Sprite.new
@left_picture.bitmap = Bitmap.new("Graphics/Faces/#{@face}")
@left_picture.y = 480-@left_picture.bitmap.height
@left_picture.x = 0
@left_picture.mirror = true
@x = @face_indent = @left_picture.bitmap.width
@left_keep = true
@now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
else
if FileTest.exist?("Graphics/Faces/#{@face}")
if @left_picture != nil
@left_picture.dispose
end
@left_picture = Sprite.new
@left_picture.bitmap = Bitmap.new("Graphics/Faces/#{@face}")
@left_picture.y = 480-@left_picture.bitmap.height
@left_picture.x = 0
@left_picture.mirror = true
@now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
end
end
end
#——右半身像设置
if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
@face = $1
if $加密 == true
if @right_picture != nil
@right_picture.dispose
end
@right_picture = Sprite.new
@right_picture.bitmap = Bitmap.new("Graphics/Faces/#{@face}")
@right_picture.y = 480-@right_picture.bitmap.height
@right_picture.x = 640-@right_picture.bitmap.width
@right_keep = true
@now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
else
if FileTest.exist?("Graphics/Faces/#{@face}")
if @right_picture != nil
@right_picture.dispose
end
@right_picture = Sprite.new
@right_picture.bitmap = Bitmap.new("Graphics/Faces/#{@face}")
@right_picture.y = 480-@right_picture.bitmap.height
@right_picture.x = 640-@right_picture.bitmap.width
@now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
end
end
end
if (/\\[Rr]k/.match(@now_text)) != nil
@right_keep = true
@now_text.sub!(/\\[Rr]k/) { "" }
end
if (/\\[Ll]k/.match(@now_text)) != nil
@left_keep = true
@now_text.sub!(/\\[Ll]k/) { "" }
end
# 显示人物姓名
name_window_set = false
if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
name_window_set = true
name_text = $1
@now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
end
# 文字位置的判定
if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
@popchar = $1.to_i
if @popchar == -1
@x = @indent = 48
@y = 4
end
@now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
end
拜托各位大神了! |
|