Class: Hokusai::Input
- Inherits:
-
Object
- Object
- Hokusai::Input
- Defined in:
- ui/src/hokusai/types.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #hash ⇒ Object
- #hovered?(canvas) ⇒ Boolean
-
#initialize(raw) ⇒ Input
constructor
A new instance of Input.
- #keyboard ⇒ Object
- #mouse ⇒ Object
Constructor Details
#initialize(raw) ⇒ Input
Returns a new instance of Input.
250 251 252 |
# File 'ui/src/hokusai/types.rb', line 250 def initialize(raw) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
244 245 246 |
# File 'ui/src/hokusai/types.rb', line 244 def raw @raw end |
Instance Method Details
#hash ⇒ Object
246 247 248 |
# File 'ui/src/hokusai/types.rb', line 246 def hash [self.class, mouse.pos.x, mouse.pos.y, mouse.scroll, mouse.left.clicked, mouse.left.down, mouse.left.up].hash end |
#hovered?(canvas) ⇒ Boolean
262 263 264 |
# File 'ui/src/hokusai/types.rb', line 262 def hovered?(canvas) LibHokusai.hoku_input_is_hovered(raw, canvas.to_hoku_rect) end |