Class: Shoes::Star

Inherits:
ShapeBase show all
Defined in:
lib/shoes/basic.rb,
lib/shoes/style.rb

Instance Attribute Summary

Attributes inherited from Basic

#args, #dps, #initials, #ln, #parent, #pl

Attributes included from Mod

#hover_proc, #hovered, #leave_proc, #margin_bottom, #margin_left, #margin_right, #margin_top

Instance Method Summary collapse

Methods inherited from Basic

#center_at, #clear, #fix_size, #hide, #initialize, #move, #move2, #positioning, #set_args, #show, #toggle

Methods included from Mod

#click, #hided, #hover, #leave, #release, #set_margin

Constructor Details

This class inherits a constructor from Shoes::Basic

Instance Method Details

#move3(x, y) ⇒ Object



181
182
183
184
185
186
187
188
189
# File 'lib/shoes/basic.rb', line 181

def move3 x, y
  unless @app.cs.isDisposed
    w, h = @width + @strokewidth + 1, @height + @strokewidth + 1
    hw, hh = w / 2, h / 2
    @app.cs.redraw @left - hw, @top - hh, w, h, false
    @app.cs.redraw x-hw, y - hh, w, h, false
  end
  @left, @top = x, y
end

#style(args = nil) ⇒ Object



25
26
27
28
29
30
# File 'lib/shoes/style.rb', line 25

def style args = nil
  return @args unless args
  set_args args
  w, h = @width+@strokewidth+1, @height+@strokewidth+1
  @app.cs.redraw @left-w/2 , @top-h/2, w, h, false unless @app.cs.isDisposed
end