Sha256: 72f87fca8509edb4312f0ab6e7fdd1dc3c4bd74535ed9a7be41287802a5cd1b6

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

# select example

start = text({ content: "click me to start selecting", x: 30, y: 69, atome_id: :the_text_0 })
stop = text({ content: "click me twice to stop selecting", x: 30, y: 96, atome_id: :the_text_1 })

box(x: 300, y: 300, drag: true, atome_id: :the_box)

text({ content: :hello, y: 300, x: 400, drag: true, atome_id: :the_text_1 })

box({ y: 300, x: 500, color: :red, atome_id: :the_circle, smooth: 9, width: 39, height: 39 })

circle({ center: true, atome_id: :the_circle_2, color: :black, width: 39, height: 39 })
treated_item=[]
start.touch do
  start.content("selection activated").color(:red)
  stop.content("click me twice to stop selecting").color(:black)
  grab(:view).selectable(true) do
    selection.each do |atome_found|
      treated_item << atome_found
    end
    selection.color([:yellowgreen, :green]).drag(true).shadow({ color: :black, thickness: 0, x: 0, y: 0, blur: 6 })
  end
end

stop.touch(option: :up) do
  stop.content("selection desactivated").color(:red)
  start.content("click me to start selecting").color(:black)
  treated_item.each do |item_found|
    item_found.color(:red).drag(:destroy)
  end
  grab(:view).selectable(:destroy)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
atome-0.4.7.0 vendor/assets/build/medias/rubies/examples/Old_examples/select.rb
atome-0.4.5.4 vendor/assets/build/medias/rubies/examples/Old_examples/select.rb