Switch to Book Layout1: Getting Started2: Building Logic
3: Actors
4: Scenes
5: Game Mechanics6: Advanced Topics7: Testing & Tuning8: The Last 10%M1: Mobile - IntroM2: Mobile - BasicsM3: Mobile - ServicesM4: Mobile - PublishingA: Troubleshooting
B: How-To Guides
C: ReferenceD: Resources3.0 Drafts (In Progress)
|
||
|
Level: Beginner
Tiles & TilesetsWhat are the building blocks of a scene? The scene’s terrain or “land” is typically made up of Tiles. Much like the tiles on your kitchen counter or bathroom, Tiles in a game are uniformly sized pieces of land that conform to a grid. This article will cover the basics of importing and working with tiles.
Contents
Importing a TilesetStep 1 - Create It Go to this menu item: File > Create New > Tileset
Step 2 - Name It
Step 3 - Import the Tile Sheet You'll now see this window.
1) Click "Choose Image" to pick out the tile sheet you want to import. (You can also copy it to the clipboard and paste it in.) 2) Pick out the Tile Width/Height. This will determine how your tile sheet is cut up. In most cases, this is 32x32 or 16x16. 3) The spacing and border fields are for cases where your tiles are spaced apart. This is rare.
That's it! Click Add to finish the import.
Collision ShapesNow that you've uploaded your tileset, you will want to set the collision shapes for your tiles. You can either...
Picking a shape is simple - just click on any entry within the Collision Bounds pane. This even works when multiple tiles are selected (click and drag to select multiple tiles in the left pane).
If you prefer to make a custom shape, click the + button. You'll get a choice between creating a box (rectangle) or a convex polygon.
To learn more about tile collision shapes and how to define custom shapes, we've got a full article for this:
Animated TilesSome games use Animated Tiles to bring a scene to life. Here's how you convert a plain tile to an animated one. 1) Open up a Tileset. 2) Click on the Tile you'd like to animate in the left pane.
3) You'll now see information in the right-hand pane. The bottom part of this pane should look familiar. It's the same as the one you use for managing an Actor's animations.
Working with the TilesetYou can alter a tileset's row and column count by clicking directly on the row and column headers.
Tip: You can select multiple tiles at a time by clicking and dragging. What's the use of this? You can edit multiple collision bounds at the same time, a major time saver.
Mobile Games & TilesetsIf you've worked with mobile games, you'll know by now that all graphics should be imported at 2x (twice) the resolution, in order to support Apple's Retina Display and the standard resolution display. You also know that in all other respects, you author your game at "1x" resolution. We just swap the 2x graphics in on the fly if the game is played on a Retina Device. This detail is never known to you.
What is the bottom line for tilesets?
1) Import Tilesets at 2x. 2) Specify the Tile Width, Tile Height and other parameters in 1x. For example, if your game's regular tile size is 32 x 32, you import a tile sheet where the tiles are 64 x 64, but you still say that the tile size is 32 x 32.
Troubleshooting1) If possible, keep the tile size for all tilesets and scenes the same. This will spare your headaches in the long run. 2) When defining custom polygon shapes for Tiles, you can only use convex polygons. If you need to make a concave polygon, split it into several convex polygons instead. 3) In rare situations, a scene may crash in game if the terrain is complex enough to exceed our engine's internal limit - there's no exact number, but it's on the order of hundreds, possibly thousands of sides. This happens because we combine all of the shapes into larger ones to improve performance. This can be worked around by alternating the terrain to break up the large, offending shape into 2 smaller land masses.
The Tile APIWhat if you want to change a scene's terrain at runtime? For example, you're making a game with automatically-generated dungeons. You'll need to use some code, but we've got a (Flash-only) API for this.
Summary
Last Updated: 2012-04-03 by Jon
25667 have read this article
Disclaimer: The Stencyl Team does not actively monitor comments on articles. If you're seeking help for your game,
please ask a question on the forums. Thanks!
12 Comments
ThatOneDude
How do I layer tilesets so that I can put a tile on another tile without deleting the first one? 0 5 days, 14 hours ago
caleb66744232
Is there a way to make tiles walk through-able? Would help to know how! 0 4 months, 1 week ago
jwjb
These are the steps I used for successfully importing the "Miscellaneous Landscapes" Tileset from StencylForge to my Dashboard > Resources > Tilesets so they could be used within my scenes using the Scene Designer. First, Import "Miscellaneous Landscapes" Tileset from StencylForge to my Dashboard tab Resources > Tilesets folder: Go to "StencylForge" -> Within StencylForge tab navigate to folders -> Media > Tilesets -> Type "Miscellaneous Landscapes" in Search Bar -> Select "Miscellaneous Landscapes" -> Click on "Download" to download Tileset -> Select First Tile in position "A1" in the Tileset -> Set Collision Bounds to "Square" -> "Save Game" -> Go to Dashboard tab and navigate to folders -> Resources > Tilesets to see "Miscellaneous Landscapes" Tileset. Second, Using "Miscellaneous Landscapes" Tileset in my Dashboard tab Resources > Scenes folder: Navigate to Dashboard tab -> Resources > Scenes folder -> Click on "Edit" to edit selected Scene -> Select "Pencil" mode within Scene Designer -> Click on Palette > Tiles select and drag into the scene any of the 160 tiles within the "Miscellaneous Landscapes" Tileset to use in your scene. 0 10 months, 2 weeks ago
g1i1ch
When I load a tileset it ends up shrinking it after selecting the image. It looks fine after it displays the image I loaded and then when it goes to the tileset editor, after loading, it's offset and shrunk! It even does it with the standard tileset image in the crash course kit. 0 1 year, 2 weeks ago
DrunkenOrc
Can tiles with no hitboxes cause the framerate to drop? For instance, if I were to use them to make a chain-link fence or a shadow in front of a section of a scene? 0 1 year, 1 month ago
marcwilhelm
This needs to be updated with information on retina display and tilesets. 0 1 year, 3 months ago |


















