Re: [E-devel] [Edje] Animations in Edje

2009-11-09 Thread Carlo Ascani
2009/11/9 Tom Haste tomha...@gmail.com

 program{
   click, (if int=0)animate, set_int 1
   click, (if int=1)animate, set_int 0
 }

Yeah i use that method so now it works thank you!
Now, i have to switch to LUA and the myserious value method anim that
raster suggests above

-- 
Carlo Ascani
La politica pratica consiste nell'ignorare i fatti. (Henry Adams)
C programmers never die. They are just cast into void.
-
msn: bradw...@hotmail.it
cell: 320 2915799
Visita www.ptondo.it
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] [Edje] Animations in Edje

2009-11-08 Thread Carlo Ascani
Hi all,
i'm overriding the style for some elementary widgets. I want to change the
style for toggles, i want a toggle like this:
http://www.honeyrunapiaries.com/store/images/toggle_switch.jpg
So i've made easly tha state changing at every mouse click thanks to Embryo,
but noe i want to animate the change between on and off state.
Here's a my button0 part with states for animation:

part { name: button0;
  mouse_events: 1;
  description{ state: default 0.0;
 align:0.0 0.5;
 min:40 70;
 max:40 70;
 fixed:1 1;
 rel1.to:bg;
 rel2.to:bg;
 image.normal: toggle_0.png;
 }
 description{ state: step1 0.0;
 inherit: default 0.0;
 image.normal: toggle_1.png;
 }
 description{ state: step2 0.0;
 inherit: default 0.0;
 image.normal: toggle_2.png;
 }
 description{ state: step3 0.0;
 inherit: default 0.0;
 image.normal: toggle_3.png;
 }
description{ state: step4 0.0;
 inherit: default 0.0;
 image.normal: toggle_4.png;
 }
  }

And these are the scripts to manages the click and the animations of the
button:

 program { name: switch;
 signal: mouse,down,1;
 source: button0;
 script{
 new st[31];
 new Float:vl;
 get_state(PART:button0, st, 30, vl);
 if(!strcmp(st, default))
 run_program(PROGRAM:_anim_down_1);
 else
run_program(PROGRAM:_anim_up_1);
 }
 }
 program { name: _anim_down_1;
 source: button0;
 action: STATE_SET step1 0.0;
 target: button0;
 transition: LINEAR 0.02;
 after: _anim_down_2;
 }
 program{ name: _anim_down_2;
 action:STATE_SET step2 0.0;
 target: button0;
 transition: LINEAR 0.02;
 after: _anim_down_3;
 }
 program{ name: _anim_down_3;
 action:STATE_SET step3 0.0;
 target: button0;
 transition: LINEAR 0.02;
 after: _anim_down_4;
 }
 program{ name: _anim_down_4;
 action:STATE_SET step4 0.0;
 target: button0;
 transition: LINEAR 0.02;
 }

 program { name: _anim_up_1;
 source: button0;
 action: STATE_SET step3 0.0;
 target: button0;
 transition: LINEAR 0.02;
 after: _anim_up_2;
 }
 program{ name: _anim_up_2;
 action:STATE_SET step2 0.0;
 target: button0;
 transition: LINEAR 0.02;
 after: _anim_up_3;
}
program{ name: _anim_up_3;
 action:STATE_SET step1 0.0;
 target: button0;
 transition: LINEAR 0.02;
after: _anim_up_4;
 }
 program{ name: _anim_up_4;
action:STATE_SET default 0.0;
 target: button0;
 transition: LINEAR 0.02;
 }

I'm expecting that every click anims the button once down and once up, but
it anims button down at EVERY click.
What's wrong with my theme.

Thank you, also for helping me on irc, you're great guys!



-- 
Carlo Ascani
La politica pratica consiste nell'ignorare i fatti. (Henry Adams)
C programmers never die. They are just cast into void.
-
msn: bradw...@hotmail.it
cell: 320 2915799
Visita www.ptondo.it
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Edje] Animations in Edje

2009-11-08 Thread Tom Haste
Why not use a tween? You'd end up having something like this,

part {button
   {state: off }
   {state: animon
   tween}
   state: on }
   {state: animoff
   tween}
}

But of course, a bit more correct. And you can imagine the proram{} parts.
Sorry if this is wrong or incorrect, I just woke up.

-Toma.



2009/11/9 Carlo Ascani carlo.r...@gmail.com:
 Hi all,
 i'm overriding the style for some elementary widgets. I want to change the
 style for toggles, i want a toggle like this:
 http://www.honeyrunapiaries.com/store/images/toggle_switch.jpg
 So i've made easly tha state changing at every mouse click thanks to Embryo,
 but noe i want to animate the change between on and off state.
 Here's a my button0 part with states for animation:

        part { name: button0;
              mouse_events: 1;
              description{ state: default 0.0;
                 align:0.0 0.5;
                 min:40 70;
                 max:40 70;
                 fixed:1 1;
                 rel1.to:bg;
                 rel2.to:bg;
                 image.normal: toggle_0.png;
             }
             description{ state: step1 0.0;
                 inherit: default 0.0;
                 image.normal: toggle_1.png;
             }
             description{ state: step2 0.0;
                 inherit: default 0.0;
                 image.normal: toggle_2.png;
             }
             description{ state: step3 0.0;
                 inherit: default 0.0;
                 image.normal: toggle_3.png;
             }
            description{ state: step4 0.0;
                 inherit: default 0.0;
                 image.normal: toggle_4.png;
             }
      }

 And these are the scripts to manages the click and the animations of the
 button:

     program { name: switch;
         signal: mouse,down,1;
         source: button0;
         script{
             new st[31];
             new Float:vl;
             get_state(PART:button0, st, 30, vl);
             if(!strcmp(st, default))
                 run_program(PROGRAM:_anim_down_1);
             else
                run_program(PROGRAM:_anim_up_1);
         }
     }
     program { name: _anim_down_1;
         source: button0;
         action: STATE_SET step1 0.0;
         target: button0;
         transition: LINEAR 0.02;
         after: _anim_down_2;
     }
     program{ name: _anim_down_2;
         action:STATE_SET step2 0.0;
         target: button0;
         transition: LINEAR 0.02;
         after: _anim_down_3;
     }
     program{ name: _anim_down_3;
         action:STATE_SET step3 0.0;
         target: button0;
         transition: LINEAR 0.02;
         after: _anim_down_4;
     }
     program{ name: _anim_down_4;
         action:STATE_SET step4 0.0;
         target: button0;
         transition: LINEAR 0.02;
     }

     program { name: _anim_up_1;
         source: button0;
         action: STATE_SET step3 0.0;
         target: button0;
         transition: LINEAR 0.02;
         after: _anim_up_2;
     }
     program{ name: _anim_up_2;
         action:STATE_SET step2 0.0;
         target: button0;
         transition: LINEAR 0.02;
         after: _anim_up_3;
    }
    program{ name: _anim_up_3;
         action:STATE_SET step1 0.0;
         target: button0;
         transition: LINEAR 0.02;
        after: _anim_up_4;
     }
     program{ name: _anim_up_4;
        action:STATE_SET default 0.0;
         target: button0;
         transition: LINEAR 0.02;
     }

 I'm expecting that every click anims the button once down and once up, but
 it anims button down at EVERY click.
 What's wrong with my theme.

 Thank you, also for helping me on irc, you're great guys!



 --
 Carlo Ascani
 La politica pratica consiste nell'ignorare i fatti. (Henry Adams)
 C programmers never die. They are just cast into void.
 -
 msn: bradw...@hotmail.it
 cell: 320 2915799
 Visita www.ptondo.it
 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
 trial. Simplify your report design, integration and deployment - and focus on
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net

Re: [E-devel] [Edje] Animations in Edje

2009-11-08 Thread Viktor Kojouharov
edje doesn't make any assumptions on how exactly to produce the change
between the two image normals. you will have to do that manually, and to
do that the most used method is to have two image parts with same-name
states (like default and active) with your method of transition (sliding
or changing the color between the two states)


On Sun, 2009-11-08 at 19:51 +0100, Carlo Ascani wrote: 
 Hi all,
 i'm overriding the style for some elementary widgets. I want to change the
 style for toggles, i want a toggle like this:
 http://www.honeyrunapiaries.com/store/images/toggle_switch.jpg
 So i've made easly tha state changing at every mouse click thanks to Embryo,
 but noe i want to animate the change between on and off state.
 Here's a my button0 part with states for animation:
 
 part { name: button0;
   mouse_events: 1;
   description{ state: default 0.0;
  align:0.0 0.5;
  min:40 70;
  max:40 70;
  fixed:1 1;
  rel1.to:bg;
  rel2.to:bg;
  image.normal: toggle_0.png;
  }
  description{ state: step1 0.0;
  inherit: default 0.0;
  image.normal: toggle_1.png;
  }
  description{ state: step2 0.0;
  inherit: default 0.0;
  image.normal: toggle_2.png;
  }
  description{ state: step3 0.0;
  inherit: default 0.0;
  image.normal: toggle_3.png;
  }
 description{ state: step4 0.0;
  inherit: default 0.0;
  image.normal: toggle_4.png;
  }
   }
 
 And these are the scripts to manages the click and the animations of the
 button:
 
  program { name: switch;
  signal: mouse,down,1;
  source: button0;
  script{
  new st[31];
  new Float:vl;
  get_state(PART:button0, st, 30, vl);
  if(!strcmp(st, default))
  run_program(PROGRAM:_anim_down_1);
  else
 run_program(PROGRAM:_anim_up_1);
  }
  }
  program { name: _anim_down_1;
  source: button0;
  action: STATE_SET step1 0.0;
  target: button0;
  transition: LINEAR 0.02;
  after: _anim_down_2;
  }
  program{ name: _anim_down_2;
  action:STATE_SET step2 0.0;
  target: button0;
  transition: LINEAR 0.02;
  after: _anim_down_3;
  }
  program{ name: _anim_down_3;
  action:STATE_SET step3 0.0;
  target: button0;
  transition: LINEAR 0.02;
  after: _anim_down_4;
  }
  program{ name: _anim_down_4;
  action:STATE_SET step4 0.0;
  target: button0;
  transition: LINEAR 0.02;
  }
 
  program { name: _anim_up_1;
  source: button0;
  action: STATE_SET step3 0.0;
  target: button0;
  transition: LINEAR 0.02;
  after: _anim_up_2;
  }
  program{ name: _anim_up_2;
  action:STATE_SET step2 0.0;
  target: button0;
  transition: LINEAR 0.02;
  after: _anim_up_3;
 }
 program{ name: _anim_up_3;
  action:STATE_SET step1 0.0;
  target: button0;
  transition: LINEAR 0.02;
 after: _anim_up_4;
  }
  program{ name: _anim_up_4;
 action:STATE_SET default 0.0;
  target: button0;
  transition: LINEAR 0.02;
  }
 
 I'm expecting that every click anims the button once down and once up, but
 it anims button down at EVERY click.
 What's wrong with my theme.
 
 Thank you, also for helping me on irc, you're great guys!
 
 
 
 -- 
 Carlo Ascani
 La politica pratica consiste nell'ignorare i fatti. (Henry Adams)
 C programmers never die. They are just cast into void.
 -
 msn: bradw...@hotmail.it
 cell: 320 2915799
 Visita www.ptondo.it
 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
 trial. Simplify your report design, integration and deployment - and focus on 
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel



--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

Re: [E-devel] [Edje] Animations in Edje

2009-11-08 Thread Carlo Ascani
2009/11/9 Tom Haste tomha...@gmail.com

 Why not use a tween? You'd end up having something like this,

Cause tween is intended for looping animation, if i have learn correctly.
I need an animation between two differente images, playing only once at
time.
Anyway animations (up and down) work, the problem is in the script that
should alternate them...

-- 
Carlo Ascani
La politica pratica consiste nell'ignorare i fatti. (Henry Adams)
C programmers never die. They are just cast into void.
-
msn: bradw...@hotmail.it
cell: 320 2915799
Visita www.ptondo.it
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Edje] Animations in Edje

2009-11-08 Thread Tom Haste
Not always, tween is for animating stuff that needs multiple images.
Look at the click tween in the pointer code in the theme. It is
however used for the busy animation that loops in the theme as well.

If its working for you now, then I guess you can fix it.
http://wiki.enlightenment.org/index.php/Embryo/Examples/counting
This example isnt exactly the same, buts its just 1 way you could go about it.
Also you could have a program structure like this...

program{
   click, (if int=0)animate, set_int 1
   click, (if int=1)animate, set_int 0
}

Hope this is helpful...
-Toma

2009/11/9 Carlo Ascani carlo.r...@gmail.com:
 2009/11/9 Tom Haste tomha...@gmail.com

 Why not use a tween? You'd end up having something like this,

 Cause tween is intended for looping animation, if i have learn correctly.
 I need an animation between two differente images, playing only once at
 time.
 Anyway animations (up and down) work, the problem is in the script that
 should alternate them...

 --
 Carlo Ascani
 La politica pratica consiste nell'ignorare i fatti. (Henry Adams)
 C programmers never die. They are just cast into void.
 -
 msn: bradw...@hotmail.it
 cell: 320 2915799
 Visita www.ptondo.it


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [Edje] Animations in Edje

2009-11-08 Thread The Rasterman
On Mon, 9 Nov 2009 01:24:20 +0100 Carlo Ascani carlo.r...@gmail.com said:

luck for you, i saw this one coming a mile off years ago. edje has a feature
precisely for this.

notice with the descriptiosn of states u have that mysetious 0.0 value after
the name and have always wondered what the hell is that? useless waste of my
typing!. well.. wonder no more.

part { name: switch;
 description { state: default 0.0; image.normal: im0.png; }
 description { state: default 0.2; image.normal: im1.png; }
 description { state: default 0.4; image.normal: im2.png; }
 description { state: default 0.6; image.normal: im3.png; }
 description { state: default 0.8; image.normal: im4.png; }
 description { state: default 1.0; image.normal: im5.png; }
}

and you know how u can set state:

action: STATE_SET default 0.0;

well the 0.0 now can be N where N is 0.0 to 1.0 - you can use ANY value you
like. edje automatically choses the state with that name and the closest VALUE.
you define a set of N values (1 or more - suggestion is to include 0.0 and 1.0
and then more values in between). so set state to default 0.13187 and it will
see the closest is 0.2 - and use that.

you can use transitions that make this value go from 0.0 to 1.0 for example and
it will tween and choose the states in between as it goes. or should. you can
use embryo (or now lua too) to set the state and programmatically determine the
value to use (from 0.0 to 1.0).

cpufreq in e17's theme uses this for instance :)

 2009/11/9 Tom Haste tomha...@gmail.com
 
  Why not use a tween? You'd end up having something like this,
 
 Cause tween is intended for looping animation, if i have learn correctly.
 I need an animation between two differente images, playing only once at
 time.
 Anyway animations (up and down) work, the problem is in the script that
 should alternate them...
 
 -- 
 Carlo Ascani
 La politica pratica consiste nell'ignorare i fatti. (Henry Adams)
 C programmers never die. They are just cast into void.
 -
 msn: bradw...@hotmail.it
 cell: 320 2915799
 Visita www.ptondo.it
 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
 trial. Simplify your report design, integration and deployment - and focus on 
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
 


-- 
- Codito, ergo sum - I code, therefore I am --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel