设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1428|回复: 2
打印 上一主题 下一主题

[已经过期] 显示图片周围有空白

[复制链接]

Lv1.梦旅人

梦石
0
星屑
640
在线时间
0 小时
注册时间
2016-8-4
帖子
1
跳转到指定楼层
1
发表于 2016-8-4 16:04:40 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

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
      

拜托各位大神了!

未命名.PNG (89.75 KB, 下载次数: 5)

未命名.PNG

Lv4.逐梦者 (版主)

漾夕☽星化残月☾

梦石
0
星屑
8571
在线时间
3855 小时
注册时间
2015-5-12
帖子
2077

剧作品鉴家

2
发表于 2016-8-4 19:22:45 | 只看该作者
用ps把空白处调成透明不可以吗?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
125
在线时间
171 小时
注册时间
2014-4-14
帖子
151
3
发表于 2016-8-5 09:55:20 | 只看该作者
这不是脚本的问题,是图片的问题。扣图 、 ps 或者 剪裁 把图片变成透明背景就可以了。
Vanyogin
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-22 06:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表