Class: Ronela::ImagenColor

Inherits:
Imagen
  • Object
show all
Defined in:
lib/ronela.rb

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

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