Fading & Scaling while Tweening - I need help

Blitz3D Forums/Blitz3D Programming/Fading & Scaling while Tweening - I need help

soniclife(Posted 2003) [#1]
I've almost finished my first B3D-Game, but I'm still stuck with this problem:

I use a tweening-routine for update the graphics. And hell, it took me some time to understand how it works... But there seem to be at least a little gap in my understanding:
There's some stuff in the program like scaling objects (from 0 to 1) or fading texts (from 0 to 1 and vice versa). Initially I create the object or sprite and put it to 0 imediately (textspr=createsprite() : entityalpha textspr,0). BUT: The tweening causes the object to have an alpha between the new and the old value. Since there is no old value when the object itself is new B3D takes "1" as the old one causing the object to been seen (like a short blink) - which I don't want...
So the only solution I could think of is to exclude scale and alpha from the tweening routine, but isn't there a simple solution (like: You're a lamer! Do this!).
I hope you understand what I mean (no native speaker around, sorry...) plus I'm begging for help! Thanks!


soniclife(Posted 2003) [#2]
Uhh-ohh...CaptureWorld a little more often is the key? Am I right? Well... guess I am...


Ross C(Posted 2003) [#3]
i know you have probably have your tweening function already coded but you should consider using the delta time approach, it alot simplier to keep everything in sync.

here's a link

http://www.blitzbasic.com/bbs/posts.php?topic=18405

sorry about your posted problem, i don't really know anything about tweening :S


Todd(Posted 2003) [#4]
I don't know much about tweening either, but couldn't you just use HideEntity to hide your sprites until you need to show them?


Vorderman(Posted 2003) [#5]
What you need to do is perform operations like this just before the CAPTUREWORLD command, but they MUST still be within the IF statement that triggers the captureworld.

So...I believe the Blitz tweening example has a line sort of like this...

IF somestuff THEN CAPTUREWORLD


...so extend the IF command block to allow more lines...
IF somestuff
    PERFORM YOUR PROBLEM OPS HERE
    CAPTUREWORLD
END IF


...and I believe this works with alpha and movement and all sorts of things that tweening can mess up.

I too had huge problems with entities flicking and HIDEENTITY not really working in use with tweeing, but someone here pointed out this piece of advice and it works, so I'm passing it on.

Hope it helps you.


Neochrome(Posted 2003) [#6]
How quick is CaptureWorld?


Vorderman(Posted 2003) [#7]
eh? No idea. The tweening code I'm using came as an example of a basic Blitz program layout, ages and ages ago, possibly when BB3D was first released.

Seeing as you can't (or I don't know how to) use the automatic tweening without using CAPTUREWORLD, I've never wondered how fast / slow it was.


rsbrowndog(Posted 2003) [#8]
i know you have probably have your tweening function already coded but you should consider using the delta time approach, it alot simplier to keep everything in sync.


I just use the tweening code template from the code archives that BlitzSupport posted, which itelf was based on Mark's castle demo code.

Cheers,

Ryan