• 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 - IDE What's the point of layers?

There's new commands that allow stuff like, list all instances on a layer... etc. Layers are the way most map editors do things as well. Either will work, its just an optional way of handling things.
 
  • Like
Reactions: Roa

hdarren

Member
Why couldn't they add that implementation to the depth system instead of having two separate competing systems. Seems confusing.
 

FiveSprites

Member
The new layer system is so much better than trying to manage depths. It's more akin to how layers work in photoshop - creating as many as you like and shifting the ordering around as you please. Having control of them through GML is a major plus and I can imagine that some of the future features will really push the functionality of these - like applying shaders to the layer for example.

Layers are also really powerful when you're dealing with the new tile system - the possibilities here are limitless.

Once you've started using them (and most of GMS2 in general to be honest) you'll find it hard to go back!
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
The layer system is more efficient to use as it's a more batched rendering format and in general you don't need more than a few layers... obviously for side on view games where you would do depth=-y this is not optimal, but that's why depth is still in there and you have the option. But layers will be MUCH faster to render and permit a few other functions and optimisations too.
 
R

RealityShifter

Guest
Layers are crazy useful especially for larger projects. It allows you categorize your resources and manipulate them in the editor and using code much more easily.
 
S

StarJackal

Guest
I noticed there are layer functions listed that aren't in the manual but are in the program (tile_x, tile_y, tile_hspeed, and tile_vspeed, for example) but don't work yet it seems.
Which probably means its planned to have the ability to shift a whole layer of objects only moving objects in the chosen layer.
First use that comes to mind for that is maybe an endless runner. Just create an instance on a specific layer that already has an (h/v)speed and it'll move at that speed along with everything else on that layer.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Sorry to be the bearer of bad news, but those functions are not in the manual because they are actually only there to support 1.4 legacy tiles... they aren't designed to be used outside of compatibility scripts and you should just be using the documented tile functions...
 
Top