Interface ITextModePointerMapper
Maps a screen point to a position on a TextMode grid when the grid is not shown in its own place on screen, for example when a CRT effect curves and letterboxes it.
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public interface ITextModePointerMapper
Remarks
Install a mapper through PointerMapper. The view's ScreenPointToCell(Vector2, Camera, out CellPosition) then asks the mapper instead of using its own rectangle, so text selection, mouse reporting and hyperlink clicks follow the displayed image without any change on their side.
Whoever installs a mapper removes it again when it stops showing the grid.
Methods
TryMapScreenPoint(Vector2, Camera, out Vector2)
Maps a screen point to a normalized position on the grid.
Declaration
bool TryMapScreenPoint(Vector2 screenPoint, Camera eventCamera, out Vector2 gridUV)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | screenPoint | Screen-space point (e.g. from |
| Camera | eventCamera | The camera passed to ScreenPointToCell(Vector2, Camera, out CellPosition). |
| Vector2 | gridUV | The position on the grid, from (0, 0) at the top-left corner of the first cell to (1, 1) at the bottom-right corner of the last one. |
Returns
| Type | Description |
|---|---|
| bool | True if the point lies on the displayed grid; false if it lies outside it. |