Question regarding texture layers/priority

Greetings,

I was wondering if anybody could explain to me how the code knows to place the foreground in front of the background. Does it follow the order which the texture was drawn in the code?

Hi GenkiB,

That is 100% correct. Textures are drawn in the order that the DrawTexture function is called in our code. So, for example, if we tried to draw Scarfy before the background in our code then Scarfy will disappear because the background was drawn on top of him! It is quite literally a top-down priority, just like how our code is read and executed (loops and if statements not-withstanding)

2 Likes

Makes sense, thanks for clearing that up. I am new to coding so forgive my lack of basics, however this course taught me a lot, i am just trying to improve my knowledge of programming fundamentals and Cpp in particular.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms