Class RGhost::Circle
In: circle.rb
Parent: RGhost::PsObject

Draw a circle to the current path(or current row by default).

Options

  • :x and :y - as center of the circle.
  • :radius - as radius(in points).
  • :ang1 - the angle of a vector from (:x , :y ) of length :radius to the first endpoint of the circle.
  • :ang2 - the angle of a vector from (:x, :y) of length :radius to the second endpoint of the circle.
  • :content - facade to ShapeContent with same parameters.
  • :border - facade to Border with same parameters.
  • :use - :arc draw counterclockwise and :arcn (arc negative) clockwise direction.

Examples using facade circle method inside of Document

  d=Document.new
  d.circle :x => 5, :y => 2.5 , :radius => 40

  d=Document.new
  d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:fill => false}

  d=Document.new
  d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:color => "#FF0000"}

  d=Document.new
  d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:color => "#FF0000"} ,:border => {:color => "#FFFFFF"}

  d=Document.new
  d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:color => :yellow} ,:border => {:color => :orange, :dash => [1,2,1,2], :width => 20}

   d=Document.new
   colors=%w[#98AE09 #AFE099 #A971FF #CC1010 #FF7201 #34FEE1]
   6.downto(1) do |v|
     d.circle :x => 5, :y => 2.5 , :radius => v*10, :content =>{:color => colors[v]}
   end

 d=Document.new
 d.circle :x => 5, :y => 2.5 , :ang1 => 90, :radius => 50, :content => {:fill => false }

 d=Document.new
 d.circle :x => 5, :y => 2.5 , :ang2 => 90, :radius => 50, :content => {:fill => false }

 d=Document.new
 d.circle :x => 5, :y => 2.5 , :ang2 => 90, :radius => 50, :content =>{:color => :green}

 d=Document.new
 d.circle :x => 5, :y => 2.5 , :ang2 => 90, :use => :arcn, :radius => 50, :content =>{:color => :green}

Examples using Circle class

   d=Document.new
   d.scale(3,1)
   d.set Circle.new(:x => 1.5, :y => 1.5 , :ang2 => 180, :radius => 25)

Methods

new   ps  

Constants

DEFAULT_OPTIONS = { :x => :limit_left, :y=> :current_row, :radius => 50, :ang1 => 0, :ang2 => 360 , :use => :arc, :content => RGhost::ShapeContent::DEFAULT_OPTIONS, :border => RGhost::Border::DEFAULT_OPTIONS

Public Class methods

Public Instance methods

[Validate]