vendor/assets/src/medias/rubies/examples/_2_solve.rb in atome-0.5.2.8 vs vendor/assets/src/medias/rubies/examples/_2_solve.rb in atome-0.5.3.2
- old
+ new
@@ -10,49 +10,63 @@
text({ data: :hello })
end
c.run('it works')
-# object in object
+###### SOLVED ##### : object in object
-a = box({ width: 333, height: 333, id: :the_boxy })
-a.color(:red)
-b = a.box({ width: 33, height: 33, id: :the_box, drag: true })
-b.color(:black)
+# a = box({ width: 333, height: 333, id: :the_boxy })
+# a.color(:red)
+# b = a.box({ width: 33, height: 33, id: :the_box, drag: true })
+# b.color(:black)
+#
+# # color doesn't work
+# circle({ id: :circle_123, color: :cyan, left: 233 })
-# color doesn't work
-circle({ id: :circle_123, color: :cyan, left: 233 })
+###### SOLVED ##### : big performance problem plus params as left is not interpreted
-# big performance problem plus params as left is not interpreted
+# i = 0
+# while i < 16
+# b = box({ width: 33, height: 33 })
+# b.color(:red)
+# b.left((33 + 10) * i)
+# i += 1
+# # b.drag(true)
+# end
-i = 0
-while i < 16
- b = box({ width: 33, height: 33 })
- b.parents([:the_grid])
- b.color(:red)
- b.left((33 + 10) * i)
- i += 1
- # b.drag(true)
-end
+###### SOLVED ##### : .color (return the color itself instead of the box ) and .red return itself too so it's impossible to set green and blue
+# another problem : when setting .red it reset the whole color object and remove green an blue components
+# box({id: :mybox})
+# grab(:my_box).smooth(6).color(:black).red(0.6).green(0.6).blue(0.6)
-# .color (return the color itself instead of the box ) and .red retrun itself too so it's impossible to set green and blue
-# another problem : when steeing .red it reset the whole color object and remove green an blue components
-box({id: :mybox})
-grab(:my_box).smooth(6).color(:black).red(0.6).green(0.6).blue(0.6)
# color can't be changed easily
b=box
b.color.red(1)
-# box in box doesn't work( incorrect node tree error)
-b=box({id: :mybox, width: 666, height: 555})
+# ###### SOLVED ##### : box in box doesn't work( incorrect node tree error)
+# b=box({id: :mybox, width: 666, height: 555})
+#
+# b.box()
-b.box()
+# ###### SOLVED ##### atome i, atome using preset doesn't work
+#
+# b=box
+# c=b.box
+# c.left(200)
-# atome i, atome using preset doesn't work
+# Children doesn't work
+box({ id: :the_box })
+circle({ top: 300, id: :circle098 })
+
+t = text({ data: :hello })
+t.children[:the_box, :circle098]
+
+
+# if id change then we can't add color
b=box
-c=b.box
-c.left(200)
+b.id(:new_id)
+b.color(:blue)