New adjusts CameraBounds to the bounds of EntityScroller.
(*ecs.World)
| 373 | |
| 374 | // New adjusts CameraBounds to the bounds of EntityScroller. |
| 375 | func (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. |
| 386 | func (*EntityScroller) Priority() int { return EntityScrollerPriority } |
nothing calls this directly
no test coverage detected