<｜begin▁of▁sentence｜>### Instruction:
As a game developer, you may have a particular scenario where you have to manipulate the layout of a character interactivity map within your video game. This map is represented by a graph where each node is a character and the two-dimensional position of each node in the game world is stored as a NumPy array in a dictionary. The keys of this dictionary are the identifier tags of these nodes (characters).

How could you scale all these positions in a manner that your overall game map fits within a certain range on all axes, but still keeps the aspect ratio intact? This process should adjust the layout to a specific scale, enabling smoother viewport transitions for the end gamer as they interact with different characters in various game locations.
### Response:
import numpy as np
import networkx as nx

# Suppose we have a graph with a position dictionary for each node
pos = {0: np.array([0, 0]), 1: np.array([1, 2]), 2: np.array([2, 1])}
# Convert the dictionary to just a list of positions
pos_array = np.array(list(pos.values()))

# Rescale the positions using networkx's rescale_layout
scaled_pos = nx.drawing.layout.rescale_layout(pos_array, scale=2)

print(scaled_pos)
<|EOT|>
