Online Maps v3
Loading...
Searching...
No Matches
OnlineMapsBuffer Class Reference

This class is responsible for drawing the map.
Please do not use it if you do not know what you're doing.
Perform all operations with the map through other classes. More...

Classes

struct  StateProps
 The main properties of the map. More...
 

Public Member Functions

 OnlineMapsBuffer (OnlineMaps map)
 Constructor.
 
void ApplyTile (OnlineMapsTile tile)
 Adds a tile into the buffer.
 
void Dispose ()
 Dispose of buffer.
 
void GenerateFrontBuffer ()
 Generates the front buffer.
 
void GetCorners (out double tlx, out double tly, out double brx, out double bry)
 Get corners of the map.
 
void SetColorToBuffer (Color clr, OnlineMapsVector2i ip, int x, int y)
 Sets the color to the buffer.
 
void UnloadOldTiles ()
 Unload old tiles.
 
void UnloadOldTypes ()
 Unload old types of tiles.
 

Public Attributes

bool allowUnloadTiles = true
 Indicates that the buffer can unload tiles.
 
OnlineMaps map
 Reference to OnlineMaps.
 
OnlineMapsVector2i bufferPosition
 Position the tile, which begins buffer.
 
Color32[] frontBuffer
 Front buffer.
 
OnlineMapsVector2i frontBufferPosition
 Position the tile, which begins front buffer.
 
int height
 Height of the buffer.
 
bool needUnloadTiles
 Indicates that the buffer should unload tiles.
 
OnlineMapsBufferStatus status = OnlineMapsBufferStatus.wait
 The current status of the buffer.
 
int width
 Width of the buffer.
 
StateProps lastState
 The last state of the map.
 
StateProps renderState
 The current state of the map.
 

Properties

Vector2 topLeftPosition [get]
 The coordinates of the top-left the point of map that displays.
 

Detailed Description

This class is responsible for drawing the map.
Please do not use it if you do not know what you're doing.
Perform all operations with the map through other classes.

Constructor & Destructor Documentation

◆ OnlineMapsBuffer()

OnlineMapsBuffer.OnlineMapsBuffer ( OnlineMaps map)

Constructor.

Parameters
mapMap

Member Function Documentation

◆ ApplyTile()

void OnlineMapsBuffer.ApplyTile ( OnlineMapsTile tile)

Adds a tile into the buffer.

Parameters
tileTile

◆ GetCorners()

void OnlineMapsBuffer.GetCorners ( out double tlx,
out double tly,
out double brx,
out double bry )

Get corners of the map.

Parameters
tlxTop left longitude
tlyTop left latitude
brxBottom right longitude
bryBottom right latitude

◆ SetColorToBuffer()

void OnlineMapsBuffer.SetColorToBuffer ( Color clr,
OnlineMapsVector2i ip,
int x,
int y )

Sets the color to the buffer.

Parameters
clrColor
ipTile position
xPixel X
yPixel Y