04-23-2024, 03:40 AM
(This post was last modified: 04-23-2024, 03:41 AM by TerryRitchie.)
(04-23-2024, 12:32 AM)PhilOfPerth Wrote: PCOPY is something I haven't played with yet, so I'll be interested to see what you come up with. Sounds interesting!It's a really handy and overlooked statement. QB64 allows you to have multiple pages of the screen, as many as memory in your system will allow! (QuickBasic only offered up to 8 pages in some screen modes)
You can create or load an image to the screen and then copy it to another screen page:
PCOPY 0, 1 ' copy current screen to screen page 1
Load or create another one and then:
PCOPY 0, 2 ' copy current screen to page 2
etc..
Now, when you need to display those images simply copy them back:
PCOPY 1, 0 ' copy screen page 1 to current screen
SLEEP
PCOPY 2, 0 ' copy screen page 2 to current screen
In theory you could load thousands of frames of animation in screen pages and then flip through them like a flip book.
The PCOPY statement really shines when paired with the SCREEN statement and its use of active and visual screen pages which is also now covered in lesson 5.