Class: Clogs::Video
- Defined in:
- lib/clogs/drawables/misc.rb
Instance Attribute Summary
Attributes inherited from Drawable
#abs_x, #abs_y, #children, #height, #parent, #shoes_linkable_id, #styles, #width, #x, #y
Instance Method Summary collapse
-
#draw(painter, x, y) ⇒ Object
libui has no media support at all, so this is an honest placeholder rather than a silent no-op.
- #measure(available_width) ⇒ Object
Methods inherited from Drawable
#add_child, #app, #clickable?, #contains?, #destroy_self, #each_peer, #focus_gained, #focus_lost, #focusable?, for_shoes_class, #hidden?, #initialize, #margin, #needs_layout!, #notify, #on_click, #on_key, #on_mouse_move, #on_release, #paint, #positioned?, #properties_changed, #redraw!, #remove_child, #requested_height, #requested_width, #set_parent, #style
Constructor Details
This class inherits a constructor from Clogs::Drawable
Instance Method Details
#draw(painter, x, y) ⇒ Object
libui has no media support at all, so this is an honest placeholder rather than a silent no-op.
94 95 96 97 98 99 100 101 |
# File 'lib/clogs/drawables/misc.rb', line 94 def draw(painter, x, y) painter.fill_rect(x, y, @width, @height, [20, 20, 20, 255]) painter.draw(fill: [200, 200, 200, 255]) do |p| cx = x + @width / 2.0 cy = y + @height / 2.0 p.move_to(cx - 12, cy - 16).line_to(cx + 16, cy).line_to(cx - 12, cy + 16).close end end |
#measure(available_width) ⇒ Object
87 88 89 90 |
# File 'lib/clogs/drawables/misc.rb', line 87 def measure(available_width) @width = requested_width(available_width) || 320 @height = requested_height(available_width) || 240 end |