#draw or rendering outside of visible area

1 messages · Page 1 of 1 (latest)

cold solar
#

Just a short question, about deactivation of objects.
I know, when I deactivate an object, it gets no step, no draw events and it's held in a "deactivation" list internally.
Activation/Deactivation just moves the objects between two lists.

What I do not know is, what about "draw"ing in the non-visible area of the room?
I mean, is GameMaker smart enough (or should it even be?) to not draw sprites/objects if no pixel of it can become visible, as no camera sees it?

Asked with other words: if my room is 6k x 6k in dimension and it contains like 1500 little objects, that do nothing in step, but are visible, will gamemaker draw all 1500, even if they are outside of any visible area? So, I should deactivate them?

I ask this because i am curious in such a big room, how the application surface is built. GMS will not make a 6k² surface, right? the surface is the window/browser canvas whatever. So what happens with those objects outside visible areas?

dapper current
#

easy to check by adding a draw event and just calling draw_self and see how many get called per frame

#

do your no-step objects need to be objects or could they be sprites in the asset layer?

cold solar
#

well, with some manual coding effort, in theory i could make them sprite-ish. they contain simple state machines (as complex as "light on/light off" but when clicked by the player, they do something.
i could in theory render them centralized in a controller object and catch the clicks globally, but that would not make the code more maintainable.

why did you ask for sprites? Will gamemaker skip drawing if they are sprites?