Graphics question

Started by quasist, December 07, 2009, 10:29:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Windgate

Let's see:

Take ANY sprite, save it as .png, open it with Paint.NET, select magic wand tool and set 0% tolerancy, click on backgrund colour to select it all, key Supr to set it as alpha, save the .png, put it on your fpg or just load it with load_png.

That's all, it MUST work.

PD: set_mode ( ... , ... , 16 , ... );
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

quasist

So bennu cannot auto-generate alpha channel?
Function Int Write_Signature()
Private
Begin
End;

Sandman

What would that do?

If you have a 16bit graphic (not the file), the color 0 is transparent. Depending on the file loaded this is NOT the same as black. If the file has an alpha channel, then that is used to make specific parts (the <50% alpha parts) color 0. Black parts (rgb(0,0,0)) do NOT get color 0, but get color 1, which is practically black. When loading files WITHOUT an alpha channel, THEN the black (rgb(0,0,0)) is used to determine transparent parts.

For 32bit, this doesn't matter at all: f you load a 32bit graphic in the 32bit mode, then it's mapped 1-on-1. If you load a 16bit graphic without alpha channel in 32bit mode, it's the same as described above.

Does this clear things up?
-- Sandman

Windgate

Quote from: quasist on December 13, 2009, 09:21:30 AM
So bennu cannot auto-generate alpha channel?

Maybe... I don't know but I always use the magic wand way...
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

quasist

Got today my blitting working :). Too bad that bennu requires off-hand tools for alpha carving. But good cause to install photoshop :)
Function Int Write_Signature()
Private
Begin
End;

Windgate

I think it is possible to set a colour as alpha, but sorry, I don't know how to do this... Maybe anyone answer us about this, not me :P
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Drumpi

Bennu, like Fenix, and like DIV game studio (father and grandfather of Bennu) never allow to user to select the transparent colour: in 8 bits mode, the first color of the palette, color 0, is the transparent colour, BUT you can set the RGB asociated to it for working with graphics editors.
In 16 bits mode, color 0 is the only transparent color, as same as 8bits, but you cannot set his RGB because EVERY color in 16 bits has an associated RGB value (defined by his bits: 5,6,5 for R,G,B component).

32 bits mode is new in Bennu, an add an alpha channel: its an 8bits extra information for alpha or transparency (8,8,8,8 for R,G,B,A components).
But be careful with collision function, it takes only color 0 as REAL transparent (pixels that not collide with others graphics).
Hala, como con 1001 procesos sólo va a 9 FPS, vamos a meterle 32 veces más, a ver si revienta.
(Drumpi epic moment)

quasist

Got evrything to working the way I wanted! :)

Thanks evryone.

Happy new year!
Function Int Write_Signature()
Private
Begin
End;