Create a Tile Map Node

In the Project Navigator, select the GameScene.sks file. (You may want to zoom out so that you can see the entire scene in the Scene Editor.)

Open the Object Library (L) and drag a new Tile Map Node into the Scene Graph View, as shown in the image.

images/ExtendingYourGameWorldWithTileMaps/scene-editor-add-tile-map-node.png

Select the Tile Map Node in the Scene Graph View and look at the Attributes Inspector. Set the tile map node’s Name to Grass Tile Map and its Position to (x: 0, y: 0).

You’ll see some other familiar settings like the Anchor Point and Scale, which you won’t need to change, but just below those settings you’ll see some new options:

images/ExtendingYourGameWorldWithTileMaps/scene-editor-tile-map-node-attributes.png

The Tile Sets drop-down list is where you select the tile set this map node will use. A tile map node can only pull tiles from a single tile set. In this case, you only created one tile set, Grass Tile Set, so select that one from the drop-down list if it’s not already selected.

Before you start adding tiles to your new tile map node, hide the current “grass” background by hovering the mouse pointer over the background node in the Scene Graph View and clicking the small eye icon that appears to the right of the lock icon.

Perfect, you’re ready to edit the map node using the Tile Map Editor.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset