Sha256: 132dbb76af2458c2deccd1eb59668185f1970564ca4e54e6c96f1f8eb524af0a

Contents?: true

Size: 1.89 KB

Versions: 12

Compression:

Stored size: 1.89 KB

Contents

# frozen_string_literal: true

# new({ particle: :duplicate, store: false }) do |params|
#   if @duplicate
#     copy_number = @duplicate.length
#   else
#     copy_number = 0
#   end
#
#   new_atome_id = "#{@id}_copy_#{copy_number}"
#   new_atome = Atome.new({ type: @type, renderers: @renderers, id: new_atome_id })
#
#   fasten_atomes = []
#   fasten_found = fasten.dup
#   particles_found = instance_variables.dup
#
#   particles_found.delete(:@history)
#   particles_found.delete(:@callback)
#   particles_found.delete(:@duplicate)
#   particles_found.delete(:@touch_code)
#   # touch_code=instance_variable_get('@touch_code')
#   particles_found.delete(:@html)
#   particles_found.delete(:@fasten)
#   particles_found.delete(:@id)
#   params[:id] = new_atome_id
#   fasten_found.each do |child_id_found|
#     child_found = grab(child_id_found)
#     if child_found
#       new_child = child_found.duplicate({})
#       fasten_atomes << new_child.id
#     end
#   end
#   particles_found.each do |particle_found|
#     particle_name = particle_found.to_s.sub('@', '')
#     particle_content = self.send(particle_name)
#     new_atome.set(particle_name => particle_content)
#     # new_atome.instance_variable_set('@touch_code',touch_code)
#   end
#   params[:fasten] = fasten_atomes
#
#   if params.instance_of? Hash
#     params.each do |k, v|
#       new_atome.send(k, v)
#     end
#   end
#
#   @duplicate ||= {}
#   @duplicate[new_atome_id] = new_atome
#   new_atome
# end
#
# new({ after: :duplicate }) do |params|
#   @duplicate[@duplicate.keys[@duplicate.keys.length - 1]]
# end
# c=circle
# c.color({red: 1, id: :titi})
# # b=box({apply: [:titi], left: 123})


b = circle({ id: :the_circle })
b.text(:hello)
bb = b.duplicate({  width: 33, left: 234, top: 222 })
bb.color(:red)
wait 1 do
bb2 = b.duplicate({ width: 33, left: 12, top: 99 })
bb3 = b.duplicate({ width: 33, left: 444 })
bb3.color(:green)
bb2.color(:orange)
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
atome-0.5.7.6.5 vendor/assets/src/medias/utils/examples/particles/duplicate/example.rb
atome-0.5.7.6.0 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.5.9 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.5.4 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.5.3 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.5.1 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.4.8 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.4.7 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.4.6 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.4.3 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.4.2 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.3.9 vendor/assets/application/examples/duplicate.rb