├── .gitignore ├── Camera2D.gd ├── FreeCuteTileset ├── BG1.png ├── BG1.png.import ├── BG2.png ├── BG2.png.import ├── BG3.png ├── BG3.png.import ├── Decors.png ├── Decors.png.import ├── Tileset.png └── Tileset.png.import ├── Main.tscn ├── Minimap.gd ├── README.md ├── UNLICENSE ├── icon.png ├── icon.png.import ├── project.godot └── screenshot.png /.gitignore: -------------------------------------------------------------------------------- 1 | .import/ 2 | -------------------------------------------------------------------------------- /Camera2D.gd: -------------------------------------------------------------------------------- 1 | extends Camera2D 2 | 3 | 4 | export var speed = 60 5 | 6 | 7 | func _process(delta): 8 | if get_camera_screen_center().x > 950 or get_camera_screen_center().x < 0: 9 | speed *= -1 10 | position.x += speed * delta; 11 | -------------------------------------------------------------------------------- /FreeCuteTileset/BG1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eilamg/godot-tilemap-minimap/322ecb8e1f6d5f53832236e2e3f4af1d24a2a7b5/FreeCuteTileset/BG1.png -------------------------------------------------------------------------------- /FreeCuteTileset/BG1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/BG1.png-6e521e890020e3f88228e89d7a1c57b1.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://FreeCuteTileset/BG1.png" 13 | dest_files=[ "res://.import/BG1.png-6e521e890020e3f88228e89d7a1c57b1.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /FreeCuteTileset/BG2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eilamg/godot-tilemap-minimap/322ecb8e1f6d5f53832236e2e3f4af1d24a2a7b5/FreeCuteTileset/BG2.png -------------------------------------------------------------------------------- /FreeCuteTileset/BG2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/BG2.png-1d64528f890d1dd914df3c55922eeffb.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://FreeCuteTileset/BG2.png" 13 | dest_files=[ "res://.import/BG2.png-1d64528f890d1dd914df3c55922eeffb.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /FreeCuteTileset/BG3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eilamg/godot-tilemap-minimap/322ecb8e1f6d5f53832236e2e3f4af1d24a2a7b5/FreeCuteTileset/BG3.png -------------------------------------------------------------------------------- /FreeCuteTileset/BG3.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/BG3.png-04f9948bcd94541062cd42758a16622f.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://FreeCuteTileset/BG3.png" 13 | dest_files=[ "res://.import/BG3.png-04f9948bcd94541062cd42758a16622f.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /FreeCuteTileset/Decors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eilamg/godot-tilemap-minimap/322ecb8e1f6d5f53832236e2e3f4af1d24a2a7b5/FreeCuteTileset/Decors.png -------------------------------------------------------------------------------- /FreeCuteTileset/Decors.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/Decors.png-309df20bf23072684ff8bdaf60613f3f.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://FreeCuteTileset/Decors.png" 13 | dest_files=[ "res://.import/Decors.png-309df20bf23072684ff8bdaf60613f3f.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /FreeCuteTileset/Tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eilamg/godot-tilemap-minimap/322ecb8e1f6d5f53832236e2e3f4af1d24a2a7b5/FreeCuteTileset/Tileset.png -------------------------------------------------------------------------------- /FreeCuteTileset/Tileset.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/Tileset.png-eeba2c1cf1af8b4b20164c7b47db4c5d.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://FreeCuteTileset/Tileset.png" 13 | dest_files=[ "res://.import/Tileset.png-eeba2c1cf1af8b4b20164c7b47db4c5d.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=9 format=2] 2 | 3 | [ext_resource path="res://Camera2D.gd" type="Script" id=1] 4 | [ext_resource path="res://FreeCuteTileset/BG3.png" type="Texture" id=2] 5 | [ext_resource path="res://FreeCuteTileset/BG2.png" type="Texture" id=3] 6 | [ext_resource path="res://Minimap.gd" type="Script" id=4] 7 | [ext_resource path="res://FreeCuteTileset/BG1.png" type="Texture" id=5] 8 | [ext_resource path="res://FreeCuteTileset/Decors.png" type="Texture" id=6] 9 | [ext_resource path="res://FreeCuteTileset/Tileset.png" type="Texture" id=7] 10 | 11 | [sub_resource type="TileSet" id=1] 12 | 0/name = "land" 13 | 0/texture = ExtResource( 7 ) 14 | 0/tex_offset = Vector2( 0, 0 ) 15 | 0/modulate = Color( 1, 1, 1, 1 ) 16 | 0/region = Rect2( 0, 0, 128, 48 ) 17 | 0/tile_mode = 2 18 | 0/autotile/icon_coordinate = Vector2( 5, 2 ) 19 | 0/autotile/tile_size = Vector2( 16, 16 ) 20 | 0/autotile/spacing = 0 21 | 0/autotile/occluder_map = [ ] 22 | 0/autotile/navpoly_map = [ ] 23 | 0/autotile/priority_map = [ ] 24 | 0/autotile/z_index_map = [ ] 25 | 0/occluder_offset = Vector2( 0, 0 ) 26 | 0/navigation_offset = Vector2( 0, 0 ) 27 | 0/shape_offset = Vector2( 0, 0 ) 28 | 0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 29 | 0/shape_one_way = false 30 | 0/shape_one_way_margin = 0.0 31 | 0/shapes = [ ] 32 | 0/z_index = 0 33 | 1/name = "wall" 34 | 1/texture = ExtResource( 7 ) 35 | 1/tex_offset = Vector2( 0, 0 ) 36 | 1/modulate = Color( 1, 1, 1, 1 ) 37 | 1/region = Rect2( 0, 48, 80, 48 ) 38 | 1/tile_mode = 2 39 | 1/autotile/icon_coordinate = Vector2( 3, 2 ) 40 | 1/autotile/tile_size = Vector2( 16, 16 ) 41 | 1/autotile/spacing = 0 42 | 1/autotile/occluder_map = [ ] 43 | 1/autotile/navpoly_map = [ ] 44 | 1/autotile/priority_map = [ ] 45 | 1/autotile/z_index_map = [ ] 46 | 1/occluder_offset = Vector2( 0, 0 ) 47 | 1/navigation_offset = Vector2( 0, 0 ) 48 | 1/shape_offset = Vector2( 0, 0 ) 49 | 1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 50 | 1/shape_one_way = false 51 | 1/shape_one_way_margin = 0.0 52 | 1/shapes = [ ] 53 | 1/z_index = 0 54 | 2/name = "structure" 55 | 2/texture = ExtResource( 7 ) 56 | 2/tex_offset = Vector2( 0, 0 ) 57 | 2/modulate = Color( 1, 1, 1, 1 ) 58 | 2/region = Rect2( 80, 48, 48, 32 ) 59 | 2/tile_mode = 2 60 | 2/autotile/icon_coordinate = Vector2( 1, 0 ) 61 | 2/autotile/tile_size = Vector2( 16, 16 ) 62 | 2/autotile/spacing = 0 63 | 2/autotile/occluder_map = [ ] 64 | 2/autotile/navpoly_map = [ ] 65 | 2/autotile/priority_map = [ ] 66 | 2/autotile/z_index_map = [ ] 67 | 2/occluder_offset = Vector2( 0, 0 ) 68 | 2/navigation_offset = Vector2( 0, 0 ) 69 | 2/shape_offset = Vector2( 0, 0 ) 70 | 2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 71 | 2/shape_one_way = false 72 | 2/shape_one_way_margin = 0.0 73 | 2/shapes = [ ] 74 | 2/z_index = 0 75 | 3/name = "tree" 76 | 3/texture = ExtResource( 6 ) 77 | 3/tex_offset = Vector2( 0, 0 ) 78 | 3/modulate = Color( 1, 1, 1, 1 ) 79 | 3/region = Rect2( 16, 0, 80, 112 ) 80 | 3/tile_mode = 0 81 | 3/occluder_offset = Vector2( 0, 0 ) 82 | 3/navigation_offset = Vector2( 0, 0 ) 83 | 3/shape_offset = Vector2( 0, 0 ) 84 | 3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 85 | 3/shape_one_way = false 86 | 3/shape_one_way_margin = 0.0 87 | 3/shapes = [ ] 88 | 3/z_index = 0 89 | 4/name = "bush" 90 | 4/texture = ExtResource( 6 ) 91 | 4/tex_offset = Vector2( 0, 0 ) 92 | 4/modulate = Color( 1, 1, 1, 1 ) 93 | 4/region = Rect2( 112, 96, 48, 16 ) 94 | 4/tile_mode = 0 95 | 4/occluder_offset = Vector2( 0, 0 ) 96 | 4/navigation_offset = Vector2( 0, 0 ) 97 | 4/shape_offset = Vector2( 0, 0 ) 98 | 4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 99 | 4/shape_one_way = false 100 | 4/shape_one_way_margin = 0.0 101 | 4/shapes = [ ] 102 | 4/z_index = 0 103 | 5/name = "ruin" 104 | 5/texture = ExtResource( 6 ) 105 | 5/tex_offset = Vector2( 0, 0 ) 106 | 5/modulate = Color( 1, 1, 1, 1 ) 107 | 5/region = Rect2( 176, 80, 32, 32 ) 108 | 5/tile_mode = 0 109 | 5/occluder_offset = Vector2( 0, 0 ) 110 | 5/navigation_offset = Vector2( 0, 0 ) 111 | 5/shape_offset = Vector2( 0, 0 ) 112 | 5/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 113 | 5/shape_one_way = false 114 | 5/shape_one_way_margin = 0.0 115 | 5/shapes = [ ] 116 | 5/z_index = 0 117 | 118 | [node name="Main" type="Node2D"] 119 | 120 | [node name="Camera2D" type="Camera2D" parent="."] 121 | anchor_mode = 0 122 | current = true 123 | zoom = Vector2( 0.5, 0.5 ) 124 | script = ExtResource( 1 ) 125 | 126 | [node name="Tilemaps" type="CanvasLayer" parent="."] 127 | follow_viewport_enable = true 128 | 129 | [node name="back" type="TileMap" parent="Tilemaps"] 130 | tile_set = SubResource( 1 ) 131 | cell_size = Vector2( 16, 16 ) 132 | cell_quadrant_size = 4 133 | format = 1 134 | tile_data = PoolIntArray( 65575, 1, 0, 65576, 1, 2, 65589, 3, 0, 131108, 1, 0, 131109, 1, 1, 131110, 1, 1, 131111, 1, 131076, 131112, 1, 131074, 196645, 1, 65537, 196646, 1, 65540, 196647, 1, 131074, 262181, 1, 65540, 262182, 1, 131074, 262196, 2, 0, 262197, 2, 1, 262198, 2, 2, 327687, 5, 0, 327716, 1, 65537, 327717, 1, 131074, 327732, 2, 65536, 327733, 2, 65537, 327734, 2, 65538, 393217, 1, 65537, 393218, 1, 65538, 393268, 2, 65536, 393269, 2, 65537, 393270, 2, 65538, 524287, 1, 65537, 458753, 1, 65537, 458754, 1, 65538, 458759, 2, 65536, 458760, 2, 65538, 458762, 1, 0, 458763, 1, 1, 458764, 1, 1, 458765, 1, 1, 458782, 1, 65537, 458783, 1, 2, 458786, 1, 0, 458787, 1, 1, 458804, 2, 65536, 458805, 2, 65537, 458806, 2, 65538, 589822, 1, 0, 589823, 1, 65537, 524289, 1, 65537, 524290, 1, 65538, 524297, 1, 0, 524298, 1, 3, 524299, 1, 65537, 524300, 1, 65537, 524301, 1, 65537, 524318, 1, 65537, 524319, 1, 4, 524320, 1, 1, 524321, 1, 1, 524322, 1, 3, 524323, 1, 65537, 524324, 1, 65537, 655356, 1, 0, 655357, 1, 1, 655358, 1, 3, 655359, 1, 65537, 589833, 1, 65537, 589834, 1, 65537, 589835, 1, 65537, 589836, 1, 65537, 589844, 1, 1, 589845, 1, 1, 589846, 1, 1, 589854, 1, 65537, 589855, 1, 65537, 589856, 1, 65537, 589857, 1, 65537, 589858, 1, 65537, 589859, 1, 65537, 589860, 1, 65537, 589861, 1, 65537, 589862, 1, 2, 589879, 1, 65537, 589880, 1, 65537, 589881, 1, 2, 720890, 1, 0, 720891, 1, 1, 720892, 1, 3, 720893, 1, 65537, 720894, 1, 65537, 720895, 1, 65537, 655369, 1, 65537, 655370, 1, 65537, 655371, 1, 65537, 655372, 1, 65537, 655392, 1, 65537, 655393, 1, 65537, 655394, 1, 65537, 655395, 1, 65537, 655396, 1, 65537, 655397, 1, 65537, 655398, 1, 4, 655399, 1, 1, 655400, 1, 2, 655408, 1, 65537, 655409, 1, 65537, 655410, 1, 65537, 655411, 1, 65537, 655412, 1, 65537, 655413, 1, 65537, 655415, 1, 65537, 655416, 1, 65537, 655417, 1, 4, 655418, 1, 1, 655419, 1, 2, 786425, 1, 0, 786426, 1, 3, 786427, 1, 65537, 786428, 1, 65540, 786429, 1, 65537, 720905, 1, 65537, 720906, 1, 65537, 720907, 1, 65537, 720908, 1, 65537, 720928, 1, 65537, 720929, 1, 65537, 720930, 1, 65537, 720931, 1, 65537, 720932, 1, 65537, 720933, 1, 65537, 720934, 1, 65537, 720935, 1, 65537, 720936, 1, 131075, 720937, 1, 1, 720944, 1, 65537, 720945, 1, 65537, 720946, 1, 65537, 720947, 1, 65539, 720948, 1, 65537, 720949, 1, 65537, 720951, 1, 65537, 720952, 1, 65537, 720953, 1, 65537, 720954, 1, 65537, 720955, 1, 65538 ) 135 | 136 | [node name="middle" type="TileMap" parent="Tilemaps"] 137 | tile_set = SubResource( 1 ) 138 | cell_size = Vector2( 16, 16 ) 139 | cell_quadrant_size = 4 140 | format = 1 141 | tile_data = PoolIntArray( 65560, 3, 0, 262157, 2, 0, 262158, 2, 1, 262159, 2, 2, 262172, 2, 0, 262173, 2, 1, 262174, 2, 2, 327693, 2, 65536, 327694, 2, 65537, 327695, 2, 65538, 327708, 2, 65536, 327709, 2, 65537, 327710, 2, 65538, 393229, 2, 65536, 393230, 2, 65537, 393231, 2, 65538, 393246, 2, 65538, 393252, 0, 7, 393266, 2, 0, 393267, 2, 1, 393268, 2, 1, 393269, 2, 1, 393270, 2, 1, 393271, 2, 1, 393272, 2, 2, 458758, 4, 0, 458765, 2, 65536, 458766, 2, 65537, 458767, 2, 65538, 458768, 5, 0, 458788, 0, 7, 458802, 2, 65536, 458803, 2, 65537, 458804, 2, 65537, 458805, 2, 65537, 458806, 2, 65537, 458807, 2, 65537, 458808, 2, 65538, 524301, 2, 65536, 524302, 2, 65537, 524303, 2, 65538, 655358, 4, 0 ) 142 | 143 | [node name="front" type="TileMap" parent="Tilemaps"] 144 | tile_set = SubResource( 1 ) 145 | cell_size = Vector2( 16, 16 ) 146 | cell_quadrant_size = 4 147 | format = 1 148 | tile_data = PoolIntArray( -65538, 3, 0, 65540, 3, 0, 65576, 0, 131077, 65582, 3, 0, 131087, 3, 0, 131106, 4, 0, 196642, 0, 0, 196643, 0, 1, 196644, 0, 1, 196645, 0, 2, 262178, 0, 131072, 262179, 0, 4, 262180, 0, 3, 262181, 0, 131074, 393215, 0, 0, 327680, 0, 1, 327681, 0, 1, 327682, 0, 2, 327707, 0, 0, 327708, 0, 2, 327715, 0, 65536, 327716, 0, 65538, 458750, 0, 0, 458751, 0, 3, 393216, 0, 6, 393217, 0, 65540, 393218, 0, 131074, 393243, 0, 65536, 393244, 0, 4, 393245, 0, 1, 393246, 0, 2, 393251, 0, 65536, 393252, 0, 0, 393253, 0, 1, 393254, 0, 2, 393269, 5, 0, 524286, 0, 131072, 524287, 0, 5, 458752, 0, 65537, 458753, 0, 65538, 458779, 0, 65536, 458780, 0, 65539, 458781, 0, 65537, 458782, 0, 65538, 458787, 0, 131072, 458788, 0, 65536, 458789, 0, 65542, 458790, 0, 131074, 458801, 4, 0, 589823, 0, 65536, 524288, 0, 65541, 524289, 0, 65538, 524290, 4, 0, 524293, 0, 0, 524294, 0, 1, 524295, 0, 1, 524296, 0, 2, 524302, 4, 0, 524313, 0, 0, 524314, 0, 1, 524315, 0, 3, 524316, 0, 65537, 524317, 0, 65537, 524318, 0, 65538, 524324, 0, 65536, 524325, 0, 65538, 524334, 0, 0, 524335, 0, 1, 524336, 0, 1, 524337, 0, 1, 524338, 0, 1, 524339, 0, 1, 524340, 0, 1, 524341, 0, 1, 524342, 0, 1, 524343, 0, 1, 524344, 0, 1, 524345, 0, 2, 655359, 0, 65536, 589824, 0, 7, 589825, 0, 4, 589826, 0, 1, 589827, 0, 1, 589828, 0, 1, 589829, 0, 3, 589830, 0, 5, 589831, 0, 6, 589832, 0, 4, 589833, 0, 2, 589836, 0, 0, 589837, 0, 1, 589838, 0, 1, 589839, 0, 1, 589840, 0, 1, 589841, 0, 1, 589842, 0, 1, 589843, 0, 1, 589844, 0, 2, 589846, 0, 0, 589847, 0, 1, 589848, 0, 1, 589849, 0, 1, 589850, 0, 3, 589851, 0, 65537, 589852, 0, 65537, 589853, 0, 7, 589854, 0, 4, 589855, 0, 1, 589856, 0, 2, 589860, 0, 65536, 589861, 0, 65538, 589868, 0, 0, 589869, 0, 1, 589870, 0, 1, 589871, 0, 1, 589872, 0, 3, 589873, 0, 65537, 589874, 0, 7, 589875, 0, 6, 589876, 0, 65541, 589877, 0, 65537, 589878, 0, 65537, 589879, 0, 65537, 589880, 0, 65537, 589881, 0, 131074, 720893, 0, 0, 720894, 0, 1, 720895, 0, 1, 655360, 0, 1, 655361, 0, 1, 655362, 0, 3, 655363, 0, 65542, 655364, 0, 65537, 655365, 0, 65537, 655366, 0, 6, 655367, 0, 65541, 655368, 0, 65542, 655369, 0, 65538, 655372, 0, 65536, 655373, 0, 6, 655374, 0, 65537, 655375, 0, 65541, 655376, 0, 6, 655377, 0, 7, 655378, 0, 65537, 655379, 0, 65537, 655380, 0, 4, 655381, 0, 1, 655382, 0, 3, 655383, 0, 65541, 655384, 0, 65537, 655385, 0, 65537, 655386, 0, 65541, 655387, 0, 65537, 655388, 0, 65537, 655389, 0, 65537, 655390, 0, 65537, 655391, 0, 65541, 655392, 0, 65538, 655396, 0, 65536, 655397, 0, 65538, 655401, 0, 0, 655402, 0, 1, 655403, 0, 1, 655404, 0, 1, 655405, 0, 1, 655406, 0, 3, 655407, 0, 6, 655408, 0, 65537, 655409, 0, 65540, 655410, 0, 131073, 655411, 0, 131073, 655412, 0, 131073, 655413, 0, 65539, 655414, 0, 65537, 655415, 0, 65539, 655416, 0, 65538, 786429, 0, 65536, 786430, 0, 65537, 786431, 0, 65537, 720896, 0, 65537, 720897, 0, 65537, 720898, 0, 65537, 720899, 0, 65537, 720900, 0, 65537, 720901, 0, 4, 720902, 0, 1, 720903, 0, 3, 720904, 0, 65537, 720905, 0, 65538, 720908, 0, 65536, 720909, 0, 65537, 720910, 0, 65537, 720911, 0, 4, 720912, 0, 1, 720913, 0, 1, 720914, 0, 1, 720915, 0, 3, 720916, 0, 65537, 720917, 0, 65537, 720918, 0, 65537, 720919, 0, 65537, 720920, 0, 65537, 720921, 0, 7, 720922, 0, 65537, 720923, 0, 4, 720924, 0, 1, 720925, 0, 3, 720926, 0, 7, 720927, 0, 65537, 720928, 0, 65538, 720932, 0, 65536, 720933, 0, 65538, 720937, 0, 65536, 720938, 0, 65539, 720939, 0, 65537, 720940, 0, 65537, 720941, 0, 65537, 720942, 0, 65537, 720943, 0, 65537, 720944, 0, 65540, 720945, 0, 131074, 720949, 0, 65536, 720950, 0, 65537, 720951, 0, 65540, 720952, 0, 131074 ) 149 | 150 | [node name="BG" type="CanvasLayer" parent="."] 151 | layer = -1 152 | 153 | [node name="BG1" type="Sprite" parent="BG"] 154 | scale = Vector2( 2, 2 ) 155 | texture = ExtResource( 5 ) 156 | centered = false 157 | 158 | [node name="BG2" type="Sprite" parent="BG"] 159 | scale = Vector2( 2, 2 ) 160 | texture = ExtResource( 3 ) 161 | centered = false 162 | 163 | [node name="BG3" type="Sprite" parent="BG"] 164 | scale = Vector2( 2, 2 ) 165 | texture = ExtResource( 2 ) 166 | centered = false 167 | 168 | [node name="UI" type="CanvasLayer" parent="."] 169 | 170 | [node name="PanelContainer" type="PanelContainer" parent="UI"] 171 | self_modulate = Color( 0, 0, 0, 0.5 ) 172 | anchor_left = 1.0 173 | anchor_right = 1.0 174 | margin_left = -200.0 175 | margin_top = 20.0 176 | margin_right = -20.0 177 | margin_bottom = 90.0 178 | __meta__ = { 179 | "_edit_use_anchors_": false 180 | } 181 | 182 | [node name="MarginContainer" type="MarginContainer" parent="UI/PanelContainer"] 183 | margin_left = 7.0 184 | margin_top = 7.0 185 | margin_right = 173.0 186 | margin_bottom = 63.0 187 | custom_constants/margin_right = 5 188 | custom_constants/margin_top = 5 189 | custom_constants/margin_left = 5 190 | custom_constants/margin_bottom = 5 191 | 192 | [node name="MiniMap" type="Control" parent="UI/PanelContainer/MarginContainer"] 193 | margin_left = 5.0 194 | margin_top = 5.0 195 | margin_right = 161.0 196 | margin_bottom = 51.0 197 | rect_clip_content = true 198 | script = ExtResource( 4 ) 199 | camera_node = NodePath("../../../../Camera2D") 200 | tilemap_nodes = [ NodePath("../../../../Tilemaps/back"), NodePath("../../../../Tilemaps/middle"), NodePath("../../../../Tilemaps/front") ] 201 | cell_colors = { 202 | 0: Color( 0.686275, 0.85098, 0.501961, 1 ), 203 | 1: Color( 0.223529, 0.160784, 0.235294, 1 ), 204 | 2: Color( 0.247059, 0.439216, 0.627451, 1 ) 205 | } 206 | zoom = 4.0 207 | -------------------------------------------------------------------------------- /Minimap.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | 4 | export(NodePath) var camera_node 5 | export(Array, NodePath) var tilemap_nodes 6 | export(Dictionary) var cell_colors 7 | export var zoom = 1.0 8 | 9 | 10 | onready var camera = get_node(camera_node) 11 | var tilemaps = [] 12 | 13 | 14 | func _ready(): 15 | for node in tilemap_nodes: 16 | tilemaps.append(get_node(node)) 17 | 18 | 19 | func get_cells(tilemap : TileMap, id): 20 | return tilemap.get_used_cells_by_id(id) 21 | 22 | 23 | func _draw(): 24 | draw_set_transform(rect_size / 2, 0, Vector2.ONE) 25 | 26 | for tilemap in tilemaps: 27 | var camera_position = camera.get_camera_screen_center() 28 | var camera_cell = tilemap.world_to_map(camera_position) 29 | var tilemap_offset = camera_cell + (camera_position - tilemap.map_to_world(camera_cell)) / tilemap.cell_size 30 | 31 | for id in cell_colors.keys(): 32 | var color = cell_colors[id] 33 | var cells = get_cells(tilemap, id) 34 | for cell in cells: 35 | draw_rect(Rect2((cell - tilemap_offset) * zoom, Vector2.ONE * zoom), color) 36 | 37 | 38 | func _process(delta): 39 | update() 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tilemap Minimap 2 | An example Godot project demonstrating how to use tilemaps to render a minimap. 3 | 4 | ![screenshot](screenshot.png "Tilemap Minimap") 5 | 6 | Uses the excellent [Free Pixelart Tileset - Cute Forest](https://aamatniekss.itch.io/free-pixelart-tileset-cute-forest) by [aamatniekss](https://aamatniekss.itch.io/). 7 | 8 | See it [running in your browser over on itch](https://akimbo.itch.io/godot-tilemap-minimap). 9 | -------------------------------------------------------------------------------- /UNLICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eilamg/godot-tilemap-minimap/322ecb8e1f6d5f53832236e2e3f4af1d24a2a7b5/icon.png -------------------------------------------------------------------------------- /icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="TilemapMinimap" 19 | run/main_scene="res://Main.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [display] 23 | 24 | window/size/width=640 25 | window/size/height=384 26 | window/size/always_on_top=true 27 | 28 | [rendering] 29 | 30 | quality/depth/hdr=false 31 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eilamg/godot-tilemap-minimap/322ecb8e1f6d5f53832236e2e3f4af1d24a2a7b5/screenshot.png --------------------------------------------------------------------------------