Scratch Skills - use cloning technology to achieve the Menu button

        Yesterday told cloning technology to a specific application: the Build menu button. Some kids can not wait to experiment a bit and found the menu button is generated, but how to trigger the appropriate button functions? Trigger processing function codes are the clones which realize Oh. See Case:

Scratch the use of cloning technology skills ---- Menu button

 

 

When you start the program, to hide the body, and then clone the menu button:

Scratch the use of cloning technology skills ---- Menu button

 

 

Clones after startup, the first molding generated by switching the menu button:

Scratch the use of cloning technology skills ---- Menu button

 

 

Then for the current clone to detect whether there is click event occurs when the mouse is moved above the current button, the button will have a more transparent effect, move the mouse to restore the original effect. If the mouse is over the button, and the mouse button is pressed, it is determined that the name of the current style menu button clones (numbers also determine the shape), thus giving a global variable assignment, press the menu button to clear which a, then a broadcast message to inform other roles for processing. (In fact, can also be directly broadcast messages to different users is the difference between what a menu button pressed):

Scratch the use of cloning technology skills ---- Menu button

 

 

After receiving the message, the deletion of this clone (menu button does not show this character a)

 

 

Scratch the use of cloning technology skills ---- Menu button

Guess you like

Origin www.cnblogs.com/scratch3/p/10935792.html