CPCWiki forum

General Category => Programming => Topic started by: funkheld on 08:27, 25 July 20

Title: how do you make a sprite transparent? the color problem is almost solved.
Post by: funkheld on 08:27, 25 July 20

Hi good afternoon.

how do you make a sprite transparent in cpctelrea?


the color problem is almost solved.


greeting
Title: Re: how to get the palette so that bild.bmp in cpctelera is also green on the inside
Post by: Norman on 10:34, 25 July 20
If you're working in Mode 1, you only need four colors instead of 16. The palette used for conversion is defined in cfg/image_conversion.mk, have a look at that file and correct the palette definition. Then call
   cpct_setPalette  (my_palette, 4);
   cpct_setVideoMode(1);

That should do the trick.

Cheers
Title: Re: how to sprite transparent ? : the color problem is a bit solved.
Post by: funkheld on 11:45, 25 July 20
hello thanks.

the color problem is a bit solved.
now i would like to make the sprite transparent.

thank you.
greeting
Title: Re: how do you make a sprite transparent? the color problem is almost solved.
Post by: Norman on 14:50, 25 July 20
Nice to hear that.
For transparency, you have two options with CPCtelera:If you have more questions like that, the examples of CPCtelera are a gold mine to look at and understand how things are done.

Hope that helps,
Cheers
Title: Re: how do you make a sprite transparent? the color problem is almost solved.
Post by: funkheld on 15:51, 25 July 20

thanks for the information.


I don't understand the videos from the language.
the demos that are part of cpctelera are too big, go totally into the big which you can not follow.


greeting
Title: Re: how do you make a sprite transparent? the color problem is almost solved.
Post by: Norman on 16:03, 25 July 20
You mean the CPCtelera videos by Prof. Ronaldo that are mostly in spanish? You can turn on Subitles > "Automatic translation" > "English" (oder Deutsch  :) ), it's not perfect but pretty good. Just reading the code on the screen helps as well.

No, the demos/examples are actually quite small and easy to follow IMO, they're split into easy, medium, advanced etc. just for that reason. Fitting to this topic, there's a specific example for masked sprites: https://github.com/lronaldo/cpctelera/tree/master/examples/medium/maskedSprites (https://github.com/lronaldo/cpctelera/tree/master/examples/medium/maskedSprites). In the other examples you'll probably find additional uses of masked sprites. Just try playing around with the examples, change a thing here and there and see what happens. I think it helps immensely.

Cheers
Title: Re: how do you make a sprite transparent? the color problem is almost solved.
Post by: funkheld on 16:47, 25 July 20
hello thanks for the info for cpctelera.


greeting
Powered by SMFPacks Menu Editor Mod