Пример #1
0
func (e *PU_Engine) DrawFillRect(_rect *PU_Rect, _color *sdl.Color, _alpha uint8) {
	sdl.SetRenderDrawColor(e.renderer, _color.R, _color.G, _color.B, _alpha)
	sdl.SetRenderDrawBlendMode(e.renderer, sdl.BLENDMODE_BLEND)
	sdl.RenderFillRect(e.renderer, *_rect.ToSDL())
	sdl.SetRenderDrawBlendMode(e.renderer, sdl.BLENDMODE_NONE)
	sdl.SetRenderDrawColor(e.renderer, 0, 0, 0, 255)
}
Пример #2
0
func DrawFillRect(_rect *Rect, _red, _green, _blue, _alpha uint8) {
	sdl.SetRenderDrawColor(g_game.renderer, _red, _green, _blue, _alpha)
	sdl.SetRenderDrawBlendMode(g_game.renderer, sdl.BLENDMODE_BLEND)
	sdl.RenderFillRect(g_game.renderer, *_rect.toSDL())
	sdl.SetRenderDrawBlendMode(g_game.renderer, sdl.BLENDMODE_NONE)
	sdl.SetRenderDrawColor(g_game.renderer, 0, 0, 0, 255)
}