Autor Tema: Graphics question  (Leído 5943 veces)

Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Graphics question
« Respuesta #15 en: Diciembre 13, 2009, 12:29:00 am »
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

  • Newbie
  • *
  • Mensajes: 30
  • Karma: 0
  • let_me_alone();
Re: Graphics question
« Respuesta #16 en: Diciembre 13, 2009, 09:21:30 am »
So bennu cannot auto-generate alpha channel?
Function Int Write_Signature()
Private
Begin
End;

Sandman

  • Sr. Member
  • ****
  • Mensajes: 298
  • Karma: 48
Re: Graphics question
« Respuesta #17 en: Diciembre 13, 2009, 12:45:15 pm »
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

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Graphics question
« Respuesta #18 en: Diciembre 13, 2009, 06:42:07 pm »
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

  • Newbie
  • *
  • Mensajes: 30
  • Karma: 0
  • let_me_alone();
Re: Graphics question
« Respuesta #19 en: Diciembre 13, 2009, 10:20:34 pm »
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

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Graphics question
« Respuesta #20 en: Diciembre 14, 2009, 01:12:55 am »
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

  • Hero Member
  • *****
  • Mensajes: 6329
  • Karma: 162
  • Odio el periodo "entre proyectos"
    • La web de Drumpi
Re: Graphics question
« Respuesta #21 en: Diciembre 15, 2009, 03:50:05 am »
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

  • Newbie
  • *
  • Mensajes: 30
  • Karma: 0
  • let_me_alone();
Re: Graphics question
« Respuesta #22 en: Diciembre 31, 2009, 08:52:35 pm »
Got evrything to working the way I wanted! :)

Thanks evryone.

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