Ruby GUI ShoesのArt

top

RubyのGUIソフトの「Shoes」のArtの使い方を紹介します。

top

arc

扇型を表示します。
x座標、y座標、幅、高さ、開始角度、終了角度


Shoes.app do
  fill red
  arc(300, 100, 100, 150, 0, Shoes::TWO_PI)
  arc(300, 200, 100, 150, 0, Shoes::PI)
  arc(300, 300, 100, 150, 0, Shoes::PI/2)
end
 



arrow

矢印を描画します。
x座標、y座標、幅


Shoes.app do
  fill blueviolet
  arrow(30,50,100)
end


star

星形を描きます。
x座標、y座標、角の数


Shoes.app do
  fill "../img/mizutama.png"
  star 200, 200, 5
end


nofill

内部が透明の輪郭だけの図形を描画します。


Shoes.app do
  nofill 
  star 100, 100, 6
end


nostroke

輪郭のない図形を描画します。


Shoes.app do
  fill blue
  star 100, 100, 6
  nostroke
  star 100, 300, 6
end


line

線を引きます。
開始x座標、開始y座標、終了x座標、終了y座標


Shoes.app do
  stroke red
  line 10,20,300,40
end


oval

楕円を描画します。
x座標、y座標,半径


Shoes.app do
  stroke blue
  strokewidth 4
  fill black
  oval 10, 10, 50
end


rect

四角を描画します。
x座標、y座標,幅、高さ


Shoes.app do
  stroke rgb(0.5, 0.5, 0.7)
  fill rgb(1.0, 1.0, 0.9)
  rect 10, 10, self.width - 20, self.height - 20
end

rotate

回転します。


Shoes.app do
  stroke blue
  strokewidth 4
  fill black
  rect 10, 10, 50,50
  rotate 45 
  rect 100, 10, 50,50
end


translate

描画位置を移動します。


Shoes.app do
  fill red(0.2)
  rect(50, 55, 50, 50)
  fill blue(0.2)
  translate(50, 50) 
  rect(50, 55, 50, 50)
end