Class: Reight::MapEditor::Brush
- Defined in:
- lib/reight/app/map/brush.rb
Instance Attribute Summary
Attributes inherited from Tool
Attributes inherited from Button
Instance Method Summary collapse
- #brush(cursor_from, cursor_to, chip) ⇒ Object
- #canvas_pressed ⇒ Object
- #canvas_released ⇒ Object
-
#initialize(app, &block) ⇒ Brush
constructor
A new instance of Brush.
Methods inherited from BrushBase
#canvas_clicked, #canvas_dragged, #canvas_moved, #put_or_remove_chip, #update_cursor
Methods inherited from Tool
#canvas, #canvas_clicked, #canvas_dragged, #canvas_moved, #chips, #history, #name, #pick_chip
Methods inherited from Button
#click, #disabled?, #disabled_icon, #draw, #enabled?, #hover, #pressed, #pressing?, #released, #sprite
Methods included from HasHelp
Methods included from Hookable
Methods included from Activatable
#activated, #activated!, #active=, #active?
Constructor Details
#initialize(app, &block) ⇒ Brush
Returns a new instance of Brush.
6 7 8 9 |
# File 'lib/reight/app/map/brush.rb', line 6 def initialize(app, &block) super app, icon: app.icon(1, 2, 8), &block set_help left: name, right: 'Pick Chip' end |
Instance Method Details
#brush(cursor_from, cursor_to, chip) ⇒ Object
11 12 13 14 15 |
# File 'lib/reight/app/map/brush.rb', line 11 def brush(cursor_from, cursor_to, chip) x, y, = cursor_to put_or_remove_chip x, y, chip false end |
#canvas_pressed ⇒ Object
17 18 19 20 |
# File 'lib/reight/app/map/brush.rb', line 17 def canvas_pressed(...) canvas.begin_editing super end |
#canvas_released ⇒ Object
22 23 24 25 |
# File 'lib/reight/app/map/brush.rb', line 22 def canvas_released(...) super canvas.end_editing end |