How To Use Draw Tiles Gamemaker
Introduction
In this tutorial nosotros are going to look at the GameMaker Studio 2 Tile Set Editor. You can also watch this video on it:
The tile fix editor is where yous can take a sprite resource and convert information technology into a tile set for use within your game rooms. A tile ready is a graphical resource used to add images into your game simply without the need for using an object. They are very fast to draw and require little processing power, making them ideal for creating platforms, groundwork scenery and annihilation else that objects may non accept to straight interact with.
At present, tile sets exercise come up with some caveats. To offset with tiles are always placed on a grid. The grid does non have to be square nor does information technology have to exist a power of two - so a tile set that uses 20x45 filigree cells would exist fine - and you can only take i tile per grid cell. When placing your tiles in the Room Editor you lot can overlap tiles past placing them on different layers, but the tile set up itself is ane tile per jail cell. Y'all are besides limited when information technology comes to rotating tiles, as they can merely exist rotated 90° or mirrored along the vertical centrality or flipped along the horizontal centrality. You can also animate tiles, but at that place are sure caveats associated with that too, which we'll discuss later in this tutorial.
For at present though, this tutorial is going to explain how to create a basic tile set resource...
Creating A Tile Set
A tile set will need to accept been assigned a Sprite Resource before you lot can use it. To create a tile set the sprite will need to have each tile spaced on a grid, and the very first tile should be blank, as this is the "empty" tile that is used for deleting. Substantially a tile set layer in the room editor will always have tiles, with the tile existence used initially set as the empty tile in the tile set (note that fifty-fifty if you take a tile at the empty position, it will not exist fatigued). If you look at the wall tile gear up sprite shown below, you lot can see that the upper left position (tile index 0) is empty, for example:
One time you lot've created your tile set, you would import it into the GameMaker Studio 2 Sprite Editor and then create a new tile set by right clicking
on the Tile Set Resource and selecting Create.
This will create a new tile prepare which can then exist named and where you tin supply the sprite resource to use. Note that when creating your tile gear up, you can "pad" the tiles with empty pixels if that makes it easier for you and so set offset and separation values when you create your tile ready resources in GameMaker Studio 2, equally shown in this next image:
The option for Output Edge will exist discussed later in this tutorial, and so nosotros'll skip to the Group choice. This tin be used to assign the tileset to a specific texture group that you've divers in the Texture Group Editor. This option is useful for keeping all your level sprites and tilesets on the same texture page and fugitive unnecessary texture swaps. The final choice, Disable Source Sprite Consign volition - when checked - prevent the base sprite used for the tileset from being exported as role of the game, which avoids having the image duplicated on the texture page. In general you lot will want this checked, unless y'all are also using the sprite in your game (for instance, to draw specific tiles using draw_sprite_part()).
Once you have created your tile set, it'south ready to use in the Room Editor, where you lot can now create tile layers and draw tiles to them to blueprint your game rooms. If you are unfamiliar with the room editor, then press
to open up the manual or download the IDE Basics - Room Editor tutorial from the showtime page of GameMaker Studio 2.
Brushes
Past default when yous "paint" tiles onto a tilemap layer in the room editor, you select a single tile and paint with that. However, tile sets are nearly always designed to take sections that fit together in different means to grade whole sections. For example, an RPG tile prepare may accept landscape characteristic tiles that tin be connected to create larger or smaller features depending on the number of tiles used. At present, placing multiple features like this on a room layer would crave yous to go back and along many times to change tile, which is not good for your workflow. To resolve this, nosotros have added tile Brushes to the tile set editor, available when you click
on the Brush Builder button:
In the Brush Builder you have the original tile set on the left and a bare "sheet" on the right. You tin can now select any tile from the left and paint it on the right to create custom "brushes" which you lot can so apply in the room editor. Note that yous can click and hold the left mouse button
so drag on the tile set to select multiple tiles to pigment into the castor canvas. The following prototype shows our previously mentioned landscape features as an case of five custom brushes made from a single tile gear up:
On the right you can see five features that we've fabricated (highlighted red in the prototype). Notice how nosotros've left a gap of one tile between each feature - this is because any touching group of tiles will exist treated as a single brush in the room editor , so we leave a gap of one tile to show that each set is a singled-out brush we want to create. While creating your brushes, y'all paint with the left mouse button
and delete with the right mouse button
. You can likewise zoom the tile sheet or the castor sail using
/
and the mouse cycle
when the mouse is over one of the windows, or you lot can pan around using
+
. Note that you tin besides use the zoom tools within the editor windows to modify the zoom levels of either window.
At the tiptop right y'all can encounter the currently selected tool, and y'all can as well set the size of the brush that you want to paint with. The default size is i, which is a single tile, but if you lot set it to higher values and then y'all can paint (and erase) with a larger brush composed of the selected tile repeated, as shown in the epitome below:
The editor also has a number of other tools other than pigment
and erase
. You have the flip
, mirror
and rotate
tools which can be used to change how any tile (or selection of tiles) is drawn. Rotate will only rotate the tile 90° but combined with the mirror and flip options it permits a total rotation of the tile. These tools will flip, mirror or rotate the currently selected tile (or tiles) for painting into the brush sheet, merely if you have used the Option tool
beforehand to select a tiles from the castor canvas, they will human action on the pick instead.
For faster editing you can use the overflowing-fill tool
which volition make full whatever space surrounded by tiles, and you also have the line
and rectangle
tools, which operate past clicking
, dragging and releasing.
The final tool available to you from this editor is the Autotile
tool. We'll talk over autotiles a bit more further on in this tutorial, but suffice to say that using this will make the tiles existence drawn to the brush canvas join upward, as long every bit the autotile editor has been fix correctly.
Beneath the tools, you tin can notice two dissimilar sections for selecting any autotile or animated tiles that have been created using the current tile fix image. A single sprite that is used for a tile set can accept many, many, single jail cell images in it, and these can be combined in the Animation or Autotile editor to create custom brushes which will show up in these sections and can be used in conjunction with regular static tiles to create brushes.
Once yous take gear up up all the brushes you require, yous tin can then use them to paint tiles onto whatsoever tile layer inside the room editor.
Animations
Tiles are more often than not considered to be static cells within the game room, however with GameMaker Studio 2 it is possible to breathing them, simply equally y'all would a sprite. Why not just use sprites, yous ask? Well, sprites have a certain processing overhead due to them being associated with a bounding box and the way in which they are rendered, but tiles have a much lower processing overhead and so are faster to render. This does come at a toll withal, in that with tile set animations you are limited to creating animations that must be a power of 2 in length - ie: of 2, 4, 8, sixteen, etc... frames - and they must manifestly be created within the tile filigree, and they must all animate at the same speed (on a per-tile set basis). Notwithstanding, even with these limitations, animated tiles are a powerful feature that tin be used to add life and color to otherwise static environments and backgrounds.
To create a tile animation y'all must first have a tile prepare that has the required tiles all within the i sprite image (but not as sprite frames, so a single large sprite frame with all the animation images within it), and so in the tile set editor you click on the Tile Animation push to bring up the Blitheness Editor:
The instance image above is a single epitome with all blitheness frames contained inside it, but it should be noted that the prototype could also comprise other non-animation tiles too, since you tin can apply a unmarried massive tile set and then "cherry selection" the parts of it that you lot want to create the animation from. For case, you could accept a large landscape tile set with trees, earth and water, and inside the tile set accept multiple tiles to be animated to make the h2o ripple.
To create a tile animation you first take to add an animation to the blitheness library past clicking the Add Animation button
, which will add together an empty blitheness strip to the library and request that you select a number of frames to be used:
Yous will so exist presented with a view of each empty animation frame, with the initial frame highlighted for you:
If you then go back to the tile gear up paradigm on the left of the editor y'all can click on any tile to add it into the animation and the frame volition advance to the adjacent i. Clicking successive tiles volition make full the blitheness, which you can and then preview by clicking on the "play" button beside the frames:
Once you have done that your animation will become part of the blitheness library and when you enter the room editor you can select information technology and identify it within the room. Note that if you select whatever of the tiles from an blitheness to identify in a room, that tile will animate from the tile onwards, then you can "desynchronise" an blitheness by placing separate frames within the room and they will all animate. The only caveat to this is that the animation speed volition always exist the aforementioned, since information technology is divers for the whole tile set and not private animations within the library.
Auto Tiles
The Auto Tile feature is an incredibly powerful tool that can be used to make level building much easier, whether it is for a elevation-down or side-on view project. Essentially, you create an autotile library, and then whenever you lay down a tile from that library information technology will "connect" with those tiles that are around it to create a seamless wall or platform.
Before you outset using the autotile characteristic even so, information technology is very of import that you have ready the tile set sprite correctly and that you choose an appropriate blazon of autotile. The types available to yous are 47 tile autotiles, or sixteen tile autotiles, with (in general) sixteen tiles being used for top down (since they give nicer transitions) and 47 being used for platformer/side on views, only that is by no ways a hard and fast rule and will depend on how you desire your last projection to look.
The paradigm below shows a typical 47 tile and 16 tile tile prepare for autotiling:
Now, just looking at the images doesn't actually tell you lot how they volition fit together so we'll open up the Autotile Editor from the Tile Set Editor and add them. The Autotile Editor looks like this:
Annotation that the sprite being used has ALL the tiles we require (and tin can also have other tiles, since you tin can pick and choose which ones to be in the autotile). You can now click
on the 47 tile button in the Templates area to create a new 47 tile library entry and it will bring up the template to apply for selecting the tiles you demand:
In the template, the calorie-free grey area represents the outside border of the tile being used and the darker gray is the "fill" expanse. To add a tile into the template, just click on the first available template cell and so select the tile to add together from the left:
If yous make a mistake, simply select the autotile that you want to remove and select the "empty" tile from the tile set. Later on you accept added them all in you can check the tiles confronting the template by clicking the "Show Guide Overlay" button
at the top, and this will toggle the template overlay on the concluding autotile, as shown in the image below:
If you desire to make a sixteen tile autotile, the proceedure is exactly the aforementioned as that explained above, simply instead of using the 47 tile template you lot use the 16 tile template:
We now accept some autotiles in our autotile library taken from a tile prepare. These can now exist used in the room editor, by but creating a tile layer so selecting one of the autotiles from the library (which will select automatically the autotile castor from the top of the room editor) and painting in your room. The tiles volition at present auto-magically connect upwardly to create properly sequenced tile maps.
Summary
That concludes this overview tutorial for the tile set editor. As you can meet, while tile sets have their limitations, they are by far one of the virtually powerful features of GameMaker Studio 2, and permit you lot to have unprecedented control over just how you build your game levels and worlds. Hopefully you can now use the different tile fix editors easily, but don't forget that if you become stuck or are unsure of something, yous can always press
to open the transmission and look it up.
How To Use Draw Tiles Gamemaker,
Source: https://www.yoyogames.com/en/tutorials/tile-set-editor
Posted by: yanceythawased.blogspot.com

0 Response to "How To Use Draw Tiles Gamemaker"
Post a Comment