Class: MovieMaker::Gosu::Sprite
- Inherits:
-
Object
- Object
- MovieMaker::Gosu::Sprite
- 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
-
#angle ⇒ Object
Returns the value of attribute angle.
-
#color ⇒ Object
Returns the value of attribute color.
-
#draw_mode ⇒ Object
Returns the value of attribute draw_mode.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#height_scaling ⇒ Object
Returns the value of attribute height_scaling.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#width_scaling ⇒ Object
Returns the value of attribute width_scaling.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(file, options = {}) ⇒ Sprite
constructor
A new instance of Sprite.
-
#realign_center ⇒ Object
Only relevant with rubygame.
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, = {}) @x = [:x] || 0 @y = [:y] || 0 @draw_mode = [: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
#angle ⇒ Object
Returns the value of attribute angle.
97 98 99 |
# File 'lib/movie_maker/sprite.rb', line 97 def angle @angle end |
#color ⇒ Object
Returns the value of attribute color.
97 98 99 |
# File 'lib/movie_maker/sprite.rb', line 97 def color @color end |
#draw_mode ⇒ Object
Returns the value of attribute draw_mode.
97 98 99 |
# File 'lib/movie_maker/sprite.rb', line 97 def draw_mode @draw_mode end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
96 97 98 |
# File 'lib/movie_maker/sprite.rb', line 96 def file @file end |
#height_scaling ⇒ Object
Returns the value of attribute height_scaling.
97 98 99 |
# File 'lib/movie_maker/sprite.rb', line 97 def height_scaling @height_scaling end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
96 97 98 |
# File 'lib/movie_maker/sprite.rb', line 96 def image @image end |
#width_scaling ⇒ Object
Returns the value of attribute width_scaling.
97 98 99 |
# File 'lib/movie_maker/sprite.rb', line 97 def width_scaling @width_scaling end |
#x ⇒ Object
Returns the value of attribute x.
97 98 99 |
# File 'lib/movie_maker/sprite.rb', line 97 def x @x end |
#y ⇒ Object
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_center ⇒ Object
Only relevant with rubygame
112 113 114 |
# File 'lib/movie_maker/sprite.rb', line 112 def realign_center nil end |