? Sprite limits changed on XSCREEN 2/3 (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Sprite limits changed on XSCREEN 2/3

  • #1 ✎ 3 Super_ 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? Posted
  • #2 ✎ 108 Autz64 End of 2017 Contest Participant I participated in the SmileBASIC Source End of 2017 Contest! Programming Contest Avatar Taboo I didn't change my avatar for 180 days Website Deep Sleep Hidden Website Because you have to define the sprite limit on xscreen 2 and 3, since both uses the touchscreen. Touchscreen has 511-N sprites available. Posted
  • #3 ✎ 1536 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website 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) Posted
  • #4 ✎ 3 Super_
    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,0 However, 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.
    Posted
  • #5 ✎ 1536 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website
    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,0 However, 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-211
    Posted
  • #6 ✎ 395 random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies
    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,0 However, 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: XSCREEN 3,300,4 SPSET 0,0 DISPLAY 1 SPSET 0,0 Yes, it is confusing, but thats how it works. Try it!
    Posted
  • #7 ✎ 3 Super_ 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 0 Once again, thanks for the help. Posted
  • #8 ✎ 395 random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies
    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 0 Once again, thanks for the help.
    Your welcom! Yay! Typos are fun! I meant welcome lol.
    Posted