MCPcopy Create free account
hub / github.com/cogentcore/core / drawSprites

Method drawSprites

core/sprite.go:260–277  ·  view source on GitHub ↗

drawSprites draws sprites

(drw system.Drawer)

Source from the content-addressed store, hash-verified

258
259// drawSprites draws sprites
260func (ss *Sprites) drawSprites(drw system.Drawer) {
261 // fmt.Println("draw sprites")
262 sa := &ss.szAlloc
263 for gpi, ga := range sa.GpAllocs {
264 imgidx := spriteStart + gpi
265 for ii, spi := range ga {
266 if ss.Names.IndexIsValid(spi) != nil {
267 continue
268 }
269 sp := ss.Names.ValueByIndex(spi)
270 if !sp.Active {
271 continue
272 }
273 // fmt.Println("ds", imgidx, ii, sp.Geom.Pos)
274 drw.Copy(imgidx, ii, sp.Geom.Pos, image.Rectangle{}, draw.Over, system.NoFlipY)
275 }
276 }
277}

Callers 1

drawScenesMethod · 0.80

Calls 3

ValueByIndexMethod · 0.80
CopyMethod · 0.65
IndexIsValidMethod · 0.45

Tested by

no test coverage detected