Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Language improvement section
#9
(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.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
A Language improvement section - by PhilOfPerth - 04-22-2024, 02:25 AM
RE: A Language improvement section - by SMcNeill - 04-22-2024, 06:23 AM
RE: A Language improvement section - by SMcNeill - 04-22-2024, 04:46 PM
RE: A Language improvement section - by TerryRitchie - 04-23-2024, 03:40 AM
RE: A Language improvement section - by bplus - 04-22-2024, 12:59 PM
RE: A Language improvement section - by Pete - 04-23-2024, 03:47 AM



Users browsing this thread: 2 Guest(s)