MCPcopy Create free account
hub / github.com/EngoEngine/engo / tileFromGID

Method tileFromGID

common/tmx_level.go:372–387  ·  view source on GitHub ↗
(gid uint32, pt engo.Point)

Source from the content-addressed store, hash-verified

370}
371
372func (l *Level) tileFromGID(gid uint32, pt engo.Point) *Tile {
373 ret := &Tile{}
374 tex := l.resourceMap[gid]
375 ret.Image = &tex
376 ret.Point = pt
377
378 drawables, frames := []Drawable{}, []int{}
379 for i, id := range l.framesMap[gid] {
380 drawables = append(drawables, l.resourceMap[id])
381 frames = append(frames, i)
382 }
383 ret.Drawables = drawables
384 ret.Animation = &Animation{Name: "Tile", Frames: frames, Loop: true}
385
386 return ret
387}
388
389func convertFlipToRotation(flipping uint32) float32 {
390 flip_h := (flipping % tmx.HorizontalFlipFlag) != 0

Callers 2

createLevelFromTmxFunction · 0.95
unpackTilesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected