Page 1 of 2

[Userlib & Source] - ImageGadget Animations

Posted: Thu May 06, 2010 9:24 pm
by Env
Hey all,

As an extension to the source code I was tinkering with in the Tricks & Tips section, I have finally made a stable library that allows you to apply animations to a standard ImageGadget.

Using straight-forward commands, this library allows you to apply an animation strip (frames stitched together) to an ImageGadget, as well as pausing, playing, stopping, setting the speed of the animation.

What's Included

- 2 Different Variations of the UserLibrary for Windows 32bit Platform, which are:

Standard - Using standardized commands (ApplyImageGadgetAnimation) for PureBasic 4.50 and above... (Enables any number of frames to be applied)
Prefixed - With simplified commands, prefixed with a "AIG_" (i.e. AIG_ApplyAnimation) for PureBasic 4.50 and above...

- Source code to enable you to easily tailbite the library to work with your compiler for both call-types.

- Documentation in the form of a CHM file.

- Documentation in the form of html files, and a snazzy index page... which isn't so snazzy, as I hand-made it.

- Include file, in case the userlibs fail.

- Userlib compilation sources, so you can easily build a userlib for your platform, with no hassle.

- An Example.

- A few little animation strips to play with.

Revisions

1.0 Beta 2 - Re-built the <4.50 libraries on PureBasic 4.41 in the hope that it supports previous compilers better than the initial release that gave errors.
1.0 Beta 3 - After the problems of including this library in previous versions of Purebasic before 4.41, the Source Code has been refined, and has been included in the package as an include file.
1.0 Beta 4 - Fixed a very basic mistake in the Include File, which was the Include containing the Init and Kill procedures, which would only be applicable if being made into a userlibrary.
1.0 Final - Fixed the source code for better integration as a include file (as a few functions were still made with building as a userlib in mind...), help file updated, and html help provided.

Download

You can download the 1.0 Final release here: http://www.mediafire.com/file/ehmynnmgw ... 32_src.zip


Please report any bugs, feature requests, or general usage experiences here :)

Thanks,

Env

Re: [Userlib] - ImageGadget Animations

Posted: Fri May 07, 2010 10:07 am
by Padraig
Hello!

This looks like a great and handy thing, but I can't get it to work on PB 4.41. The example gives me a "The following PureLibrary is missing: Event." compiler error on both the prefixed and the standard userlib. :(

Pad

Re: [Userlib] - ImageGadget Animations

Posted: Fri May 07, 2010 11:20 am
by Env
Hey Padraig...

Thanks for bringing it to my attention, I have now re-build the UserLibraries meant for compilers before 4.50 on a 4.41 compiler... So it should work fine now (Touch Wood)....

The new link is on the initial post.



Have a go and let me know if any problems occur..

Thanks mate,


Env

Re: [Userlib] - ImageGadget Animations

Posted: Fri May 07, 2010 11:25 am
by Kaeru Gaman
Env wrote:... I have now re-build the UserLibraries meant for compilers before 4.50 on a 4.41 compiler...
will work on a 4.4x, but not necessarily on a 4.3x and certainly not on 4.2x + <
the thing with the tailbitten userlibs is, they are strictly version bound.

this and some possible side effects are the reasons why some people refuse to use userlibs.
since you published your code as an include, too, that's not that big a problem here.

Re: [Userlib] - ImageGadget Animations

Posted: Fri May 07, 2010 11:43 am
by Env
The source-code hasn't yet been finished, and as such it has been removed in its primitive form from the Tricks & Tips section.. Though when I have optimised it, and profiled it as much as I deem necessary, then it will be released.

Env

Re: [Userlib] - ImageGadget Animations

Posted: Fri May 07, 2010 11:58 am
by Kaeru Gaman
ok, so just the tempus of my sentence is to change... :mrgreen:

anyhow, just be aware that userlibs have this restrictions.
you will not reach the whole community with a userlib.

even a lot of collegues who use userlibs use only those they really, really need for their project,
because sometimes the combinations of userlibs can show strange sideeffects.
... well, at least some years ago I observed such an effect, dunno if it still is possible.

however, I generally avoid userlibs.
I'm about to be convinced to try mpz's MP3D lib, if I do it will be my first userlib ever.

Re: [Userlib] - ImageGadget Animations

Posted: Fri May 07, 2010 12:29 pm
by Padraig
Works like charm now on PB 4.41. Thanks for fixing this so quickly! :D

Does not work on PB4.3 and minor. The compiler spits out: "The following PureLibrary is missing: AlphaImage".

Neverthless, nice work and thanks for sharing!

Pad

Re: [Userlib] - ImageGadget Animations

Posted: Fri May 07, 2010 12:39 pm
by Env
You're welcome, and it's Bloody typical lol.. Thanks Kaeru Gaman for the heads up also.


A new release has been posted on the first post, including the Source Code as an include file, as well as updated documentation.

Env

Re: [Userlib & Source] - ImageGadget Animations

Posted: Fri May 07, 2010 2:34 pm
by c4s
Interesting library and thanks for releasing the source!

But with using AnimImageGadget.pbi I get an IMA at line 86 (with your example) with PB 4.50 Beta 4.

Re: [Userlib & Source] - ImageGadget Animations

Posted: Fri May 07, 2010 3:17 pm
by Env
Are you using both the include & the userlib? if so, don't... The AnimImageGadget.pbi is to be used separately, and not in conjunction with the Include File.


The example was written with the UserLib in mind, so you may need to make some adjustments if it doesn't work...

Re: [Userlib & Source] - ImageGadget Animations

Posted: Fri May 07, 2010 3:45 pm
by Env
Ah bollocks, I've realised my mistake... Ammended version will be updated in a few minutes...

Re: [Userlib & Source] - ImageGadget Animations

Posted: Fri May 07, 2010 3:54 pm
by Env
Fixed the code, and it was an embarrassingly simple mistake lol... all should work fine when either using the include file, or building it as a userlibrary...

New Version (Beta 4) Uploaded: http://www.mediafire.com/file/liw0kwyli ... 32_src.zip

Re: [Userlib & Source] - ImageGadget Animations

Posted: Fri May 07, 2010 4:39 pm
by c4s
Thanks - Works fine now.

Re: [Userlib & Source] - ImageGadget Animations

Posted: Fri May 07, 2010 5:34 pm
by Env
The 1.0 Final version is now complete and uploaded for your using pleasure...


Changes

* Fixed a few little bugs in the code, and fixed procedure calls that take optional arguments when not being built as a UserLibrary.
* Ammended Help Documentation.
* Included HTML Help.

Re: [Userlib & Source] - ImageGadget Animations

Posted: Sat May 08, 2010 11:33 pm
by DoubleDutch
Thanks for this. :)