animated background

Dyhego

Member
Hello everyone!

I'm having trouble creating an animated background. as you can see in the attached image, the train is transparent, I don't know if because it is over another layer, I tried to change the transparency and alpha, but it only gets worse. Could someone help me with this?

kGCKGyV


Code:
bglayer data/levels/stage3/back.gif          0 0 0 0 0 0 1 1 1 1 0 0 0 0 0


background data/levels/stage3/train.gif     
bgspeed 30 1


panel data/levels/stage3/panel.gif
 

Attachments

  • Captura de tela 2020-09-30 000324.png
    Captura de tela 2020-09-30 000324.png
    133.4 KB · Views: 18
hmm try like this:

bglayer data/levels/stage3/back.gif          0 0 0 0 0 0 1 1 -1 0 0 0 0 0 0

also not sure but i think order may be wrong too.
 
As Gurtag posted, you set alpha parameter to 1 causing the layer to use alpha transparency.
Code:
bglayer         {path} {xratio} {zratio} {xposition} {zposition} {xspacing} {zspacing} {xrepeat} {zrepeat} {transparency} {alpha} {watermode} {amplitude} {wavelength} {wavespeed} {bgspeedratio}
Background command also has same set of parameters.

Hmmm.... I can see the idea of this "animated background" although I'm not sure of train's length.
 
Bloodbane said:
As Gurtag posted, you set alpha parameter to 1 causing the layer to use alpha transparency.
Code:
bglayer         {path} {xratio} {zratio} {xposition} {zposition} {xspacing} {zspacing} {xrepeat} {zrepeat} {transparency} {alpha} {watermode} {amplitude} {wavelength} {wavespeed} {bgspeedratio}
Background command also has same set of parameters.

Hmmm.... I can see the idea of this "animated background" although I'm not sure of train's length.

the image size was 3104x244, because I left a blank space so that it worked as the interval between one train and another.
 
Dyhego said:
Gurtag said:
hmm try like this:

bglayer data/levels/stage3/back.gif          0 0 0 0 0 0 1 1 -1 0 0 0 0 0 0

also not sure but i think order may be wrong too.

Did not work. He doesn't even appear on the train.

hmm may be an order problem, try like this:

background      data/levels/stage3/back.gif 
bglayer              data/levels/stage3/train.gif    0 0 0 0 0 0 1 1 -1 0 0 0 0 0 0
panel                  data/levels/stage3/panel.gif 
bgspeed 30 1
order          a

if still doesnt work post the level´s txt and the gif files to take a look
 
Hey Guys,

I remember this a while back...

Maybe this could help the OP? ( this was the quote drom caskey the admin here)


""fglayer is for foreground use bglayer for background stuffs""


"Noooooooo! Seriously, fglayer is not for foreground only. It's essentially a newer, better bglayer. Bglayer is always behind the panel layer and when there's more than one are just drawn in order you declare them.

Fglayer adds a Z position adjustment. It defaults to being in front of the panel, but you can put the fglayer exactly where you want it in relation to other layers, panels, entities, and so on. It's much more versatile"
 
I've tried this trick myself and it works. This is my settings (using my own images that is):
Code:
bglayer		data/bgs/sstation/backN.png 0 0 0 0 0 0 -1
bglayer		data/bgs/strain/train.png 0 0 0 -25 0 0 -1 1 1 0 0 0 0 0 1
bglayer		data/bgs/sstation/pillar.gif 0 0 0 0 262 0 5 1 1
panel		data/bgs/sstation/panel.png

bgspeed		5

There's no alpha transparency set there.
 
Gurtag said:
Dyhego said:
Gurtag said:
hmm try like this:

bglayer data/levels/stage3/back.gif          0 0 0 0 0 0 1 1 -1 0 0 0 0 0 0

also not sure but i think order may be wrong too.

Did not work. He doesn't even appear on the train.

hmm may be an order problem, try like this:

background      data/levels/stage3/back.gif 
bglayer              data/levels/stage3/train.gif    0 0 0 0 0 0 1 1 -1 0 0 0 0 0 0
panel                  data/levels/stage3/panel.gif 
bgspeed 30 1
order          a

if still doesnt work post the level´s txt and the gif files to take a look

It didn't work, what would be the bottom was moving in place of the train and the train doesn't even appear on the scene. Attached is level.txt and images

I'm almost giving up and leaving a static image ...

stage.txt
Code:
#{xratio} {zratio} {xposition} {zposition} {xspacing} {zspacing} {xrepeat} {zrepeat} {transparency} {alpha} {watermode} {amplitude} {wavelength} {wavespeed} {bgspeedratio}
#   1        2           3          4          5           6          7        8            9           10         11       12           13           14          15                    
#music		data/sounds/stage1.bor 


bglayer       		  data/levels/stage3/back.gif     0 0 0 0 0 0 1 1 0 1 0 0 0 0 0
background               data/levels/stage3/train.gif    
panel                 data/levels/stage3/panel.gif   

bgspeed 30 1


direction       both
#light  		10   -30
at       	0
settime         0
notime          1
noslow          1
order		a
cameratype 	1


spawn  abelio
health 500
coords -90  206
at  218

spawn	m4
coords  50 220
at 0

Level.txt
Code:
#-------misc stuff


noslowfx   	1
hiscorebg 	1
completebg      1
loadingbg    1 5 200 310 120 180 1
loadingbg2   1 5 200 310 120 180 3

#-------Menu placement



#-------Lifebars, icons, names, etc.

lbarsize  58 7 1 1 0 -9999 -9999 -9999 -9999
mpbarsize 58 7 1 1 0 -9999 -9999 -9999 -9999
olbarsize 62 8 1 1 0 -9999 -9999 -9999 -9999
timeloc   -100 -500 21 20 1

p1life      36 24
p1mp        5 38 
p1namej     36 2   36 13   15 18
p1icon      1 1
p1lifen     94 6
p1lifex     85 11
p1score     36 2   36 13   45 13 

e1life      36 72
e1icon      2 49
e1name      35 60==


p2life	    137 24
p2mp	    108 38
p2namej     139 2   139 13   120 18
p2icon      103 1
p2lifen     200 6
p2lifex     190 11
p2score     139 2   139 13   149 13 

e2life      136 72
e2icon      102 49
e2name      135 60

p3life      247 24
p3mp        215 38
p3namej     245 2   245 13   230 18
p3icon      210 1
p3lifen     305 6
p3lifex     295 11
p3score     245 2   245 13   255 13

e3life      244 72
e3icon      210 49
e3name      244 60

set Street_of_Brasileirinhos
lives      4
credits    1
custfade   50
#nosame    1
noshare    1
maxplayers 3
typemp     0
font	   2

z 180 239
file       data/levels/stage3/stage3.txt


next
 

Attachments

  • back.gif
    back.gif
    27.1 KB · Views: 6
  • panel.gif
    panel.gif
    14 KB · Views: 5
  • train.gif
    train.gif
    44.6 KB · Views: 5
Try this:
Code:
bglayer		data/levels/stage3/back.gif 0 0 0 0 0 0 1
bglayer		data/levels/stage3/train.gif 0 0 0 25 0 0 1 1 1 0 0 0 0 0 1
panel		data/levels/stage3/panel.gif  

bgspeed		30 1

You might need to adjust that 25 parameter to suit your need. That parameter defines vertical position of train.
 
Back
Top Bottom