Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 15:22 03 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Guest Book : CMM2 - Sprite Swap Error

Author Message
shaputer
Newbie

Joined: 25/07/2020
Location: United States
Posts: 38
Posted: 07:46pm 31 Aug 2020
Copy link to clipboard 
Print this post

My program works perfectly until I put this command to swap a sprite:


SPRITE SWAP 1, 2 'CAUSES "ORIGINAL BUFFER NOT DISPLAYED" ERROR


I don't know what the error message means.  Sprite 1 is on the screen.  Just want to swap the PNG Sprite image which is identical but mirrored.

Any ideas why this is happening  ? Thanks !

I'm using firmware ver. 5.05.05
Edited 2020-09-02 00:57 by shaputer
If what you are doing is bringing out the worst in you than stop doing it.
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 01:56pm 05 Sep 2020
Copy link to clipboard 
Print this post

I only just saw this - didn't notice the guest book before.

Maybe you did SPRITE WRITE instead of SPRITE SHOW?

You'd probably get more CMM2 people see the question in the "Microcontroller and PC projects" forum.
 
shaputer
Newbie

Joined: 25/07/2020
Location: United States
Posts: 38
Posted: 02:44pm 05 Sep 2020
Copy link to clipboard 
Print this post

Ooops !   I thought I did post it in the right place.  Wish I could move this post to that area.

I figured it out.

I was not using PAGE WRITE and PAGE COPY along with the SPRITE comannds.  

Here is my solution:

CLS

 SPRITE LOADPNG 1, "CarR.png"
 SPRITE LOADPNG 2, "CarD.png"

'THE LOOP BELOW FLIPS THE SPRITE FROM ONE IMAGE TO ANOTHER USING 2 DIFFERENT SPRITES
DO
 SPRITE SHOW 1, 50, 50, 1 'SPRITE 1 ON PAGE 1

 PAUSE 200  
 
 SPRITE SWAP 1, 2
 PAGE WRITE 0
 SPRITE SHOW 2, 50, 50, 0 'SPRITE 2 ON PAGE 0
 
 PAUSE 500

 PAGE COPY 0 TO 1 'REPLACE SPRITE 1 WITH SPRITE 2
 
 PAUSE 500
 PAGE COPY 1 TO 0  'REPLACE SPRITE 2 WITH SPRITE 1
 SPRITE SWAP 2, 1
LOOP

 
Edited 2020-09-06 00:44 by shaputer
If what you are doing is bringing out the worst in you than stop doing it.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024