diff --git a/resources/map/21N3.tmx b/resources/map/21N3.tmx
new file mode 100644
index 0000000..1d8fb8b
--- /dev/null
+++ b/resources/map/21N3.tmx
@@ -0,0 +1,159 @@
+
+
diff --git a/resources/map/Maps.tiled-project b/resources/map/Maps.tiled-project
index cc94a63..08bf26e 100644
--- a/resources/map/Maps.tiled-project
+++ b/resources/map/Maps.tiled-project
@@ -4,7 +4,8 @@
],
"extensionsPath": ".",
"folders": [
- "."
+ ".",
+ "png"
],
"objectTypesFile": "",
"propertyTypes": [
diff --git a/resources/map/Maps.tiled-session b/resources/map/Maps.tiled-session
index d5719c9..12c66dd 100644
--- a/resources/map/Maps.tiled-session
+++ b/resources/map/Maps.tiled-session
@@ -3,16 +3,26 @@
"height": 4300,
"width": 2
},
- "activeFile": "test_couloir.tmx",
+ "activeFile": "21N3.tmx",
"expandedProjectPaths": [
+ "assets",
+ "png",
"."
],
- "file.lastUsedOpenFilter": "Fichiers de jeu de tuiles Tiled (*.tsx *.xml)",
+ "file.lastUsedOpenFilter": "Tous les Fichiers (*)",
"fileStates": {
"": {
"scaleInDock": 1,
"scaleInEditor": 1
},
+ "21N3.tmx": {
+ "scale": 1.5,
+ "selectedLayer": 3,
+ "viewCenter": {
+ "x": 225.66666666666663,
+ "y": 171.66666666666666
+ }
+ },
"C:/Users/remi/AppData/Roaming/Tiled/#Tests": {
"dynamicWrapping": true
},
@@ -131,10 +141,14 @@
"scaleInEditor": 1
},
"assets/Dungeon_v2.tsx": {
+ "scaleInDock": 0.75,
+ "scaleInEditor": 1.5
+ },
+ "assets/HKU tileset.tsx": {
"scaleInDock": 1,
"scaleInEditor": 1
},
- "assets/HKU tileset.tsx": {
+ "assets/Interior.tsx": {
"scaleInDock": 1,
"scaleInEditor": 1
},
@@ -145,7 +159,11 @@
},
"assets/Interior_v2.tsx": {
"scaleInDock": 1,
- "scaleInEditor": 1
+ "scaleInEditor": 3
+ },
+ "assets/MegaPixelArt_v2.tsx": {
+ "scaleInDock": 1,
+ "scaleInEditor": 3
},
"assets/OuterTileset.tsx": {
"scaleInDock": 1,
@@ -198,8 +216,8 @@
"scale": 0.75,
"selectedLayer": 1,
"viewCenter": {
- "x": 640,
- "y": 640
+ "x": 639.3333333333333,
+ "y": 640.6666666666666
}
},
"desert.tmx#Desert": {
@@ -228,8 +246,8 @@
"scale": 1.5,
"selectedLayer": 4,
"viewCenter": {
- "x": 299.66666666666663,
- "y": 221
+ "x": 462.99999999999994,
+ "y": 292.3333333333333
}
},
"test_couloir.tmx#Dungeon_Tileset": {
@@ -274,7 +292,7 @@
},
"last.exportedFilePath": "C:/Users/remi/OneDrive/Documents/Cours/05-HEVS/S2fb/informatic/vscode/tests_gdx2d_gradle/app/src/main/java/test_map/data",
"last.externalTilesetPath": "C:/Users/remi/Desktop",
- "last.imagePath": "C:/Users/remi/OneDrive/Documents/Cours/05-HEVS/S2fb/informatic/projet/map/assets",
+ "last.imagePath": "C:/Users/remi/OneDrive/Documents/Cours/05-HEVS/S2fb/informatic/vscode/PokeMudry/resources/map/assets",
"last.objectTypesPath": "C:/Users/remi/OneDrive/Documents/Cours/05-HEVS/S2fb/informatic/projet/map/propertytypes.json",
"last.worldFilePath": "C:/Users/remi/OneDrive/Documents/Cours/05-HEVS/S2fb/informatic/projet/map",
"lastUsedTilesetExportFilter": "Tous les Fichiers (*)",
@@ -290,23 +308,28 @@
"openFiles": [
"test_couloir.tmx",
"test.tmx",
- "desert.tmx"
+ "desert.tmx",
+ "assets/Interior_v2.tsx",
+ "assets/Dungeon_v2.tsx",
+ "assets/pokemon_v2.tsx",
+ "assets/Slates_v2.tsx",
+ "21N3.tmx"
],
"project": "Maps.tiled-project",
"property.type": "string",
"recentFiles": [
- "desert.tmx",
- "test.tmx",
"test_couloir.tmx",
- "assets/Dungeon_v2.tsx",
+ "test.tmx",
+ "desert.tmx",
"assets/Interior_v2.tsx",
+ "assets/Dungeon_v2.tsx",
"assets/pokemon_v2.tsx",
"assets/Slates_v2.tsx",
+ "21N3.tmx",
+ "assets/MegaPixelArt_v2.tsx",
"assets/TileSet_V2.tsx",
"assets/tpq_v2.tsx",
- "assets/Dungeon.tsx",
- "assets/pokemon.tsx",
- "assets/Tiny Platform Quest Tiles.tsx"
+ "assets/Interior.tsx"
],
"tileset.lastUsedFormat": "tsx",
"tileset.margin": 0,
diff --git a/resources/map/assets/Interior_v2.tsx b/resources/map/assets/Interior_v2.tsx
index 3fa48f7..4f4cebc 100644
--- a/resources/map/assets/Interior_v2.tsx
+++ b/resources/map/assets/Interior_v2.tsx
@@ -111,19 +111,19 @@
-
+
-
+
-
+
@@ -147,19 +147,19 @@
-
+
-
+
-
+
@@ -183,19 +183,19 @@
-
+
-
+
-
+
diff --git a/resources/map/assets/MegaPixelArt_v2.png b/resources/map/assets/MegaPixelArt_v2.png
new file mode 100644
index 0000000..1bb428d
Binary files /dev/null and b/resources/map/assets/MegaPixelArt_v2.png differ
diff --git a/resources/map/assets/MegaPixelArt_v2.tsx b/resources/map/assets/MegaPixelArt_v2.tsx
new file mode 100644
index 0000000..72baf9f
--- /dev/null
+++ b/resources/map/assets/MegaPixelArt_v2.tsx
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/resources/map/assets/cuteRPG.png b/resources/map/assets/cuteRPG.png
deleted file mode 100644
index 8815e0d..0000000
Binary files a/resources/map/assets/cuteRPG.png and /dev/null differ
diff --git a/resources/map/png/21.xcf b/resources/map/png/21.xcf
index c5555d6..e5a5438 100644
Binary files a/resources/map/png/21.xcf and b/resources/map/png/21.xcf differ
diff --git a/resources/map/png/21N3.PNG b/resources/map/png/21N3.PNG
index a347737..5651b38 100644
Binary files a/resources/map/png/21N3.PNG and b/resources/map/png/21N3.PNG differ
diff --git a/resources/map/texture_splitter_v2.py b/resources/map/texture_splitter_v2.py
index 837c55a..6562c46 100644
--- a/resources/map/texture_splitter_v2.py
+++ b/resources/map/texture_splitter_v2.py
@@ -9,7 +9,7 @@ W, H = 32, 32
def pilToPygame(pilImage):
return pygame.image.fromstring(
- pilImage.tobytes(), pilImage.size, pilImage.mode).convert()
+ pilImage.tobytes(), pilImage.size, pilImage.mode).convert_alpha()
def rect(p1, p2):
x = min(p1[0], p2[0])
@@ -38,7 +38,7 @@ class Rect:
color = (0,255,0)
self.hover = True
- pygame.draw.rect(w, color, [x*W-sx, y*H-sy, self.w*W, self.h*H], 1)
+ pygame.draw.rect(w, color, [x*W-sx, y*H-sy, self.w*W, self.h*H], 2)
@property
def area(self):
@@ -76,6 +76,7 @@ class Editor:
self.win = pygame.display.set_mode([self.WIDTH, self.HEIGHT], pygame.SRCALPHA)
self.over = pygame.Surface([self.WIDTH, self.HEIGHT], pygame.SRCALPHA)
self.clock = pygame.time.Clock()
+ pygame.display.set_caption(f"Texture Splitter - {self.base}{self.ext}")
self.img = pilToPygame(img)
self.a = np.array(img)
@@ -91,6 +92,7 @@ class Editor:
self.rects = []
self.sel = (False, None)
self.scroll_x, self.scroll_y = 0, 0
+ self.moving = False
def mainloop(self):
while self.running:
@@ -140,26 +142,43 @@ class Editor:
speed = self.SCROLL_SPEED if event.button == 5 else -self.SCROLL_SPEED
if pygame.key.get_pressed()[pygame.K_LSHIFT]:
self.scroll_x += speed
- self.scroll_x = min(self.a.shape[1]-self.WIDTH, self.scroll_x)
- self.scroll_x = max(0, self.scroll_x)
+
else:
self.scroll_y += speed
- self.scroll_y = min(self.a.shape[0]-self.HEIGHT, self.scroll_y)
- self.scroll_y = max(0, self.scroll_y)
+
+ self.clamp_scroll()
elif event.button == 3:
self.rects = list(filter(lambda r: not r.hover, self.rects))
+ elif event.button == 2:
+ self.moving = True
+
elif event.type == pygame.MOUSEBUTTONUP:
if event.button == 1:
if self.sel[0]:
self.rects.append(Rect(*self.sel[1], self.mx, self.my))
self.sel = (False, None)
self.organize()
+
+ elif event.button == 2:
+ self.moving = False
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_s and event.mod & pygame.KMOD_CTRL:
self.save()
+
+ elif event.type == pygame.MOUSEMOTION:
+ if self.moving:
+ self.scroll_x -= event.rel[0]
+ self.scroll_y -= event.rel[1]
+ self.clamp_scroll()
+
+ def clamp_scroll(self):
+ self.scroll_x = min(self.a.shape[1]-self.WIDTH, self.scroll_x)
+ self.scroll_x = max(0, self.scroll_x)
+ self.scroll_y = min(self.a.shape[0]-self.HEIGHT, self.scroll_y)
+ self.scroll_y = max(0, self.scroll_y)
def organize(self):
for rect in self.rects: