Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Walluce

#1
Hi,

I am writing a plugin and as part  of what my plugin needs to do, I basically need to redraw everything on the screen. I am just a little stuck when it comes to walk-behinds.

Basically, my Draw() loop is something like:
Code: ags
DrawObjects()
SortCharactersByY()
DrawCharacters()

I want to also draw walk-behinds.

This does not work (players are basically always behind):
Code: ags
DrawObjects()
DrawWalkBehinds()
SortCharactersByY()
DrawCharacters()

and this means that the players are basically always in front:
Code: ags
DrawObjects()
SortCharactersByY()
DrawCharacters()
DrawWalkBehinds()

I know this is because I am not taking into account the baseline of the walk-behinds.

What I think the Engine is doing is that it's basically creating the WBs as sprites and then simply sorting the sprites (chars, objects and WBs) in order of Y, BUT there is a mode in there called "DrawOverCharSprite". I think that my plugin could do that, but I am still not 100% how that works?

Any insights would be appreciated.

SMF spam blocked by CleanTalk