Class: Ruby2D::Pixel

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby2d/pixel.rb

Overview

Draw a single pixel by calling Pixel.draw(…)

Class Method Summary collapse

Class Method Details

.draw(x:, y:, size:, color:) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/ruby2d/pixel.rb', line 8

def self.draw(x:, y:, size:, color:)
  color = color.to_a if color.is_a? Color

  ext_draw([x, y,
            x + size, y,
            x + size, y + size,
            x, y + size,
            color[0], color[1], color[2], color[3]])
end