This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
starting:features [2017/10/04 17:13] simplesi |
starting:features [2017/10/05 06:15] (current) simplesi |
||
---|---|---|---|
Line 3: | Line 3: | ||
in no particular order..... | in no particular order..... | ||
+ | * [[starting:nested|Nested Objects]] | ||
- | ===== Nested Objects - Attach one object to another one ===== | ||
- | GP allows you to build up a composite object | ||
- | Visual programming creates new approaches to solve new problems. Sprite nesting is a great example for this. It creates a hierarchy between two objects by making one the owner and the other one a part. | ||
- | Lets say you have two objects, a wheel and a car body. You can combine them into a single composite object by dragging the wheel onto the car and then shift-right-clicking on the wheel and selecting "attach..." from the menu. | ||
- | |||
- | This will present a menu of objects to which you can attach the wheel. Select car here to nest the wheel into it. | ||
- | Now the combined object made out of the car and the wheel acts like a single object. | ||
- | |||
- | If the car is moved about - the wheel will move with it | ||
- | |||
- | But because the wheel is actually its own object, you could make it spin around its own axis while the car is moving to give a much better visual effect. | ||
- | |||
- | |||
- | //**Developer Mode Only:** After two objects have been nested this way, they can reference each other using the reporter blocks "owner" (reports owner of block), and "parts" (reports list of parts); they can be found in the "Structure" category.// | ||
- | |||
- | Checkout the Ferris Wheel example in the GP examples folder to see this facility in action. | ||