[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4697: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4699: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4700: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4701: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
indielib.com • View topic - Gradual Sprite Fading

indielib.com

IndieLib Forum
It is currently Thu Feb 25, 2021 9:31 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Gradual Sprite Fading
PostPosted: Mon Aug 20, 2012 6:24 pm 
Offline

Joined: Mon Mar 26, 2012 12:08 am
Posts: 5
Hi, I've been searching for this for a while and found nothing about it.Has anyone implemented a gradual fade function in IndieLib (fade-in/fade-out)? Or maybe other transformations, like gradual scaling, I've managed to do it, but it is not as good as I wanted, so I'm just curious if anoyone else did this, and how they did it.

Thanks in advance.


Top
 Profile  
 
PostPosted: Mon Aug 20, 2012 6:52 pm 
Offline
Site Admin
User avatar

Joined: Sun Jan 02, 2011 2:06 pm
Posts: 222
Location: Denmark
Hi,

The fade in / out part I don't know about, - but a big wish (mine :D ) is that Indielib supports the Spriter format ( read more here: ) The support of this format should as far as I see it support gradual scaling, rotation etc.

Haven't seen anything regarding this subject in the forum :|

I have personally chipped in, regarding the crowd founding of Spriter on kickstarter. ( with a little hope, maybe we can bribe Javier to implement support for it hehe ).

_________________
Cross-platform repository: https://github.com/DarthMike/indielib-crossplatform
Cross-platform roadmap: http://www.indielib.com/wiki/index.php? ... eloper_FAQ


Top
 Profile  
 
PostPosted: Wed Aug 22, 2012 8:01 pm 
Offline
Site Admin

Joined: Thu Jul 16, 2009 1:52 pm
Posts: 250
Location: London, UK
I think "Spriter" and "Alpha" animation is a different matter. I implemented it but putting on top my own system, as it needs to have in place a 'run loop' to 'update' alpha value over the time, and give impression of fade in and fade out.

Download source code from my games, there you can see what I did ().
I just varied alpha value overtime on my game loop. You would call repeatedly setTransparency(..) with increasingly lower or higher values till reaching 0 or 1, depending if you want to do 'fade in' or 'fade out'

I don't think we can implement alpha animation easily, because Indielib depends on the run loop of the game to be implemented outside the library. Let's say that kind of things is up to the user to implement.


Top
 Profile  
 
PostPosted: Thu Aug 23, 2012 4:22 pm 
Offline
Site Admin
User avatar

Joined: Sun Jan 02, 2011 2:06 pm
Posts: 222
Location: Denmark
Well, yes - it depends upon how you look at it.

Spriter works by having multiple image "parts", and for a given interval moving + rotating these + (z-order and a lot of other things). What is important is there is also a alpha value, and since all part images are only loaded one time, you could double your animations by copying each animation and setting the alpha value, so you have 2 sets: normal animations and fade out animations. And yes if the fadeout is longer than the animation then we have a problem ( we get a blinking animation instead ).

If we supported Spriter, we could probably make an global alpha value (+ a step value ) for each compound sprite, or for a group of sprites, this may in the user would only have to set the value once.

But again in the big picture you are right DarthMike, the easiest way is probably that the user handle it himself.

oh well, Im rambling again. :)

_________________
Cross-platform repository: https://github.com/DarthMike/indielib-crossplatform
Cross-platform roadmap: http://www.indielib.com/wiki/index.php? ... eloper_FAQ


Top
 Profile  
 
PostPosted: Sat Aug 25, 2012 9:32 am 
Offline
Site Admin

Joined: Thu Jul 16, 2009 1:52 pm
Posts: 250
Location: London, UK
I've been thinking about this, and it think it could be achieved. But anyway we would have to design another part of library which could be used or not.

What I'm thinking is, from user of library point of view:
1. Create entity, add surface to it
2. I want to animate properties of this entity:
- Position
- Alpha
-... ?


If I don't want to animate them, or animate them myself, just use library as it is now. If I want to use the property animation system, then I use new object/group of object like:
IND_PropertyAnimator->addObject(myEntity, animating, ...)

Then, the main problem is that we need external code to call us, but we can compute the time ourselves with internal timers, as we do with IND_Animation. Actually external code should be calling us by every frame calling "renderEntities2d(..)".

So I think it could be doable.

We could add this a a 'wish' feature, and input it somewhere in the milestones list.


Top
 Profile  
 
PostPosted: Sat Aug 25, 2012 1:07 pm 
Offline
Site Admin
User avatar

Joined: Sun Jan 02, 2011 2:06 pm
Posts: 222
Location: Denmark
I think that the Spriter format can handle your ideas:

Here is the implementation guide:



here is the full specification of the format:



here is the kickstarter page (project is ongoing and beta versions of the editor is allready avialable for linux, mac and windows) :

(look under updates to see current status)

I was actually thinking of a IND_SpriterAnimationManager, IND_SpriterAnimation... etc .... what do you think? ( btw: I have already created a branch for it .. to avoid messing up the stable code).

_________________
Cross-platform repository: https://github.com/DarthMike/indielib-crossplatform
Cross-platform roadmap: http://www.indielib.com/wiki/index.php? ... eloper_FAQ


Top
 Profile  
 
PostPosted: Sun Aug 26, 2012 3:35 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain


Top
 Profile  
 
PostPosted: Sun Aug 26, 2012 3:36 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
And for the "gradual" part, you can use a timer (LOV_Timer()) for example, so it would be time dependant ;)


Top
 Profile  
 
PostPosted: Tue Oct 16, 2012 6:54 am 
Offline

Joined: Tue Oct 16, 2012 6:50 am
Posts: 1
Then, the main problem is that we need external code to call us, but we can compute the time ourselves with internal timers, as we do with IND_Animation. Actually external code should be calling us by every frame calling "renderEntities2d(..)".

_________________

http://www.amazon.com/s?ie=UTF8&page=1& ... _27%3AIIBA
http://en.wikipedia.org/wiki/Internatio ... s_Analysis
http://www.youtube.com/user/PMInstitute
https://www.facebook.com/PMInstitute


Top
 Profile  
 
PostPosted: Fri Nov 02, 2012 12:34 pm 
Offline
Site Admin

Joined: Thu Jul 16, 2009 1:52 pm
Posts: 250
Location: London, UK
Yes I agree that external code needs to call us, but it's the same with animations, so we could implement it in library code.

@kaauz - by the way, did you manage to make it work in your app?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group