Alright, well not quite what I asked... but I'm going to assume you're using AppGameKit (although the principal is similar for DBC / DBP / DGDK / AGDK)
As such you're likely using the GetImage
( ) and SaveImage
( ) Instructions.
This isn't wrong per se, but with AppGameKit you have to be careful about where
you're placing said commands.
Remember that when you Sync
( ) / Render
( ) / Swap
( ) / Update
( )., these automatically will Clear the Back Buffer (Screen) Cache in preparation for Drawing the Update Frame.
Where as calling DrawText( ) will instantly send the Text to the Back Buffer (Screen) … so it will immediately Draw To Screen., thus when you call the Synchronisation / Update Commands, it'll Re-Draw said Text to the Screen.
This means it's more than possible to accidentally only capture Text / Sprites / 2D Drawing Operations within a Screenshot, as opposed to the Final Composition Image.
As a note this is how you can manipulate 2D Images or perform CPU Screen Effects without having to use Memory Block Operations (which are a little more advanced).
In other words... create a Simple Function, that will Take a Screenshot (this will handle GetImage / SaveImage and I'd recommend Deleting Image once done, else you can easily accidentally use a lot of memory you don't mean to until the App Closes) then create a Trigger Variable.
Something like Global
bTakeScreenshot As Boolean
, that during the input update you trigger before resetting at the end of the Screenshot Function.
Then you can just call: If
TakeScreenshot( ) // Place Immediately after Sync( ) or Swap( )
You could test it via a simple If
bTakeScreenshot = -1
Although personally I'd always recommend setting up:
#Constant True -1
#Constant False 0
It achieves the same thing as leaving IF operators blank, but it just keeps things inline with C/C++ should you chose to use the "Tier2" AppGameKit, and it's a good practise to get into to use True / False.
That these haven't become Default Keywords in the past 20 Years since Dark BASIC was release still continues to baffle me.
Anyhow … that should work as you expect it to.
In fact this actually provides options., so... say you don't want Text / Lines / UI / etc. as part of the Screenshot; well you can handle the Rendering of the 2D / Sprites / Text / 3D all as Separate Layers., then simply Screenshot the Layer you want to output.
But I wouldn't recommend such until you get used to no longer using the Sync
( ) Command that just handles all of the Background Updates and Rendering for you.