Skip to content

yiyuezhuo/MapKit

Repository files navigation

MapKit

out2

Provides some helpers to make area movement mechanism for Godot Mono.

  • Map scrolling
  • Selected area highlighting & event.
  • A reference data backend using an external tool.

Requirements

  • Newtonsoft.Json

Add following content to *.csproj

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
  </ItemGroup>

For example:

<Project Sdk="Godot.NET.Sdk/3.3.0">
  <PropertyGroup>
    <TargetFramework>net472</TargetFramework>
    <RootNamespace>MapKit</RootNamespace>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
  </ItemGroup>
</Project>

Or add it using dotnet command:

dotnet add package Newtonsoft.Json

Usage

The addons provides a Japan map sample to show the usage.

Detailed Pipeline

  • Create a paradox style pixel color province map base_map:
  • Use pixel-map-preprocessor to create remap and related json data: dotnet run your_image_path.
  • Create a mapData.tres resource, set the script to addons/MapKit/Scripts/MapData.cs, set Base Texture to the base_map, and set Region Data Path to generated json file.
  • Create a map_material.tres of ShaderMaterial and set shader to addons/MapKit/Shaders/map2.gds, set Base Texture to base_map, and set Remap Texture to generated remap texture in "Shader Param".
  • Create a new scene and instance addons/MapKit/Sample/SampleMapView.tscn, set Ui State Data Res of MapView node (root node) to uiStateData.tres. In Map node, set Map Data Resource to mapData.tres, texture to base_map and material to map_material.tres.
  • Try to play the scene.

About

Area movement mechanism for Godot Mono (C#)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages