Class: MovieMaker::Gosu::Sprite

Inherits:
Object
  • Object
show all
Defined in:
lib/movie_maker/sprite.rb

Overview

A basic spriteclass using rubygames Sprites::Sprite Autoloads a surface and initializes @rect

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}) ⇒ Sprite

Returns a new instance of Sprite.



98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/movie_maker/sprite.rb', line 98

def initialize(file, options = {})
	@x = options[:x] || 0
	@y = options[:y] || 0
	@draw_mode = options[:draw_mode] || :additive
	
	@file = file
	@image = Surface.autoload(@file)
	@angle = 0.0
	@width_scaling = 1.0
	@height_scaling = 1.0
	@color = ::Gosu::Color.new(0xffffffff)
end

Instance Attribute Details

#angleObject

Returns the value of attribute angle.



97
98
99
# File 'lib/movie_maker/sprite.rb', line 97

def angle
  @angle
end

#colorObject

Returns the value of attribute color.



97
98
99
# File 'lib/movie_maker/sprite.rb', line 97

def color
  @color
end

#draw_modeObject

Returns the value of attribute draw_mode.



97
98
99
# File 'lib/movie_maker/sprite.rb', line 97

def draw_mode
  @draw_mode
end

#fileObject (readonly)

Returns the value of attribute file.



96
97
98
# File 'lib/movie_maker/sprite.rb', line 96

def file
  @file
end

#height_scalingObject

Returns the value of attribute height_scaling.



97
98
99
# File 'lib/movie_maker/sprite.rb', line 97

def height_scaling
  @height_scaling
end

#imageObject (readonly)

Returns the value of attribute image.



96
97
98
# File 'lib/movie_maker/sprite.rb', line 96

def image
  @image
end

#width_scalingObject

Returns the value of attribute width_scaling.



97
98
99
# File 'lib/movie_maker/sprite.rb', line 97

def width_scaling
  @width_scaling
end

#xObject

Returns the value of attribute x.



97
98
99
# File 'lib/movie_maker/sprite.rb', line 97

def x
  @x
end

#yObject

Returns the value of attribute y.



97
98
99
# File 'lib/movie_maker/sprite.rb', line 97

def y
  @y
end

Instance Method Details

#realign_centerObject

Only relevant with rubygame



112
113
114
# File 'lib/movie_maker/sprite.rb', line 112

def realign_center
	nil
end