Sha256: b3f518c3d2e0bf2715f9a759db40a58b8b8e220cf17033864932fdc7dac461d3

Contents?: true

Size: 821 Bytes

Versions: 4

Compression:

Stored size: 821 Bytes

Contents

#  frozen_string_literal: true

b = box({ left: 333, color: :blue, smooth: 6, id: :the_box2 })

t=text({id: :the_text, data: 'type of touch : ?'})

t.touch(:down) do |event|
  puts :down
  puts event[:pageX]
  puts event[:pageY]
  b.touch({remove: :down})
   # b.touch(:remove) # or  b.touch(false) to remove all touches bindings
  t.data('touch down killed')
end
b.touch(true) do
  puts :true
  b.color(:red)
  puts 'box tapped'
end

b.touch(:long) do
  puts :long
  t.data('type of touch is : long ')
  b.color(:black)
end

b.touch(:up) do
  puts :up
  t.data('type of touch is : up ')
  b.color(:orange)
end

b.touch(:down) do
  puts :down
  t.data('type of touch is : down ')
  b.color(:white)
end

b.touch(:double) do
  puts :double
  t.color(:red)
  t.data('type of touch is : double ')
  b.color(:yellowgreen)
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
atome-0.5.7.3.0 vendor/assets/application/examples/touch.rb
atome-0.5.7.1.8 vendor/assets/application/examples/touch.rb
atome-0.5.7.1.7 vendor/assets/application/examples/touch.rb
atome-0.5.7.1.0 vendor/assets/application/examples/touch.rb