Class: Okami::ImageAttributes

Inherits:
Object
  • Object
show all
Defined in:
lib/okami/image_attributes.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

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 options
  @x = options[:x] || self.class.default_x
  @y = options[:y] || self.class.default_y
  @z = options[:z] || self.class.default_z
  
  @wrapping_angle = Okami::WrappingAngle.new
  @wrapping_angle.degrees = options[:angle] || self.class.default_angle
  @degrees = @wrapping_angle.degrees
  
  @center_x = options[:center_x] || self.class.default_center_x
  @center_y = options[:center_y] || self.class.default_center_y
  @factor_x = options[:factor_x] || 1
  @factor_y = options[:factor_y] || 1    
  
  @color     = options[:color]     || Gosu::Color.argb(255, 255, 255, 255)
  @mode = options[:mode] || :default
end

Class Attribute Details

.default_angleObject

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_xObject

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_yObject

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_xObject

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_yObject

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_zObject

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_xObject

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_yObject

Returns the value of attribute center_y.



17
18
19
# File 'lib/okami/image_attributes.rb', line 17

def center_y
  @center_y
end

#colorObject

Returns the value of attribute color.



18
19
20
# File 'lib/okami/image_attributes.rb', line 18

def color
  @color
end

#factor_xObject

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_yObject

Returns the value of attribute factor_y.



16
17
18
# File 'lib/okami/image_attributes.rb', line 16

def factor_y
  @factor_y
end

#modeObject

Returns the value of attribute mode.



18
19
20
# File 'lib/okami/image_attributes.rb', line 18

def mode
  @mode
end

#xObject

Returns the value of attribute x.



15
16
17
# File 'lib/okami/image_attributes.rb', line 15

def x
  @x
end

#yObject

Returns the value of attribute y.



15
16
17
# File 'lib/okami/image_attributes.rb', line 15

def y
  @y
end

#zObject

Returns the value of attribute z.



15
16
17
# File 'lib/okami/image_attributes.rb', line 15

def z
  @z
end

Instance Method Details

#degreesObject 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

#fractionObject



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

#radiansObject



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_aObject 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