當前位置: 首頁>>代碼示例>>Golang>>正文


Golang C.SDL_SetAlpha函數代碼示例

本文整理匯總了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)
}
開發者ID:griffy,項目名稱:starfish,代碼行數:8,代碼來源:canvas.go

示例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
}
開發者ID:kearsley,項目名稱:Go-SDL,代碼行數:7,代碼來源:sdl.go

示例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)))
}
開發者ID:gnanderson,項目名稱:Go-SDL,代碼行數:4,代碼來源:sdl.go

示例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)))
}
開發者ID:beoran,項目名稱:fungo,代碼行數:16,代碼來源:video.go


注:本文中的C.SDL_SetAlpha函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。