Forum

> > CS2D > Scripts > Problem with images
Forums overviewCS2D overview Scripts overviewLog in to reply

English Problem with images

5 replies
To the start Previous 1 Next To the start

old Problem with images

Starkkz
Moderator Off Offline

Quote
I'm trying to make a darker map but i have a problem with the shade and the alpha.

1
2
3
4
5
6
7
8
9
10
11
12
13
ShadowSprite = "gfx/layers/zm_noamz_ShadowMap.png"
LightSprite = "gfx/layers/zm_noamz_LightMap.png"

function noamz.LoadMapEffects()
	Shadow = image(ShadowSprite,0,1,3)
	Light = image(LightSprite,0,1,3)
	imageblend(Light,2)
	imageblend(Shadow,2)
	imagepos(Shadow,(map("xsize")*16)+16,(map("ysize")*16)+16,0)
	imagepos(Light,(map("xsize")*16)+16,(map("ysize")*16)+16,0)
	imagealpha(Light,0)
	imagealpha(Shadow,0)
end

I'm not doing this with the map editor because i wanna change his alpha mode each time, I don't understand why doesn't it change the transparent.

Any help?

old Re: Problem with images

Roni
User Off Offline

Quote
you´re jsut changeing them to invisibale ( alpha 0) is this really what you want?
btw it seems liek you´re recreating the iamges everytime you call this function... i dont think thats right.
you should move the image creation into the start hook (since images get cleared after restart) and then just try the function again.

old Re: Problem with images

J4x
User Off Offline

Quote
the tool says that light layer uses 0.3 of tranparency...
and that shadow layer should be applied over light layer.
edited 1×, last 02.05.11 12:23:10 am

old Re: Problem with images

Starkkz
Moderator Off Offline

Quote
Yes roni, i want to use alpha 0 for testing, but with that doesn't work too. I just used:

1.- Create the image
2.- Change his blend mode
3.- change his alpha

but if i change the blend mode, i can't change the alpha.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview