Sha256: 1a1d92925082653c5baf2083f6b8152dbe3da302b065da576c275fb5f9733ff7

Contents?: true

Size: 722 Bytes

Versions: 2

Compression:

Stored size: 722 Bytes

Contents

b=box({drag: true,atome_id: :the_box})
t=b.text({content: :hello, atome_id: :the_text})
b.text({content: :cool, x: 72, atome_id: :the_text_1})
b.text({content: :super, y: 66, atome_id: :the_text_2})
b.text({content: "too much", y: 66, x: 96,  atome_id: :the_text_3})
b.circle({x: 333, atome_id: :the_circle})
t.center(:all)
# we can treat all text of b using .each
b.circle.each do |circles_founc|
  circles_founc.color(:green)
end
# or iterate  on the object type
b.text do |atome|
  atome.color(:orange)
end

ATOME.wait 2 do
  # or even directly setting the property
  b.text.color(:cyan)
  # or choose an atome
  b.text[2].color(:red)
  # or a range of atomes
  ATOME.wait 2 do
    b.text[0..1].color(:yellow)
  end
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/treat_object_in_object.rb
atome-0.4.5.4 vendor/assets/build/medias/rubies/examples/Old_examples/treat_object_in_object.rb