• Welcome to Dark Bit Factory & Gravity.
 

Fading away

Started by Pot Noodle, January 23, 2012

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pot Noodle

I have been playing with Pure-basic and I must say it's a step up from Blitzmax and I have got further in less time than I did with blitz, but having said all that I was wondering if some one could take a look at this and point me in the right direction, this is for volume fade "not very good" I know, But I would like to add screen fade to it as well.

;////////////////////////////////////////////
; Volume fade
;////////////////////////////////////////////
  ExamineKeyboard()
 
  If KeyboardPushed(#PB_Key_Escape) Or Exit=1
    If Time=3
      Volume=Volume-1
      ModuleVolume(iMod,Volume)
      Time=0
    Else
      Time=Time+1
    EndIf
    Exit=1
  EndIf

This is in my main loop witch exit's when volume reaches 0, Any Ideas?
Thanks.

ttemper

I'm also interested in this process but for Freebasic, as soon I will also attempt this Volume fade and Screen fade in from black to 256colour and then the opposite.

Something like this...? http://www.freebasic.net/forum/viewtopic.php?p=139595

benny!

You could have a (black) sprite which covers the whole screen in front of your demo set to transparent and slowy fade it to solid. This should do the trick ...
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Pot Noodle

Cheers Benny! I had thought of that but I was concerned with the overheads it would cause if any!
Do you think a sprite this size 800 x 600 would be a problem?

benny!

Quote from: Pot Noodle on January 24, 2012
Cheers Benny! I had thought of that but I was concerned with the overheads it would cause if any!
Do you think a sprite this size 800 x 600 would be a problem?

The original image of the sprite could be way smaller, e.g. 1 pixel. Then just scale it to the desired size and fade the tranparent value in/out.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Pot Noodle

Thanks Benny! I was thinking of one big black sprite  :-[ but yes this is possible.
Cheers.

Pot Noodle

Just for the record I have sorted full screen fade :inspired: with out the use of a sprite instead I am using  ChangeGamma()
This works like a dream.

Jim

Fair enough :) Be nice though, I think Gamma is a global system setting so please put it back where it was afterwards ;)

Jim
Challenge Trophies Won:

Pot Noodle

Hi Jim, having noted your reply I got worried so I had a look at the manual it only states that  it affects the current screen
up till now there's been no probs, Thanks for the advice thou.