assuming AppGameKit, using
Render() after you draw the lines in your loop should do what you need; i see no noticeable performance hit with this method.
if your order of creation (lines vs sprites) might be "mixed", meaning you might draw a line, create a sprite, draw a line, etc., then consider "drawing" to a sprite. (i'm not sure that this is necessary but expect it might be for "mixed" usage as i've described).
IE, look at
SetRenderToImage() and use that image to draw lines to. have a "back layer" sprite (with a depth > than all your normal sprites) using that renderimage. when you're done drawing lines, go back to
SetRenderToScreen().
this method
will cause a performance hit (that may be acceptable to you).
// set window properties
SetWindowTitle( "lines vs sprites" )
SetWindowSize( 1080, 720, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1080, 720 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 0, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
block = CreateSprite(0) : SetSpriteSize(block,32,32) : SetSpriteColor(block,255,0,0,255) : SetSpritePosition(block,16,16)
shapes = CreateRenderImage(1080,720,0,0)
back = CreateSprite(shapes) : SetSpriteDepth(back,10000)
toggle = 1
do
SetRenderToImage(shapes,-1)
DrawLine(0,0,64,64,255,255,255)
SetRenderToScreen()
`Render()
if GetPointerPressed() = 1
toggle = -toggle
if toggle = 1 then SetSpriteVisible(block,1) else SetSpriteVisible(block,0)
endif
Print( ScreenFPS() )
Sync()
loop
hope that helps