Jump to content

Photo

[2.55] Support for drawing to Sprite layers via script.


  • Please log in to reply
2 replies to this topic

#1 Orithan

Orithan

    Studying Scientist - Commission from Silvixen

  • Members
  • Location:Australia

Posted 19 May 2021 - 08:51 AM

As of present; there are two layers at which sprites are drawn that cannot be drawn to via script. These are between Layers 2 and 3, where most sprites are drawn, and Layers 4 and 5, where overhead sprites are drawn.

 

It would be greatly appreciated if these layers can be drawn to for various reasons. The most important being draws to sprites that don't involve tangling with Layers 2 or 3, both of which can be affected by negative layer draws. Its also helpful for when dealing with push blocks - Draws to Layer 2 draw underneath push blocks whereas draws to Layer 3 are drawn over everything else on Layer 3. I'm also asking for the ability to draw between Layers 4 and 5 for consistency reasons as well as drawing over overhead sprites as well.


  • Mitchfork, Mani Kanina and Russ like this

#2 Mitchfork

Mitchfork

    no fun. not ever.

  • Members
  • Real Name:Mitch
  • Location:Alabama

Posted 20 May 2021 - 12:07 PM

This may be a bit harder of an ask but - if this is implemented - control over whether the "Layer 2.5" draws appear under or below the player would be really helpful.



#3 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 22 May 2021 - 12:47 AM

Something to think about here, is that there is no true 'sprite layer' in this engine. Sprite graphics are enqueued draws just like all other draws, and sprites are drawn in order by their ID, based on their type. This, each sprite type has its own draw order, and the sprites of each type are not simultaneously drawn every frame as in a true sprite layer

 

Thus, it is hard to conclude at what point you want to draw, and it would never be possible to guarantee positioning both over or under any given sprite. The primary sprite types are:
 

  • Guy/Enemy
  • Weapon
  • Link
  • Item
  • MovingBlock
  • Decorations

 

Each of these would need its own virtual layer, and again, sprites will draw over one another in any case, unless everything is perfectly timed. 




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users