Display hidden items with animation (easing/scrolling).

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skipbr
    New Member
    • Jul 2007
    • 13

    Display hidden items with animation (easing/scrolling).

    Does anyone knows how to display hidden items using easing/scrolling animation (can also be a component)?

    Similar to the one use in the Weather docklet in ObjectDock (the video shows the 5-days being displayed the way I'd like to do)?


    Thanks in advanced.
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    As for the dock... Looks like a total copy of the Macintosh dock.

    Comment

    • skipbr
      New Member
      • Jul 2007
      • 13

      #3
      That dock was meant to be a copy, just like we have Vista alike apps in XP.

      But what about the weather docklet? Any tip about how to achieve anything like that in C# (hover the mouse over an icon and then make it reveal another 5 items using motion)?

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        Use the MouseHover event?



        Comment

        • skipbr
          New Member
          • Jul 2007
          • 13

          #5
          I know that... I thing I'm not being clear enough here.

          Let me change my question them... How to make some animated effects in C#?
          If you watch the movie in the first post, at 0:45, you'll notice the weather docklet working. When the mouse hover it for a while, it shows 5 items (upcoming days).
          Those items have some sorta of easing/motion effect (it goes straight up and them unfold other 4 items) and that is what I'd like to learn how to do.

          Comment

          • tlhintoq
            Recognized Expert Specialist
            • Mar 2008
            • 3532

            #6
            Now I'm with you. You want to be able to do this...

            [IMGNOTHUMB]http://files.me.com/tlhintoq/emq0qg[/IMGNOTHUMB]

            Someone more knowledgable than I would have to describe how to do it via DirectX. I know that creating sprites would be one way.

            But if it were me... I would design some sort of "WeatherPanelOb ject" class that is the white date, black panel, weather icon, weather text and temperatures. This can be something as simple as a form with a transparent back and no frame.

            It will need methods for MoveLeft, MoveRight, MoveUp, MoveDown... SetDay, SetWeather, SetTemp and so on. (Change the .Location property) Looks like it will also need a SetOpacity method.

            The animation is then just a matter of...

            Code:
            SetDay("Friday");
            SetWeather("Cloudy");
            SetTemp(35,Temp.Centigrade);
            SetOpacity(10);
            MoveUp();
            MoveUp();
            SetOpacity(15);
            MoveUp();
            MoveLeft();
            SetOpacity(25);
            And so on to create the desired direction of movement.

            Of course there are dozens of variations on exactly how certain parts could be done. That's where your programming style comes in. Maybe you don't want to explicity set the opacity as you move it. (Too much work for the sending method) So your WeatherPanelObj ect has its own timer that starts when it is first displayed and automatically increases the opacity every 500 milliseconds.

            Maybe instead of having to send lots of MoveLeft(), MoveRight() commands you just want to send it an Argument of where it is supposed to be located like Position(1,5) meaning take up position 1 out of 5, which would be a different calculated position than if it were Position(1,3);

            My personal plan would probably have all the methods for the parent class to move or change it, but send it an Argument class at creation that has all of its data (Temp, day, weather, position x out of y, etc.) then have it take control of itself from there. The creating parent class just has to make it. The child is does the rest on its own. The parent then can occassionally send updates if it is still on screen.

            Comment

            • skipbr
              New Member
              • Jul 2007
              • 13

              #7
              Got it now.
              In fact, I'm already working with a borderless form with no background, however I didn't think about creating others forms for the extra items... That way It definitely can be set its transparency (fading in/out)...

              Thanks for clear up my mind. Have a nice day.

              Comment

              Working...