\hypertarget{embryo_set_state_8edc-example}{}\doxysection{embryo\+\_\+set\+\_\+state.\+edc}
This example shows how to change the state of a part from embryo code.

This example shows how to change the state of a part from embryo code.


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{collections\ \{}
\DoxyCodeLine{\ \ \ group\ \{\ name:\ "{}main"{};}
\DoxyCodeLine{\ \ \ \ \ \ parts\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ part\ \{\ name:\ "{}bg"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ type:\ RECT;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{\ state:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color:\ 255\ 255\ 255\ 255;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ part\ \{\ name:\ "{}label"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ type:\ TEXT;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{\ state:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color:\ 0\ 0\ 0\ 255;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ text\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ text:\ "{}Click\ me."{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ font:\ "{}Sans"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ size:\ 12;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ align:\ 0.0\ 0.7;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ part\ \{\ name:\ "{}red\_rect"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ type:\ RECT;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{\ state:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color:\ 255\ 0\ 0\ 255;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ max:\ 30\ 30;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ align:\ 0.1\ 0.2;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{\ state:\ "{}default"{}\ 1.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ inherit:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color:\ 0\ 0\ 255\ 255;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ align:\ 0.9\ 0.2;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ programs\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ program\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ signal:\ "{}mouse,down,1"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ source:\ "{}label"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ script\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ set\_state(PART:"{}red\_rect"{},\ "{}default"{},\ 1.0);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \}}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 