Skip to content

Foreground Elements #63

Answered by TrianglyRU
Otukuoi asked this question in Q&A
Jan 18, 2025 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

You mean those pillars that scroll past the foreground? Technically background functions would work, but the framework draws the background elements at maximum depth (ENGINE_RENDERER_DRAW_PRIORITY, which is 16000)

You could try to change the depth mid-draw and then revert it back to the initial value, but I never really tried it so can't say for sure. It is better to make them from scratch, I guess I can even share the code from my S1R project:

var Offset = 112 + (global.Width - 320) / 2;
	
var PosX = Camera.ViewX - (Camera.ViewX * 2 + Offset) mod 512 + 512;
var PosY = Camera.ViewY -  Camera.ViewY * 2 mod 64;

for (var i = global.Width div 480; i > -1; i--)
{
      draw_sprite(sprite_inde…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Otukuoi
Comment options

@TrianglyRU
Comment options

Answer selected by Otukuoi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants