Project1

标题: 描边字以及影子字(垃圾,不要见笑……) [打印本页]

作者: gpra8764    时间: 2007-4-29 08:44
提示: 作者被禁止或删除 内容自动屏蔽
作者: gpra8764    时间: 2007-4-29 08:44
提示: 作者被禁止或删除 内容自动屏蔽
作者: 七夕小雨    时间: 2007-4-29 23:48
比柳柳修改的那个好像要简单一些~~

恩8错哦{/hx}{/hx}

那个描边的算法好像是把原字体再生成由扩大了一点?{/fd}
作者: 亿万星辰    时间: 2007-4-30 00:53
以下引用七夕小雨于2007-4-29 15:48:17的发言:
那个描边的算法好像是把原字体再生成由扩大了一点?

分别在 左上 左 左下 下 右下 右 右上 上 各描绘一次,然后中间显示一次
作者: 七夕小雨    时间: 2007-4-30 01:01
    self.draw_text(x-1, y-1, width, height, str, align)
    self.draw_text(x-1, y+1, width, height, str, align)
    self.draw_text(x+1, y-1, width, height, str, align)
    self.draw_text(x+1, y+1, width, height, str, align)
    self.draw_text(x, y-1, width, height, str, align)
    self.draw_text(x, y+1, width, height, str, align)
    self.draw_text(x-1, y, width, height, str, align)
    self.draw_text(x+1, y, width, height, str, align)
这几句啊……

{/fd}怪不得……有些……

作者: 果汁分你一半    时间: 2007-4-30 01:16
提示: 作者被禁止或删除 内容自动屏蔽
作者: 精灵使者    时间: 2007-4-30 05:26
我使用的字体阴影脚本……你也可以参考一下
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


class Bitmap
alias sailcat_draw_text draw_text unless method_defined? :sailcat_draw_text
  def draw_text(p1,p2,p3=0,p4=3,p5=nil,p6=0,p7=3,p8=nil)
    case p1
    when Numeric
      x = p1
      y = p2
      width = p3
      height = p4
      text = p5
      align = p6
      shadow_direction = p7
      shadow_color = p8
      if shadow_color.nil?
        shadow_color = Color.new(0,0,0,self.font.color.alpha * 0.67)
      end
    when Rect
      x = p1.x
      y = p1.y
      width = p1.width
      height = p1.height
      text = p2
      align = p3
      shadow_direction = p4
      shadow_color = p5
      if shadow_color.nil?
        shadow_color = Color.new(0,0,0,self.font.color.alpha * 0.67)
      end
    end
  color_temp = self.font.color.clone
  if shadow_direction != 0
    self.font.color = shadow_color
    case shadow_direction
    when 1
      sailcat_draw_text(x-1,y+1,width,height,text,align)
    when 3
      sailcat_draw_text(x+1,y+1,width,height,text,align)
    when 7
      sailcat_draw_text(x-1,y-1,width,height,text,align)
    when 9
      sailcat_draw_text(x+1,y-1,width,height,text,align)
    end
  self.font.color=color_temp
  end
  sailcat_draw_text(x,y,width,height,text,align)
  end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
我用默认了……你可以看着修改下……
作者: 三角龙    时间: 2007-4-30 07:12
提示: 作者被禁止或删除 内容自动屏蔽
作者: gpra8764    时间: 2007-4-30 07:27
提示: 作者被禁止或删除 内容自动屏蔽
作者: 七夕小雨    时间: 2007-4-30 07:30
恩……真是个有才的描边算法……


作者: 幻の飞鱼    时间: 2007-4-30 10:23
原来的彩虹用的也是这个描边
现在正想要这个呢^_^
作者: 精灵使者    时间: 2007-4-30 15:34
测试的描边算法在字体压缩的时间阴影也会压缩吗?
以前我用过阴影菜单脚本,那个脚本在字体压缩的时候仍然描绘原来的阴影,于是就出错。
我那段脚本好像没这个现象。
不知道你这个脚本问题如何。
按照默认,如果一行字显示字数过多,rmxp会把字体自动压缩。
作者: gpra8764    时间: 2007-4-30 20:40
提示: 作者被禁止或删除 内容自动屏蔽
作者: 叶舞枫    时间: 2007-4-30 20:46
发布完毕,
VIP += 2
http://rpg.blue/web/htm/news701.htm

作者: gpra8764    时间: 2007-4-30 20:52
提示: 作者被禁止或删除 内容自动屏蔽
作者: 七夕小雨    时间: 2007-4-30 20:52
{/se}{/se}羡慕啊~~




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1