Maps in EDC file

This code snippet demonstrates how to rotate parts in .edc file using maps. It uses a basic animation triggered by mouse click to show rotation process.
collections {
   group {
		name: "main";
		parts{
			 part {
			 	name: "rectangle";
            type: RECT;
            mouse_events: 1;
            description { 
            	state: "default" 0.0;
               rel1.relative: 0.25 0.25; 
               rel2.relative: 0.75 0.75;
               color: 130 130 200 255;
               map {
               		on: 1;
               		rotation.x: 0;
               		perspective_on: 1;
               }
            }
            description { 
            	state: "rotated" 0.0;
					inherit: "default" 0.0;
					color: 130 130 200 255;
               map {
               		rotation.x: 65;
               }
            }
         }
   	}
      programs {
         program {
            name: "animation";
            signal: "mouse,down,*";
            source: "rectangle";
            action: STATE_SET "rotated" 0.0;
            transition: LINEAR 1.0;
            target: "rectangle";
         }
      }      
	}
}

Responses

0 Replies