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

Method New

common/camera.go:375–383  ·  view source on GitHub ↗

New adjusts CameraBounds to the bounds of EntityScroller.

(*ecs.World)

Source from the content-addressed store, hash-verified

373
374// New adjusts CameraBounds to the bounds of EntityScroller.
375func (c *EntityScroller) New(*ecs.World) {
376 offsetX, offsetY := engo.GameWidth()/2, engo.GameHeight()/2
377
378 CameraBounds.Min.X = c.TrackingBounds.Min.X + (offsetX / engo.GetGlobalScale().X)
379 CameraBounds.Min.Y = c.TrackingBounds.Min.Y + (offsetY / engo.GetGlobalScale().Y)
380
381 CameraBounds.Max.X = c.TrackingBounds.Max.X - (offsetX / engo.GetGlobalScale().X)
382 CameraBounds.Max.Y = c.TrackingBounds.Max.Y - (offsetY / engo.GetGlobalScale().Y)
383}
384
385// Priority implements the ecs.Prioritizer interface.
386func (*EntityScroller) Priority() int { return EntityScrollerPriority }

Callers

nothing calls this directly

Calls 3

GameWidthFunction · 0.92
GameHeightFunction · 0.92
GetGlobalScaleFunction · 0.92

Tested by

no test coverage detected