summaryrefslogtreecommitdiff
path: root/legacy/edje/doc
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2012-04-09 13:50:16 +0000
committerJonas M. Gastal <jgastal@profusion.mobi>2012-04-09 13:50:16 +0000
commit923d8ca03f93f2a758a390ef0bf2ada83296f161 (patch)
tree978545f5eeb4f9a2d187cf4a514bd5fb9d465207 /legacy/edje/doc
parent1772917ed52f36ecb084f7837cc526d7a3f2ee90 (diff)
Adding a new animation tutorial
Patch by: Guilherme Iscaro <iscaro@profusion.mobi> SVN revision: 69974
Diffstat (limited to 'legacy/edje/doc')
-rw-r--r--legacy/edje/doc/examples.dox90
1 files changed, 90 insertions, 0 deletions
diff --git a/legacy/edje/doc/examples.dox b/legacy/edje/doc/examples.dox
index 1b56e6eef0..17fd9939c3 100644
--- a/legacy/edje/doc/examples.dox
+++ b/legacy/edje/doc/examples.dox
@@ -18,6 +18,7 @@
18 * @li @ref tutorial_edje_multisense 18 * @li @ref tutorial_edje_multisense
19 * @li @ref tutorial_edje_basic2 19 * @li @ref tutorial_edje_basic2
20 * @li @ref tutorial_edje_signals_2 20 * @li @ref tutorial_edje_signals_2
21 * @li @ref tutorial_edje_animations_2
21 */ 22 */
22 23
23/** 24/**
@@ -1181,3 +1182,92 @@
1181 * edje_cc -id /path/to/the/image signalsBubble.edc 1182 * edje_cc -id /path/to/the/image signalsBubble.edc
1182 * @endverbatim 1183 * @endverbatim
1183 */ 1184 */
1185
1186/**
1187 * @page tutorial_edje_animations_2 Edje animations example 2
1188 *
1189 * In this example we will make an animation of a bouncing ball.
1190 *
1191 * Our focus now will be in the .edc file, because in the C source code we just load the edje object and do
1192 * nothing else.
1193 *
1194 * We want to give the freedom to the object to use the whole canvas of our program, so lets define
1195 * the min, max of our group:
1196 *
1197 * @dontinclude animations2.edc
1198 * @skipline max
1199 * @skipline min
1200 *
1201 * You will notice that in our .c file the canvas will have this size
1202 *
1203 * Now we will define our part that's going to be our image, the ball:
1204 * @skip part{
1205 * @until type:
1206 *
1207 *
1208 * At the description block bellow we are saying that this part has an image, defining
1209 * the max and min size and it's position on the edje_object. The default state is the first
1210 * state of the part, this means that when the edje object is loaded this one is going to be showed to you.
1211 *
1212 * Here it is:
1213 * @dontinclude animations2.edc
1214 * @skip description
1215 * @until }
1216 * @until }
1217 *
1218 * Now in the next description block we are saying where the ball is going to stop.
1219 * Note that we have the "inherit" property. This means we are inheriting everything from default,
1220 * except rel1 and rel2, because we are redefining it.
1221 *
1222 * Check the code:
1223 *
1224 * @skip description
1225 * @until }
1226 *
1227 * We defined how our object will look like and it's position during the animation,
1228 * now we need to define how it's going to act during the time. To do this we will
1229 * use the programs block
1230 *
1231 * The first program block will start the animation, it will wait for the 'load' signal. This signal
1232 * is generated when the edje object is loaded. The 'after' property is saying to this program block exactly this:
1233 * "When you finish, call the program 'animation,state1' ". The 'in' property is saying, wait 0.5 seconds until you execute this program block.
1234 *
1235 * Here is the code:
1236 *
1237 * @skip program {
1238 * @until }
1239 *
1240 * Now lets make the ball move and bounce it. In the second program block we are defining what we need to do
1241 * with the action property. So we are saying change to the state "down-state" using the transition BOUNCE
1242 * and apply this to the part "part_bubble". You can notice that BOUNCE has three parameters, the first one
1243 * is saying how much time the transition will last, the second one is the factor of curviness
1244 * and the last one is saying how many times and object will bounce.
1245 *
1246 * The code is very easy:
1247 *
1248 * @skip program {
1249 * @until }
1250 *
1251 * Now all you have to do is compile the code and run it!
1252 *
1253 * When you compile and run it you should see this:
1254 * @image html signal2final.png
1255 * @image rtf signal2final.png
1256 * @image latex signal2final.eps width=\textwidth
1257 *
1258 * The .edc file:
1259 * @include animations2.edc
1260 *
1261 * The source code:
1262 * @include animations2.c
1263 *
1264 * To compile use this command:
1265 * @verbatim
1266 * gcc -o animations2 animations2.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\"
1267 * -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
1268 * -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
1269 * `pkg-config --cflags --libs evas ecore ecore-evas edje`
1270 *
1271 * edje_cc animations2.edc
1272 * @endverbatim
1273 */