Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:41 28 Nov 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 : Microcontroller and PC projects : PicoMiteVGA: SPRITE Write vs SPRITE Show

Author Message
Hawk

Senior Member

Joined: 15/07/2021
Location: Australia
Posts: 141
Posted: 12:25pm 10 May 2023
Copy link to clipboard 
Print this post

Could someome please explain the practical difference between using SPRITE Write verse using SPRITE Show?

This time I have RTFM first but am still not clear when I would use one or another.

For my playing card program, I am considering creating sprites on the fly, only when I need to move a card on the screen from one location to another.  The issue is how to maintain what is under the sprite as it moves. (and to eliminate the tearing...but I thinking that GetScanLine might be able to help me there.

Hawk
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9130
Posted: 12:41pm 10 May 2023
Copy link to clipboard 
Print this post

sprite write just copies the sprite to the output replacing anything that was there before.
sprite show restores to previous background (if not the first show), saves the new background and then writes the sprite.

In other words write is one way, show allows the sprite to be moved without impacting the background
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3196
Posted: 12:57pm 10 May 2023
Copy link to clipboard 
Print this post

Thanks for the manual suggestions.  I will have to think about this one.  

The intention with the manual was to spell out in detail the typical things that new users would want to do and, for the more specialised functions, to just provide a high level summary (although this was not perfectly followed).  Otherwise the manual would have become way too big.

As I said, it will require some thought,
Geoff
Geoff Graham - http://geoffg.net
 
Hawk

Senior Member

Joined: 15/07/2021
Location: Australia
Posts: 141
Posted: 01:18pm 10 May 2023
Copy link to clipboard 
Print this post

  matherp said  sprite write just copies the sprite to the output replacing anything that was there before.
sprite show restores to previous background (if not the first show), saves the new background and then writes the sprite.

In other words write is one way, show allows the sprite to be moved without impacting the background


Thanks for the explanation, that helps a lot.

I used:
 DO WHILE GetScanLine < 479: LOOP
 SPRITE Show card, x, y, 0

To eliminate the tearing.  The only problem now is to spped it up.  That will probably involve larger step increments.  It won't be as smooth, but hopefully if it is fast enough that it won't be noticed so much.

I need to get my audio circuit built so that I work on playing the movement with playing WAV files.  I hope that they load fast enough.

Regarding the manual, I'm a new user, so it's that first place I go looking for answers.  Sometimes I then search through old forum threads, but they are not always relevent to the PicoMiteVGA that I am using.

If you are sick of manual suggestions, just say.  I'll try to limit it to inconsistencies that have been introduced as MMBASIC has evolved for the specific PicoMite that I'm using.

Hawk
 
Print this page


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

© JAQ Software 2024