Navigation & Camera API

advanced scripting

World Map Strategy Kit · Scripting Support (C#)

Class: WMSK (namespace WorldMapStrategyKit)

Navigation API

Methods for camera control, navigation, and zoom.

Fly-To Methods

bool FlyToCountry(string countryName, float duration = 1f, float zoomLevel = 0.8f)

Smoothly navigates the camera to a country. Returns true if the country was found.

bool FlyToCountry(int countryIndex, float duration = 1f, float zoomLevel = 0.8f)

Smoothly navigates to a country by index.

bool FlyToProvince(int provinceIndex, float duration = 1f, float zoomLevel = 0.8f)

Smoothly navigates to a province.

void FlyToCity(int cityIndex, float duration = 1f, float zoomLevel = 0.9f)

Smoothly navigates to a city.

void FlyToCity(string cityName, string countryName, float duration = 1f, float zoomLevel = 0.9f)

Smoothly navigates to a city by name and country.

void FlyToLocation(Vector2 mapPosition, float duration = 1f, float zoomLevel = 0.8f)

Smoothly navigates to a specific map coordinate.

void FlyToLatLon(float latitude, float longitude, float duration = 1f, float zoomLevel = 0.8f)

Smoothly navigates to a geographic coordinate.

Camera Control

bool allowUserDrag { get; set; }

Enable or disable map dragging by the user.

bool allowUserZoom { get; set; }

Enable or disable zooming by the user (mouse wheel/pinch).

bool allowUserRotation { get; set; }

Enable or disable map rotation by the user.

bool respectOtherUI { get; set; }

Prevents map interaction when the pointer is over UI elements.

Vector2 centerLocation { get; set; }

The current center position of the map in 2D local coordinates.

Zoom Control

float zoomLevel { get; set; }

Current zoom level (0 = fully zoomed out, 1 = fully zoomed in).

float zoomMin { get; set; }

Minimum allowed zoom level (default 0).

float zoomMax { get; set; }

Maximum allowed zoom level (default 1).

void SetZoom(float zoomLevel, float duration = 0f)

Sets the zoom level, optionally with smooth animation.

View State

void CenterMap()

Centers the map at the default position (0, 0).

bool isFlying { get; }

Returns true if a fly-to animation is currently in progress.

Was this page helpful?