• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code getting and playing tileset animation

S

Shadowblitz16

Guest
can someone explain how to get and play a tileset animation in a object?

I want to play use tiles to replace sprites in my game
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Do the tutorial on tilesets that comes with GameMaker Studio 2. Just go to the tutorials tab on the start page and download IDE Basics: Tilesets. It explains how the tileset animation system works.

Oh, and you don't play a tileset animation from an object. You create the animation as part of the tileset and then place a tile from it into the room (this could be done from code, but it won't be linked to any instance, just a layer).
 
S

Shadowblitz16

Guest
oh so you can't stop at start tile animations?

Edit:
is it possible to get tile layers by index and not name?

Edit2:
@Nocturne
wait I just reread you post
are you saying I can't make an object draw a tile from a tileset at its location?
isn't that limiting gms2 a bit much?
 
Last edited by a moderator:

Mike

nobody important
GMC Elder
Just get the tielmap by name and remember the ID it returns.

Yes you can draw tiles

and you could always just change the tile itself if you needed to. Its a one liner to set tiles

All these are in the manual. search for "tilemap"
 
S

Shadowblitz16

Guest
@Mike
it seems that you guys are intermingling the tileset and tilemap functions and I complain a little here

I think tilesets and tilemaps could still be optimized without making the three resources intermingled them with each other
 

Mike

nobody important
GMC Elder
We really aren't a Tileset is the graphics, and can be used on many tilemaps.. The tilemap is the "grid" of tiledata (which tile to draw). Tilesets (like a grass/ground/path graphic set) will be used over and over again in different levels etc. just like a sprite, it's reused a lot.

Tilemaps as I said are is the grid of tile data. If you have a 32x64 tilemap then this is basically a "grid" of INT values. Each INT has a few bits for flags, and some of the bits for the TILE index itself. But its just an int.

So.... Tilemaps are full of tile data, and Tilemaps will use a Tileset to render with - just like a sprite.
 
S

Shadowblitz16

Guest
@Mike Nocturne helped me out with drawing the tile from the tileset
I didn't know that you can input a interger as the tile index instead of using a tilemap and to retrieve the tiledata

later I need to edit my suggestion
 
Top