Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

Animated toolbar (script/module)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Animated toolbar (script/module)

    This script let you to create "animated toolbars" with image and button objects, and I think that it looks great =).

    Put this file in your project's root folder o script's folder and in your global functions call it with "require("xToolBar")". I also add an xml file xD .

    There are 3 main functions:

    xToolBar.CreateToolbar: Creates a new toolbar container
    xToolBar.AddItem: Adds an image or button object
    xToolBar.Animate: Animates your toolbar (put this one in your "On Mouse Move" event).

    And there are 5 different animations:

    xMODESTRAIGHT = 1;
    xMODEUP = 2;
    xMODEDOWN = 3;
    xMODESTRAIGHTUP = 4;
    xMODESTRAIGHTDOWN = 5;

    I don't have a help file but this is how i use it (you can create more than 1 toolbar):

    PHP Code:
    --[On Preload]
    mTB xToolBar.CreateToolbar("MyToolBar"4Window.GetSize(Application.GetWndHandle()).Width/210505xMODEUP);
    --
    I have 4 image objects
    for x=1do
        
    xToolBar.AddItem("Image"..xmTB);
    end

    --[On Mouse Move]
    xToolBar.Animate(e_Xe_YmTB); 
    And that's all. Try the other animations and let me know if you like it =) .
    Last edited by webultra; 03-12-2011, 05:08 PM. Reason: I forgot to add the file lol

  • #2
    Very nice example!

    I have palyed with it for a short time because I was in a hurry.

    I will give a deeper look tommorow and I have some suggestion to improve it, for example, a function that will retrieve the dimensions of the pictures used in the toolbar so they will not become pixelate due to the fixed dimensions of the icons you set in this code (50) px:

    Code:
    mTB = xToolBar.CreateToolbar("MyToolBar", 4, Window.GetSize(Application.GetWndHandle()).Width/2, 10, 50, 5, xMODEUP);
    Many thanks!
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.

    Comment


    • #3
      Hi Cybergraph, thank you for your comments.

      I used 50px in the example because i had 4 bigger images xD . The script resizes the added images/buttons, and the most used sizes are between 16px and 48px. If you don't want to resize the images/buttons you can comment those lines in the script . In fact I wasn't resizing when I started to write the script .

      Comment


      • #4
        Update: Version 1.1

        I added opacity change in image objects and a couple of buttons (must be rename as the button filename) that will work as tooltips when the mouse is over an item (looks like the MAC dock's tooltips jeje) .


        The texts for the tooltips are taken from the image/buttons object's tooltips .

        Example call:

        PHP Code:
        mTB xToolBar.CreateToolbar("mTB"13460390323xMODESTRAIGHTUPtruetrue);
        for 
        x=113 do
            
        xToolBar.AddItem("Image"..xmTB);
        end 
        And I finally compiled it into an lmd (thnx to reteset's action plugin compiler). If some knows how to include the buttons (1k each one) inside of the lmd and how to call them once i need them i would appreciate the help
        Last edited by webultra; 03-14-2011, 02:10 AM.

        Comment


        • #5
          Originally posted by webultra View Post
          Update: Version 1.1

          I added opacity change in image objects and a couple of buttons (must be rename as the button filename) that will work as tooltips when the mouse is over an item (looks like the MAC dock's tooltips jeje) .

          [ATTACH]11088[/ATTACH]

          The texts for the tooltips are taken from the image/buttons object's tooltips .

          Example call:

          PHP Code:
          mTB xToolBar.CreateToolbar("mTB"13460390323xMODESTRAIGHTUPtruetrue);
          for 
          x=113 do
              
          xToolBar.AddItem("Image"..xmTB);
          end 
          And I finally compiled it into an lmd (thnx to reteset's action plugin compiler). If some knows how to include the buttons (1k each one) inside of the lmd and how to call them once i need them i would appreciate the help

          Do you have a example as I am gettting alot tD error and nill erros
          It looks like a great plugin tho.

          Comment


          • #6
            It's 3:44am here in méxico lol, I'll upload an example project in the morning.

            The last example call adds 13 image objects to the created toolbar, maybe that's why you are getting those errors. If you add an image object that doesn't exist it will give a nil error .

            Here is another example call using less images:

            --[On Preload]
            PHP Code:
            mTB xToolBar.CreateToolbar("mTB"4Window.GetSize(Application.GetWndHandle()).Width/210323xMODESTRAIGHTUPfalsetrue);
            --
            With 4 image objects
            for x=1do
                
            xToolBar.AddItem("Image"..xmTB);
            end 
            --[On Mouse Move]
            PHP Code:
            xToolBar.Animate(e_Xe_YmTB); 
            If you want to see the tooltip object you have to place in your project page the 2 buttons included in the rar file, and rename them as their filename (without extension).

            Comment


            • #7
              I give that a shot until the morning thanks

              Comment


              • #8
                Here is the example project and a snapshot of it. I created 5 toolbars to show the different kind of animations available.


                Comments are accepted

                Comment


                • #9
                  Ooo let me have pway :P

                  That is pretty nice man I not sure how to edit it just yet bit its funky well done.
                  Last edited by sim; 03-14-2011, 11:42 AM.

                  Comment


                  • #10
                    @webultra

                    As sayd before, it's a very good plugin and I think most users in the forum will be thankful to you.

                    If I can give some suggestions for future improvements, here they are:

                    - give the user the possibility to choose the transparency level (example: instead of the booleans, use -1 = no transparency, from 0 to 100 = transparency level).

                    - give a look to the attachement: it is an example (don't remember the author, sorry) of an animated toolbar. Could you add these types of animations to yours?

                    Many thanks in advance.
                    Attached Files
                    We are slowly invading your planet to teach lazy humans to read the user manual.
                    But don't be scared: we are here to help.

                    Comment


                    • #11
                      Wow, that's a really nice example. About the transparency level the answer is yes, I'll do it today. And about the other animations I think there is no problem, but it will take maybe 1 day more.

                      Comment


                      • #12
                        The time is not a problem, mate.

                        Glad to see you like my suggestions.
                        We are slowly invading your planet to teach lazy humans to read the user manual.
                        But don't be scared: we are here to help.

                        Comment


                        • #13
                          Thnx for sharing

                          Comment


                          • #14
                            What a cool plugin, it must be part of my collection!
                            thanks!

                            Comment


                            • #15
                              Hi, here is the new update (v1.2). It was easier than I thought to add those fisheyes animations (my code works faster ).


                              Here is the changelog:

                              -Added 4 animations (shakeme and 3 different kinds of fisheye animation)
                              -Removed the nItems argument from xToolBar.CreateToolbar function (now there is no limit of items)
                              -Changed the boolean transparency argument from xToolBar.CreateToolbar to a number argument, so now you can choose the initial opacity of the image objects (-1 = no opacity change)
                              -Added 2 functions (GetnShakes and ChangenShakes) to control the xMODESHAKEME animation

                              Thanx to Cybergraph for those sugestions and to the author of the fisheyemenu.

                              Example and plugin attached.

                              Comment

                              Working...
                              X