Make text transparent in Shoes.app

。_饼干妹妹 提交于 2019-12-24 02:13:26

问题


Is there a way in Shoes to have text show up transparent? I have:

Shoes.app{
  para "Text", :stroke => rgb(1.0,0.0,0.0,0.5), :size => 100
}

But it's just showing up 100% red. I know opacity works for fill, does it also work for stroke? (I am developing with Shoes Raisins Revision 1134 on Mac OS X 10.4.11) Thanks in advance


回答1:


Alpha works on both stroke and fill, but not for text. For example, this code will draw a 50% transparent blue circle over the text:

Shoes.app do
  para "Text", :stroke => rgb(1.0,0.0,0.0,0.5), :fill => rgb(0, 1.0, 0, 0.5), :size => 100
  stroke rgb(0,0,1.0,0.5)
  strokewidth 4
  nofill
  oval 10, 10, 50
end

Note that not only is the para's stroke not transparent, but neither is the fill. To my knowledge there is no way to get transparent text out of Shoes, although I suppose if you made the text into a transparent image beforehand and loaded it, it might be transparent. I haven't tried that, though, and even if it works, it's probably of limited usefulness.




回答2:


Here is a workaround from the _why archive. You can use text on a mask layer and a transparent fill block to get actual transparent text.

Shoes.app do
  20.times do |i|
    strokewidth 4
    stroke rgb((0.0..0.5).rand, (0.0..1.0).rand, (0.0..0.3).rand)
    line 0, i * 4, 400, i * 4
  end

  mask do
    title "Shoes"
  end
end


来源:https://stackoverflow.com/questions/1214308/make-text-transparent-in-shoes-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!