I took my simple Demo Sprite application for Lazarus that I shared on GitHub and modified it by loading the background as x3dv (as in Dragon_spine) instead of TGLImage (so that it resizes with the window).
Then I loaded in the same way a sprite cut from the background that has the same size as the background but is transparent in all the rest and placing it in the position x = 0 and y = 0 the sprite overlaps precisely on the background image.
In this way in the Dragon_spine demo changing the Z axis of the sprite (x3dv) it stays in front of the dragon.
But now I have a sprite instead of the dragon and I don’t have the Z axis to place this player between the background image and the image that contains the sprite cut from the background (both x3dv).
It is also not possible to add the player to the Viewport as an item.
Maybe the two approaches cannot be mixed?
What could be an alternative solution?