本文整理匯總了Golang中C.SDL_SetAlpha函數的典型用法代碼示例。如果您正苦於以下問題:Golang SDL_SetAlpha函數的具體用法?Golang SDL_SetAlpha怎麽用?Golang SDL_SetAlpha使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了SDL_SetAlpha函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: DrawImage
//Draws the image at the given coordinates.
func (me *Canvas) DrawImage(img *Image, x, y int) {
C.SDL_SetAlpha(img.img, C.SDL_SRCALPHA, 255)
var dest C.SDL_Rect
dest.x = C.Sint16(x + me.origin.X)
dest.y = C.Sint16(y + me.origin.Y)
C.SDL_BlitSurface(img.img, nil, me.pane, &dest)
}
示例2: SetAlpha
// Adjusts the alpha properties of a Surface.
func (s *Surface) SetAlpha(flags uint32, alpha uint8) int {
s.mutex.Lock()
status := int(C.SDL_SetAlpha(s.cSurface, C.Uint32(flags), C.Uint8(alpha)))
s.mutex.Unlock()
return status
}
示例3: SetAlpha
// Adjusts the alpha properties of a Surface.
func (s *Surface) SetAlpha(flags uint32, alpha uint8) int {
return int(C.SDL_SetAlpha((*C.SDL_Surface)(cast(s)), C.Uint32(flags), C.Uint8(alpha)))
}
示例4: setAlpha
// This function sets the alpha value for the entire surface, as opposed to
// using the alpha component of each pixel. This value measures the range
// of transparency of the surface, 0 being completely transparent to 255
// being completely opaque. An 'alpha' value of 255 causes blits to be
// opaque, the source pixels copied to the destination (the default). Note
// that per-surface alpha can be combined with colorkey transparency.
//
// If 'flag' is 0, alpha blending is disabled for the surface.
// If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
// OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
// surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
//
// The 'alpha' parameter is ignored for surfaces that have an alpha channel.
func setAlpha(surface *C.SDL_Surface, flag uint32, alpha uint8) int {
return int(C.SDL_SetAlpha(surface, C.Uint32(flag), C.Uint8(alpha)))
}