YesNoOk
avatar

Fade effect for a background screen (Read 628 times)

Started by Stormrider, November 28, 2007, 07:54:04 pm
Share this topic:
Fade effect for a background screen
#1  November 28, 2007, 07:54:04 pm
  • avatar
  • **
I'd like to create a pulsating effect for a background, I mean, a plain color red which fades to black and then fades again back to red and repeats. Do I need to create several images with different levels of brightness to build the animation or is there any command for this in mugen?
Re: Fade effect for a background screen
#2  November 28, 2007, 08:02:40 pm
  • avatar
  • **
I probably have no idea what im talking about but you need the bgpalfx sctrl and maybe the envcolor sctrl too. You will have to tweak the options till it works.
Re: Fade effect for a background screen
#3  November 28, 2007, 09:19:12 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
BGpalfx and make use of sinadd.

Sinadd multiplies the value up and down based on R,G,B, time. so if you set it up for red, then use sinadd over a time limit it'll scale down to whatever colour you need provided you get your values right.

I suck with palfx and go via trial and error in FF's palFX function. You can do the same or hope someone knows and is nice enough to tell you the needed values.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Fade effect for a background screen
#4  November 29, 2007, 12:42:33 am
  • ******
  • [E]
    • Mexico

  • Online
i just did something similar for morrigan's midnight bliss, but instead of using a sin curve, i used a simple line.

palfx.
trigger= time = [0,256]
add = 255,0,0
mul = 255,0,0

to create a full red effect

to change it to black, you need to add a negative number
trigger= time = [0,256]
add = 256-time,256-time,256-time

Re: Fade effect for a background screen
#5  November 29, 2007, 01:25:34 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
He's after a pulse [E] (redblackredblackredblack), not a straight change.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Fade effect for a background screen
#6  November 29, 2007, 01:31:26 am
  • ******
  • [E]
    • Mexico

  • Online
i see, and damn, was his post so easy.. i wonder if i shoudl

Spoiler, click to toggle visibilty
Re: Fade effect for a background screen
#7  November 29, 2007, 01:42:16 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
That one is a seizure inducing flicker  ;P

Quote
I mean, a plain color red which fades to black and then fades again back to red and repeats
^Important bit. If i was better with palfx i'd be posting a general guideline.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Fade effect for a background screen
#8  November 29, 2007, 02:04:05 am
  • ******
  • [E]
    • Mexico

  • Online
yeah, one has to mix it with the previous method. so, if it is not he bg fading from normal to black, then to red... one has to find a way in which those two methods interpolate.

so, when (time/120) %2 = 0 it should fade to black, and when (time/120)%2 = 1 it should fade to red...

the plain color thing helps.
Quote
add = add_r, add_g, add_b (int)
  mul = mul_r, mul_g, mul_b (int)
    Each add component is added to the appropriate component of the
    player's palette, and the result is multiplied by the appropriate
    mul component divided by 256. For instance, if pal_r is the
    red component of the character's original palette, then the new
    red component is (pal_r + add_r)*mul_r/256. The values for mul
    must be >= 0.

trigger1 = (time/120) %2 = 0; fade from black to red
add = -256,-256,-256
mul = ((time%120)/120.0)*256, 0, 0

trigger1 = (time/120) %2 = 1; fade from red to black
add = 256,0,0
mul = (1.0 - ((time%120)/120.0) )*256, 0, 0
Re: Fade effect for a background screen
#9  November 30, 2007, 01:47:54 am
  • ****
  • Am I evil?
Or use Fighter Factory to create something simplier like this:

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = !Time
time = -1
add = -255,-255,-255
mul = 256,256,256
sinadd = 256,256,255,100
invertall = 0
color = 256
;ignorehitpause = 0
;persistent = 1

The number in bold, if you increase it, the transition becomes slower. If decrease it, the transition becomes faster (OMG seizure attack).

Edit: This is assuming the image you want to "have a pulse", is red.

Sig made by TempesT :)