Sprite limits changed on XSCREEN 2/3
Root / Programming Questions / [.]
Super_Created:
Usually the SPRITE management number limit is 0-511, but when XSCREEN is set to 2 or 3, the limit changes from 511 to 255.
If you were to do this:
XSCREEN 0 SPSET 511,0.. it works just fine. But if XSCREEN was changed to 2 or 3, then any management number set above 255 gives an Out of range (SPSET:1) error. Is there a way to prevent this, or is this just unavoidable? Also, why does it happen?
By default, when you use XSCREEN 2 or 3 (both screens), each screen gets 256 sprites and 2 BG layers.
If you want to change this, you can choose how many sprites/bg layers the top screen gets by using: XSCREEN mode,sprites,bg_layers (The lower screen gets all the remaining sprites/bg layers)
By default, when you use XSCREEN 2 or 3 (both screens), each screen gets 256 sprites and 2 BG layers. If you want to change this, you can choose how many sprites/bg layers the top screen gets by using: XSCREEN mode,sprites,bg_layers (The lower screen gets all the remaining sprites/bg layers)I took your advice and did this.
XSCREEN 3,300,4 DISPLAY 1 SPSET 301,0However, when I run it, it still gives an Out of Range (SPSET:1) error. The number that sets the maximum amount of sprites for the upper screen cannot be exceeded, even if I use DISPLAY 1 beforewards.
The sprite id's on the lower screen start at 0 too So with XSCREEN 3,300,4, the upper screen gets 0-299 and the lower screen gets 0-211By default, when you use XSCREEN 2 or 3 (both screens), each screen gets 256 sprites and 2 BG layers. If you want to change this, you can choose how many sprites/bg layers the top screen gets by using: XSCREEN mode,sprites,bg_layers (The lower screen gets all the remaining sprites/bg layers)I took your advice and did this.XSCREEN 3,300,4 DISPLAY 1 SPSET 301,0However, when I run it, it still gives an Out of Range (SPSET:1) error. The number that sets the maximum amount of sprites for the upper screen cannot be exceeded, even if I use DISPLAY 1 beforewards.
It is kinda confusing, but you do spset 0,number and just count up to how many you have on the bottom. For example:By default, when you use XSCREEN 2 or 3 (both screens), each screen gets 256 sprites and 2 BG layers. If you want to change this, you can choose how many sprites/bg layers the top screen gets by using: XSCREEN mode,sprites,bg_layers (The lower screen gets all the remaining sprites/bg layers)I took your advice and did this.XSCREEN 3,300,4 DISPLAY 1 SPSET 301,0However, when I run it, it still gives an Out of Range (SPSET:1) error. The number that sets the maximum amount of sprites for the upper screen cannot be exceeded, even if I use DISPLAY 1 beforewards.
XSCREEN 3,300,4 SPSET 0,0 DISPLAY 1 SPSET 0,0Yes, it is confusing, but thats how it works. Try it!
Thanks guys! I misunderstood how this worked.
My problem was I didn't know that XSCREEN didn't work the way I thought it did.
So basically what I needed to know was: When you use XSCREEN 2/3, and a set of sprites are assigned to the lower screen, the sprite management numbers for the bottom screen do NOT continue from the max amount of sprites on the top screen; they start from 0, as a new set of sprites.
Instead of doing this:
XSCREEN 3,300,4 DISPLAY 1 spset 301,0 '*pay attention to this one DISPLAY 0...you do this
XSCREEN 3,300,4 DISPLAY 1 spset 0,0 '*problem solves DISPLAY 0Once again, thanks for the help.
Thanks guys! I misunderstood how this worked. My problem was I didn't know that XSCREEN didn't work the way I thought it did. So basically what I needed to know was: When you use XSCREEN 2/3, and a set of sprites are assigned to the lower screen, the sprite management numbers for the bottom screen do NOT continue from the max amount of sprites on the top screen; they start from 0, as a new set of sprites. Instead of doing this:Your welcom! Yay! Typos are fun! I meant welcome lol.XSCREEN 3,300,4 DISPLAY 1 spset 301,0 '*pay attention to this one DISPLAY 0...you do thisXSCREEN 3,300,4 DISPLAY 1 spset 0,0 '*problem solves DISPLAY 0Once again, thanks for the help.