Class: Okami::ImageAttributes
- Inherits:
-
Object
- Object
- Okami::ImageAttributes
- Defined in:
- lib/okami/image_attributes.rb
Class Attribute Summary collapse
-
.default_angle ⇒ Object
Returns the value of attribute default_angle.
-
.default_center_x ⇒ Object
Returns the value of attribute default_center_x.
-
.default_center_y ⇒ Object
Returns the value of attribute default_center_y.
-
.default_x ⇒ Object
Returns the value of attribute default_x.
-
.default_y ⇒ Object
Returns the value of attribute default_y.
-
.default_z ⇒ Object
Returns the value of attribute default_z.
Instance Attribute Summary collapse
-
#center_x ⇒ Object
Returns the value of attribute center_x.
-
#center_y ⇒ Object
Returns the value of attribute center_y.
-
#color ⇒ Object
Returns the value of attribute color.
-
#factor_x ⇒ Object
Returns the value of attribute factor_x.
-
#factor_y ⇒ Object
Returns the value of attribute factor_y.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Instance Method Summary collapse
- #degrees ⇒ Object (also: #angle)
- #degrees=(a) ⇒ Object (also: #angle=)
- #fraction ⇒ Object
- #fraction=(a) ⇒ Object
-
#initialize(options) ⇒ ImageAttributes
constructor
A new instance of ImageAttributes.
- #radians ⇒ Object
- #radians=(a) ⇒ Object
- #rotate_degrees(a) ⇒ Object
- #rotate_fraction(a) ⇒ Object
- #rotate_radians(a) ⇒ Object
- #to_a ⇒ Object (also: #draw_rot_parameters)
Constructor Details
#initialize(options) ⇒ ImageAttributes
Returns a new instance of ImageAttributes.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/okami/image_attributes.rb', line 20 def initialize @x = [:x] || self.class.default_x @y = [:y] || self.class.default_y @z = [:z] || self.class.default_z @wrapping_angle = Okami::WrappingAngle.new @wrapping_angle.degrees = [:angle] || self.class.default_angle @degrees = @wrapping_angle.degrees @center_x = [:center_x] || self.class.default_center_x @center_y = [:center_y] || self.class.default_center_y @factor_x = [:factor_x] || 1 @factor_y = [:factor_y] || 1 @color = [:color] || Gosu::Color.argb(255, 255, 255, 255) @mode = [:mode] || :default end |
Class Attribute Details
.default_angle ⇒ Object
Returns the value of attribute default_angle.
12 13 14 |
# File 'lib/okami/image_attributes.rb', line 12 def default_angle @default_angle end |
.default_center_x ⇒ Object
Returns the value of attribute default_center_x.
12 13 14 |
# File 'lib/okami/image_attributes.rb', line 12 def default_center_x @default_center_x end |
.default_center_y ⇒ Object
Returns the value of attribute default_center_y.
12 13 14 |
# File 'lib/okami/image_attributes.rb', line 12 def default_center_y @default_center_y end |
.default_x ⇒ Object
Returns the value of attribute default_x.
12 13 14 |
# File 'lib/okami/image_attributes.rb', line 12 def default_x @default_x end |
.default_y ⇒ Object
Returns the value of attribute default_y.
12 13 14 |
# File 'lib/okami/image_attributes.rb', line 12 def default_y @default_y end |
.default_z ⇒ Object
Returns the value of attribute default_z.
12 13 14 |
# File 'lib/okami/image_attributes.rb', line 12 def default_z @default_z end |
Instance Attribute Details
#center_x ⇒ Object
Returns the value of attribute center_x.
17 18 19 |
# File 'lib/okami/image_attributes.rb', line 17 def center_x @center_x end |
#center_y ⇒ Object
Returns the value of attribute center_y.
17 18 19 |
# File 'lib/okami/image_attributes.rb', line 17 def center_y @center_y end |
#color ⇒ Object
Returns the value of attribute color.
18 19 20 |
# File 'lib/okami/image_attributes.rb', line 18 def color @color end |
#factor_x ⇒ Object
Returns the value of attribute factor_x.
16 17 18 |
# File 'lib/okami/image_attributes.rb', line 16 def factor_x @factor_x end |
#factor_y ⇒ Object
Returns the value of attribute factor_y.
16 17 18 |
# File 'lib/okami/image_attributes.rb', line 16 def factor_y @factor_y end |
#mode ⇒ Object
Returns the value of attribute mode.
18 19 20 |
# File 'lib/okami/image_attributes.rb', line 18 def mode @mode end |
#x ⇒ Object
Returns the value of attribute x.
15 16 17 |
# File 'lib/okami/image_attributes.rb', line 15 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
15 16 17 |
# File 'lib/okami/image_attributes.rb', line 15 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
15 16 17 |
# File 'lib/okami/image_attributes.rb', line 15 def z @z end |
Instance Method Details
#degrees ⇒ Object Also known as: angle
50 |
# File 'lib/okami/image_attributes.rb', line 50 def degrees; @wrapping_angle.degrees end |
#degrees=(a) ⇒ Object Also known as: angle=
55 |
# File 'lib/okami/image_attributes.rb', line 55 def degrees= a; @wrapping_angle.degrees = a; @degrees = @wrapping_angle.degrees end |
#fraction ⇒ Object
49 |
# File 'lib/okami/image_attributes.rb', line 49 def fraction; @wrapping_angle.fraction end |
#fraction=(a) ⇒ Object
54 |
# File 'lib/okami/image_attributes.rb', line 54 def fraction= a; @wrapping_angle.fraction = a; @degrees = @wrapping_angle.degrees end |
#radians ⇒ Object
48 |
# File 'lib/okami/image_attributes.rb', line 48 def radians; @wrapping_angle.radians end |
#radians=(a) ⇒ Object
53 |
# File 'lib/okami/image_attributes.rb', line 53 def radians= a; @wrapping_angle.radians = a; @degrees = @wrapping_angle.degrees end |
#rotate_degrees(a) ⇒ Object
46 |
# File 'lib/okami/image_attributes.rb', line 46 def rotate_degrees a; @wrapping_angle.rotate_degrees a; @degrees = @wrapping_angle.degrees end |
#rotate_fraction(a) ⇒ Object
45 |
# File 'lib/okami/image_attributes.rb', line 45 def rotate_fraction a; @wrapping_angle.rotate_fraction a; @degrees = @wrapping_angle.degrees end |
#rotate_radians(a) ⇒ Object
44 |
# File 'lib/okami/image_attributes.rb', line 44 def rotate_radians a; @wrapping_angle.rotate_radians a; @degrees = @wrapping_angle.degrees end |
#to_a ⇒ Object Also known as: draw_rot_parameters
38 39 40 |
# File 'lib/okami/image_attributes.rb', line 38 def to_a return @x, @y, @z, @degrees, @center_x, @center_y, @factor_x, @factor_y, @color, @mode end |