News:

MFG's Character of the Month: September 2026 Voting

Main Menu

Fade effect for a background screen

Started by Stormrider, November 28, 2007, 07:54:04 PM

Previous topic - Next topic

Stormrider

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?

jbl2000

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.

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.

Bastard Mami

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


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.

Bastard Mami

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

Spoiler (click to show)

type=palfx
trigger= time%2
add = 255,0,0
mul = 255,0,0

type=palfx
trigger= !(time%2)
add = 0,0,0
mul = 0,0,0


Cyanide

That one is a seizure inducing flicker  ;P

QuoteI 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.

Bastard Mami

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.
Quoteadd = 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

The Lord of the Flies

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 :)