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.
mkopack73 Senior Member Joined: 03/07/2020 Location: United StatesPosts: 261
Posted: 01:21am 27 Jul 2020
Copy link to clipboard
Print this post
Hey gang,
Running into a problem that has me stumped...
I'm changing how I'm loading in sprites... What I'm trying to do is the following:
In my loadsprites() I'm reading in a series of 25 PNG files using load png and putting them onto page 3. (I even do a page copy 3 to 0 so I can see that they all loaded in ok...)
later in my program when I go to spawn a new AI car, I randomly pick one of the 25 and do a sprite read for the coordinates of the one chosen. That all seem to be ok...
The next line I go to show the sprite I just read and I keep getting back
"Buffer not in use" error on the line where I do the sprite show.
Ideas??? I don't get what could be wrong. I do this in other parts of my program and it works just fine.
capsikin Guru Joined: 30/06/2020 Location: AustraliaPosts: 342
Posted: 01:43am 27 Jul 2020
Copy link to clipboard
Print this post
Maybe the code is trying to use an invalid sprite number. 0 for example. Code for picking the number, reading the sprite, and showing it?
mkopack73 Senior Member Joined: 03/07/2020 Location: United StatesPosts: 261
Posted: 01:51am 27 Jul 2020
Copy link to clipboard
Print this post
It's on my other machine... I'll have to post it tomorrow... Been banging my head on this for a good hour plus and I need to get to bed.
I just don't get how I can do a line like:
sprite read i+1, x,y,xsize,ysize,2 'this should be creating the sprite from data on screen 2 sprite show i+1, xpos,ypos,2 'show the sprite as part of layer 2
and the 2nd line fails...
Yet I do the EXACT same thing in 2 other parts of my code to load in PNGs (or draw an area) and then read that into the sprite and show it and it works fine.