Class: Ronela::ImagenColor
Overview
Como imagen pero de un solo color
Instance Attribute Summary
Attributes inherited from Imagen
#fondo, #imagen, #mostrando, #posicion, #tipo, #x, #y
Instance Method Summary collapse
-
#initialize(color, ancho = nil, alto = nil) ⇒ ImagenColor
constructor
A new instance of ImagenColor.
Methods inherited from Imagen
#cargar_variables, #dibujar, #es_escena, #es_imagen, #limpiar, #limpiar_de_antes, #posicion_a_xy
Constructor Details
#initialize(color, ancho = nil, alto = nil) ⇒ ImagenColor
Returns a new instance of ImagenColor.
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/ronela.rb', line 314 def initialize(color, ancho=nil, alto=nil) iancho = $config[:PANTALLA_ANCHO] ialto = $config[:PANTALLA_ALTO] iancho = ancho if !ancho.nil? and ancho > 0 ialto = alto if !alto.nil? and alto > 0 @imagen = SDL::Surface.new($pantalla.flags, iancho, ialto, $pantalla.format) @imagen.fillRect(0, 0, iancho, ialto, Color::html_a_sdl(color)) @fondo = nil @posicion = nil @x = 0 @y = 0 @mostrando = false @color = color end |