Class: RbSDL2::Window::Shape::WindowShapeMode
- Inherits:
-
SDL::WindowShapeMode
- Object
- SDL::WindowShapeMode
- RbSDL2::Window::Shape::WindowShapeMode
- Defined in:
- lib/rb_sdl2/window/shape.rb
Instance Method Summary collapse
- #alpha_test ⇒ Object
- #alpha_test=(num) ⇒ Object
- #alpha_test? ⇒ Boolean
- #color_key ⇒ Object
- #color_key=(color) ⇒ Object
- #color_key? ⇒ Boolean
- #mode ⇒ Object
- #mode=(num) ⇒ Object
- #reverse_alpha_test? ⇒ Boolean
Instance Method Details
#alpha_test ⇒ Object
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
8 |
# File 'lib/rb_sdl2/window/shape.rb', line 8 def alpha_test? = [::SDL::ShapeModeBinarizeAlpha, ::SDL::ShapeModeDefault].include?(mode) |
#color_key ⇒ Object
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
16 |
# File 'lib/rb_sdl2/window/shape.rb', line 16 def color_key? = ::SDL::ShapeModeColorKey == mode |
#mode ⇒ Object
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
28 |
# File 'lib/rb_sdl2/window/shape.rb', line 28 def reverse_alpha_test? = ::SDL::ShapeModeReverseBinarizeAlpha == mode |