Author Topic: Fading away  (Read 4943 times)

0 Members and 1 Guest are viewing this topic.

Offline Pot Noodle

  • Sponsor
  • Amiga 1200
  • *******
  • Posts: 271
  • Karma: 15
  • Computers have lots of memory but no imagination
    • View Profile
Fading away
« on: January 23, 2012 »
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.

Offline ttemper

  • Amiga 1200
  • ****
  • Posts: 267
  • Karma: 7
    • View Profile
Re: Fading away
« Reply #1 on: January 24, 2012 »
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

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Fading away
« Reply #2 on: January 24, 2012 »
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:

Offline Pot Noodle

  • Sponsor
  • Amiga 1200
  • *******
  • Posts: 271
  • Karma: 15
  • Computers have lots of memory but no imagination
    • View Profile
Re: Fading away
« Reply #3 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?

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Fading away
« Reply #4 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:

Offline Pot Noodle

  • Sponsor
  • Amiga 1200
  • *******
  • Posts: 271
  • Karma: 15
  • Computers have lots of memory but no imagination
    • View Profile
Re: Fading away
« Reply #5 on: January 24, 2012 »
Thanks Benny! I was thinking of one big black sprite  :-[ but yes this is possible.
Cheers.

Offline Pot Noodle

  • Sponsor
  • Amiga 1200
  • *******
  • Posts: 271
  • Karma: 15
  • Computers have lots of memory but no imagination
    • View Profile
Re: Fading away
« Reply #6 on: January 25, 2012 »
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.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Fading away
« Reply #7 on: January 25, 2012 »
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:

Offline Pot Noodle

  • Sponsor
  • Amiga 1200
  • *******
  • Posts: 271
  • Karma: 15
  • Computers have lots of memory but no imagination
    • View Profile
Re: Fading away
« Reply #8 on: January 29, 2012 »
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.