Module: RbSDL2::Window::Size
- Included in:
- RbSDL2::Window
- Defined in:
- lib/rb_sdl2/window/size.rb
Instance Method Summary collapse
- #height ⇒ Object (also: #h)
- #height=(num) ⇒ Object (also: #h=)
- #maximum_size ⇒ Object
- #maximum_size=(w_h) ⇒ Object
- #minimum_size ⇒ Object
- #minimum_size=(w_h) ⇒ Object
- #size ⇒ Object
- #size=(w_h) ⇒ Object
- #width ⇒ Object (also: #w)
- #width=(num) ⇒ Object (also: #w=)
Instance Method Details
#height ⇒ Object Also known as: h
4 5 6 7 8 |
# File 'lib/rb_sdl2/window/size.rb', line 4 def height ptr = ::FFI::MemoryPointer.new(:int) ::SDL2.SDL_GetWindowSize(self, nil, ptr) ptr.read_int end |
#height=(num) ⇒ Object Also known as: h=
11 12 13 |
# File 'lib/rb_sdl2/window/size.rb', line 11 def height=(num) self.size = [w, num] end |
#maximum_size ⇒ Object
16 17 18 19 20 |
# File 'lib/rb_sdl2/window/size.rb', line 16 def maximum_size w_h = Array.new(2) { ::FFI::MemoryPointer.new(:int) } ::SDL2.SDL_GetWindowMaximumSize(self, *w_h) w_h.map(&:read_int) end |
#maximum_size=(w_h) ⇒ Object
22 23 24 |
# File 'lib/rb_sdl2/window/size.rb', line 22 def maximum_size=(w_h) ::SDL2.SDL_SetWindowMaximumSize(self, *w_h) end |
#minimum_size ⇒ Object
26 27 28 29 30 |
# File 'lib/rb_sdl2/window/size.rb', line 26 def minimum_size w_h = Array.new(2) { ::FFI::MemoryPointer.new(:int) } ::SDL2.SDL_GetWindowMinimumSize(self, *w_h) w_h.map(&:read_int) end |
#minimum_size=(w_h) ⇒ Object
32 33 34 |
# File 'lib/rb_sdl2/window/size.rb', line 32 def minimum_size=(w_h) ::SDL2.SDL_SetWindowMinimumSize(self, *w_h) end |
#size ⇒ Object
36 37 38 39 40 |
# File 'lib/rb_sdl2/window/size.rb', line 36 def size w_h = Array.new(2) { ::FFI::MemoryPointer.new(:int) } ::SDL2.SDL_GetWindowSize(self, *w_h) w_h.map(&:read_int) end |
#size=(w_h) ⇒ Object
42 43 44 |
# File 'lib/rb_sdl2/window/size.rb', line 42 def size=(w_h) ::SDL2.SDL_SetWindowSize(self, *w_h) end |
#width ⇒ Object Also known as: w
46 47 48 49 50 |
# File 'lib/rb_sdl2/window/size.rb', line 46 def width ptr = ::FFI::MemoryPointer.new(:int) ::SDL2.SDL_GetWindowSize(self, ptr, nil) ptr.read_int end |
#width=(num) ⇒ Object Also known as: w=
53 54 55 |
# File 'lib/rb_sdl2/window/size.rb', line 53 def width=(num) self.size = [num, h] end |