Map Panning
Summary
When a CharacterMapObject approaches the border of a Map, the Map must pan to reveal more so that the user can make decisions about movement.
Panning the Map
Map Panning itself is already well handled by Map::setFocusPo
old focus point.
When panning the map, a new focus point will be selected by attempting to place the CharacterMapObject in the center of the screen.
User Defined Events
The event generated when the CharacterMapObject exceeds the threshold at the borders of the visible screen will be an SDL User Generated Event [1]. By using SDL's event queue, we can avoid implementing one of our own. Asgard's controller already reads SDL events from the SDL event queue.
Asgard will maintain an enumerated list of user defined event codes. One of which will be this Map Pan event.
An event handling thread, hosted by the Map component, will handle the Map Pan event.
Threshold
Map will specify a threshold in terms of a percentage.
ThresholdTop = ScreenTop + 0 + (ScreenHeight * ThresholdPercen
ThresholdBottom = ScreenTop + ScreenHeight - (ScreenHeight * ThresholdPercen
ThresholdLeft = ScreenLeft + 0 + (ScreenWidth * ThresholdPercen
ThresholdRight = ScreenLeft + ScreenWidth - (ScreenWidth * ThresholdPercen
If the CharacterMapObj
Special Case: CharacterMapObject Movement During Panning
What about map panning while a CharacterMapObject is moving into the 'threshold'? The answer:
1. Do not allow there to be more than one map panning thread at a time.
2. All mouse clicks during a Map Pan event must queue or overwrite each other and be handled by the single Map Pan event handling thread.
3. The velocity of the map panning should always be faster than the velocity of the moving CharacterMapObject,
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- Russ Adams
- Definition:
- Approved
- Series goal:
- Accepted for thegrandmap
- Implementation:
- Implemented
- Milestone target:
- 0.3.8
- Started by
- Russ Adams
- Completed by
- Russ Adams