with backgroung + composition

This commit is contained in:
2019-10-27 03:00:48 +03:00
parent 184ac149ee
commit 4a77323aab
3 changed files with 59 additions and 46 deletions

View File

@ -45,11 +45,14 @@ func (layer *Layer) PutWithRawBackground(x,y int, symbol interface{}, bgColor ui
func (layer *Layer) PutWithBackground(x,y int, symbol interface{}, bgColorName string) {
layer.before()
prevColor := uint32(blt.State(blt.TK_COLOR))
prevCompMode := blt.State(blt.TK_COMPOSITION)
c := blt.ColorFromName(bgColorName)
blt.Color(c)
blt.Composition(1)
layer.Put(x,y,"█")
blt.Color(prevColor)
layer.Put(x,y, symbol)
blt.Composition(prevCompMode)
}
func (layer *Layer) after() *Layer {