HayManMarc
Member
Hello programmers,
I'm wanting to make my room layers easier for me to see and write (in my code) so I was going to use #macro's for this. But I'm not sure which way would be better. Do you?
At first, I was going to do it like this, in the Create event of a control object (where I do all my game init stuff):
If I did that, would it be running that function every time PERSON_LAYER is called? If so, maybe I should do it like this?
...so that I only run the layer_get_id function once? (unless I'm wrong about how macros work?)
(EDIT: I guess I wouldn't need to use a global variable here. Var would be sufficient.)
I'm wanting to make my room layers easier for me to see and write (in my code) so I was going to use #macro's for this. But I'm not sure which way would be better. Do you?
At first, I was going to do it like this, in the Create event of a control object (where I do all my game init stuff):
Code:
#macro PERSON_LAYER layer_get_id("person_layer")
Code:
global.person_layer = layer_get_id("person_layer");
#macro PERSON_LAYER global.person_layer
(EDIT: I guess I wouldn't need to use a global variable here. Var would be sufficient.)
Last edited: