当前位置: 首页>>代码示例>>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;未经允许,请勿转载。