Ejemplo n.º 1
0
func (f *Font) DrawJustified(color Color, x1, x2, y, diff float32, flags int, text string) {
	ctext := C.CString(text)
	defer C.free(unsafe.Pointer(ctext))

	C.al_draw_justified_text((*C.ALLEGRO_FONT)(f), C.ALLEGRO_COLOR(color),
		C.float(x1), C.float(x2), C.float(y), C.float(diff), C.int(flags), ctext)

}
Ejemplo n.º 2
0
func (col Color) GetYUV() (float32, float32, float32) {
	var h, s, l C.float
	cc := C.ALLEGRO_COLOR(col)
	C.al_color_rgb_to_yuv(cc.r, cc.g, cc.b, &h, &s, &l)
	return float32(h), float32(s), float32(l)
}
Ejemplo n.º 3
0
func (col Color) GetCMYK() (float32, float32, float32, float32) {
	var c, m, y, k C.float
	cc := C.ALLEGRO_COLOR(col)
	C.al_color_rgb_to_cmyk(cc.r, cc.g, cc.b, &c, &m, &y, &k)
	return float32(c), float32(m), float32(y), float32(k)
}
Ejemplo n.º 4
0
// Draws a pixel on the active display at the given location
// with the given color
func DrawPixel(x, y float32, color Color) {
	C.al_draw_pixel(C.float(x), C.float(y), C.ALLEGRO_COLOR(color))
}
Ejemplo n.º 5
0
// Convert to C
func (self Color) toC() C.ALLEGRO_COLOR {
	return C.ALLEGRO_COLOR(self)
}