Class: RbSDL2::Window::Shape::WindowShapeMode

Inherits:
SDL::WindowShapeMode
  • Object
show all
Defined in:
lib/rb_sdl2/window/shape.rb

Instance Method Summary collapse

Instance Method Details

#alpha_testObject



6
# File 'lib/rb_sdl2/window/shape.rb', line 6

def alpha_test = self[:parameters][:binarizationCutoff]

#alpha_test=(num) ⇒ Object



10
11
12
# File 'lib/rb_sdl2/window/shape.rb', line 10

def alpha_test=(num)
  self[:parameters][:binarizationCutoff] = num
end

#alpha_test?Boolean

Returns:

  • (Boolean)


8
# File 'lib/rb_sdl2/window/shape.rb', line 8

def alpha_test? = [::SDL::ShapeModeBinarizeAlpha, ::SDL::ShapeModeDefault].include?(mode)

#color_keyObject



14
# File 'lib/rb_sdl2/window/shape.rb', line 14

def color_key = self[:parameters][:colorKey].values.first(3)

#color_key=(color) ⇒ Object



18
19
20
# File 'lib/rb_sdl2/window/shape.rb', line 18

def color_key=(color)
  self[:parameters][:colorKey].tap { |c| c[:r], c[:g], c[:b] = color }
end

#color_key?Boolean

Returns:

  • (Boolean)


16
# File 'lib/rb_sdl2/window/shape.rb', line 16

def color_key? = ::SDL::ShapeModeColorKey == mode

#modeObject



22
# File 'lib/rb_sdl2/window/shape.rb', line 22

def mode = self[:mode]

#mode=(num) ⇒ Object



24
25
26
# File 'lib/rb_sdl2/window/shape.rb', line 24

def mode=(num)
  self[:mode] = num
end

#reverse_alpha_test?Boolean

Returns:

  • (Boolean)


28
# File 'lib/rb_sdl2/window/shape.rb', line 28

def reverse_alpha_test? = ::SDL::ShapeModeReverseBinarizeAlpha == mode