How do you write the color in drawLineScreen()?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Acegikmo
Posts: 15
Joined: Sat Jul 19, 2008 1:18 am

How do you write the color in drawLineScreen()?

Post by Acegikmo »

Yeah, I don't know what way to write the color.

drawLineScreen(ax, ay, bx, by, ??? );

So, for example, how do I draw a white line that's not transparent with this?
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

I looked at graphics.h from luaplayer source and color is just an int like this: 0xAABBGGRR. There seem to be some macros available too, they work like this:

Code: Select all

Color color;
color = A(0x00) | B(0xFF) | G(0xFF) | R(0xFF);
drawLineScreen(x1, y1, x2, y2, color);

// or just
drawLineScreen(x1, y1, x2, y2, 0x00FFFFFF);
That will get you white, but I don't know if the alpha is meant to be 0x00 or 0xFF for opaque.
(+[__]%)
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

apha should be FF for opaque.
Ciao! from Italy
Acegikmo
Posts: 15
Joined: Sat Jul 19, 2008 1:18 am

Post by Acegikmo »

Thanks, I'll try that
Post Reply