? How do you get the screen mode from XSCREEN? (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
💀

How do you get the screen mode from XSCREEN?

  • #1 ✎ 33 Plancake Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Reading I like to read books! Hobbies I've been trying to get the value from XSCREEN to put into a variable, but nothing seems to work. This is what I'm getting (comments are the output): XSCREEN OUT A 'Illegal function call(XSCREEN) XSCREEN 4 A = XSCREEN PRINT A '0 As you can see, the variable A should be 4, but it stays as 0 for some reason. Is there another way to get the current screen mode, or is it not possible to do this? Posted
  • #2 ✎ 905 Y_ack Head Admin It's not possible. SB is bad: https://smilebasicsource.com/forum?fpid=17138#post_17138 Posted
  • #3 ✎ 1562 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 Also, it's important to know that variables aren't related to functions with the same name. Posted
  • #4 ✎ 33 Plancake Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Reading I like to read books! Hobbies Thanks for helping out, I'm trying to make an input recorder that can be used in any game, and I just wanted to support games that use XSCREEN, but it looks like it's not possible. Posted
  • #5 ✎ 396 kenchic OSP Contest 1 Contest Participant I participated in the first SmileBASIC Source OSP Contest! Second Year My account is over 2 years old Website Good Page Hidden Achievements
    Thanks for helping out, I'm trying to make an input recorder that can be used in any game, and I just wanted to support games that use XSCREEN, but it looks like it's not possible.
    I know you're thinking it's impossible, but you could do multiple things here:
    1. Create a different version of your program for every XSCREEN mode
    2. Parse through the program first and add an XSCREEN = M after every XSCREEN assignment where M is the mode
    3. Ignore XSCREEN assignments and only support the good mode (3)
    Posted
  • #6 ✎ 1562 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 I don't think it's too much work to just require the user to insert a custom function after every XSCREEN change, especially since you're only going to use XSCREEN once anyway. XSCREEN 4 SET_XSCREEN 4 in your library: COMMON DEF SET_XSCREEN mode 'do whatever END Posted