? Touch screen interaction (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Touch screen interaction

  • #1 ✎ 4 matthew3737 Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Day Person I like the warm sunshine and wake up early! Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself How do I make it so that I can use the touch screen and when I touch the screen in a different spots it will animate different sprites while holding the screen in that spot? Posted Edited by matthew3737
  • #2 ✎ 335 ToadIsTheBest Avatar Embargo I didn't change my avatar for 90 days Website Video Games I like to play video games! Hobbies Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength
    How do I make it so that I can use the touch screen and when I touch the screen in a different spots it will animate different sprites while holding the screen in that spot?
    please explain better also linking this thread here also this belongs in programming questions, not general
    Posted Edited by ToadIsTheBest
  • #3 ✎ 4 matthew3737 Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Day Person I like the warm sunshine and wake up early! Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    How do I make it so that I can use the touch screen and when I touch the screen in a different spots it will animate different sprites while holding the screen in that spot?
    please explain better also linking this thread here also this belongs in programming questions, not general
    what I meant is if I touch the screen in 1 spot how do I make it play a few big sprite sheet images in a a loop (like a gif) until I stop touching it there and can I make it do different ones when I touch the screen in a different spot? (Im trying to make a program basically like tomodachi life's interaction with the mii's) and i'll post in programming questions next time. im new to SBsource
    Posted Edited by matthew3737
  • #4 ✎ 335 ToadIsTheBest Avatar Embargo I didn't change my avatar for 90 days Website Video Games I like to play video games! Hobbies Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength
    How do I make it so that I can use the touch screen and when I touch the screen in a different spots it will animate different sprites while holding the screen in that spot?
    please explain better also linking this thread here also this belongs in programming questions, not general
    what I meant is if I touch the screen in 1 spot how do I make it play a few big sprite sheet images in a a loop (like a gif) until I stop touching it there and can I make it do different ones when I touch the screen in a different spot? (Im trying to make a program basically like tomodachi life's interaction with the mii's) and i'll post in programming questions next time. im new to SBsource
    Firstly, the name of SmileBASIC Source is shortened to SBS, not SBsource Secondly, follow the examples for checking where the touch is and check if the time you touch the screen is greater than 1 and use SPDEF to make big sprites.
    Posted
  • #5 ✎ 385 SwanBot Halloween 2017 Contest Runner Up I placed 2nd in the SmileBASIC Source Halloween 2017 Contest! Programming Contest Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength First Year My account is over 1 year old Website Alright, so more corrections here, IT DOES NOT MATTER WHAT YOU CALL SBS AND SBsource is just fine idk why DSM said that, as there is no *set* way to say it, simply just depends on whether you like shortening down stuff a ton or putting the effort to put a better name. Alright so for todays how to we will need 3 main things. 1: starting using the touch screen. Making it avaible for use is as simple as putting STICK OUT TT,SX,SY and just put that in the loop. 2: making a touch box. Alright so to detect touches in a certain area we use what I like to call "touch boxes". simply put they make a box in which you detect where on the touch screen it is being touched for say buttons or stuff on the touch screen. Ok the following code will make a small box and BEEP when it is touched: IF TX>50 AND TX<100 THEN IF TY>50 AND TY<100 && TT==0 THEN BEEP ENDIF ENDIF That unless It has an error will beep when touched in the area between 50 and 100 X and Y. So for a quick what was done, we simply check if the touch screen was touch in the given area which was set as 50 to 100 on both X and Y, now when making your own you have to make sure of one thing: that the for of the two numbers is always smaller then the 2nd, otherwise it wont work. What I like to do when testing is make a gbox in the same area to show where you will be detecting touches, so to do that its as simple as matching the X and Y on the box:GBOX 50,50,100,100 AND TADA! you now have a white (or whatever color its set to) box where the touches will be detected. Animation is a bit more complicated so for now I will wait for a response to see if you understand this. And lastly your nice loop which you can do your own but mine normally looks like: ACLS WHILE 1 VSYNC '(CODE HERE) WEND Posted Edited by SwanBot
  • #6 ✎ 4 matthew3737 Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Day Person I like the warm sunshine and wake up early! Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    Alright, so more corrections here, IT DOES NOT MATTER WHAT YOU CALL SBS AND SBsource is just fine idk why DSM said that, as there is no *set* way to say it, simply just depends on whether you like shortening down stuff a ton or putting the effort to put a better name. Alright so for todays how to we will need 3 main things. 1: starting using the touch screen. Making it avaible for use is as simple as putting STICK OUT TT,SX,SY and just put that in the loop. 2: making a touch box. Alright so to detect touches in a certain area we use what I like to call "touch boxes". simply put they make a box in which you detect where on the touch screen it is being touched for say buttons or stuff on the touch screen. Ok the following code will make a small box and BEEP when it is touched: IF TX>50 AND TX<100 THEN IF TY>50 AND TY<100 && TT==0 THEN BEEP ENDIF ENDIF That unless It has an error will beep when touched in the area between 50 and 100 X and Y. So for a quick what was done, we simply check if the touch screen was touch in the given area which was set as 50 to 100 on both X and Y, now when making your own you have to make sure of one thing: that the for of the two numbers is always smaller then the 2nd, otherwise it wont work. What I like to do when testing is make a gbox in the same area to show where you will be detecting touches, so to do that its as simple as matching the X and Y on the box:GBOX 50,50,100,100 AND TADA! you now have a white (or whatever color its set to) box where the touches will be detected. Animation is a bit more complicated so for now I will wait for a response to see if you understand this. And lastly your nice loop which you can do your own but mine normally looks like: ACLS WHILE 1 VSYNC '(CODE HERE) WEND
    It says "Stick" is being used wrong
    Posted
  • #7 ✎ 136 Warrior Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Drawing I like to draw! Hobbies
    Alright, so more corrections here, IT DOES NOT MATTER WHAT YOU CALL SBS AND SBsource is just fine idk why DSM said that, as there is no *set* way to say it, simply just depends on whether you like shortening down stuff a ton or putting the effort to put a better name. Alright so for todays how to we will need 3 main things. 1: starting using the touch screen. Making it avaible for use is as simple as putting STICK OUT TT,SX,SY and just put that in the loop. 2: making a touch box. Alright so to detect touches in a certain area we use what I like to call "touch boxes". simply put they make a box in which you detect where on the touch screen it is being touched for say buttons or stuff on the touch screen. Ok the following code will make a small box and BEEP when it is touched: IF TX>50 AND TX<100 THEN IF TY>50 AND TY<100 && TT==0 THEN BEEP ENDIF ENDIF That unless It has an error will beep when touched in the area between 50 and 100 X and Y. So for a quick what was done, we simply check if the touch screen was touch in the given area which was set as 50 to 100 on both X and Y, now when making your own you have to make sure of one thing: that the for of the two numbers is always smaller then the 2nd, otherwise it wont work. What I like to do when testing is make a gbox in the same area to show where you will be detecting touches, so to do that its as simple as matching the X and Y on the box:GBOX 50,50,100,100 AND TADA! you now have a white (or whatever color its set to) box where the touches will be detected. Animation is a bit more complicated so for now I will wait for a response to see if you understand this. And lastly your nice loop which you can do your own but mine normally looks like: ACLS WHILE 1 VSYNC '(CODE HERE) WEND
    It says "Stick" is being used wrong
    Replace STICK with TOUCH
    Posted
  • #8 ✎ 385 SwanBot Halloween 2017 Contest Runner Up I placed 2nd in the SmileBASIC Source Halloween 2017 Contest! Programming Contest Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength First Year My account is over 1 year old Website
    Alright, so more corrections here, IT DOES NOT MATTER WHAT YOU CALL SBS AND SBsource is just fine idk why DSM said that, as there is no *set* way to say it, simply just depends on whether you like shortening down stuff a ton or putting the effort to put a better name. Alright so for todays how to we will need 3 main things. 1: starting using the touch screen. Making it avaible for use is as simple as putting STICK OUT TT,SX,SY and just put that in the loop. 2: making a touch box. Alright so to detect touches in a certain area we use what I like to call "touch boxes". simply put they make a box in which you detect where on the touch screen it is being touched for say buttons or stuff on the touch screen. Ok the following code will make a small box and BEEP when it is touched: IF TX>50 AND TX<100 THEN IF TY>50 AND TY<100 && TT==0 THEN BEEP ENDIF ENDIF That unless It has an error will beep when touched in the area between 50 and 100 X and Y. So for a quick what was done, we simply check if the touch screen was touch in the given area which was set as 50 to 100 on both X and Y, now when making your own you have to make sure of one thing: that the for of the two numbers is always smaller then the 2nd, otherwise it wont work. What I like to do when testing is make a gbox in the same area to show where you will be detecting touches, so to do that its as simple as matching the X and Y on the box:GBOX 50,50,100,100 AND TADA! you now have a white (or whatever color its set to) box where the touches will be detected. Animation is a bit more complicated so for now I will wait for a response to see if you understand this. And lastly your nice loop which you can do your own but mine normally looks like: ACLS WHILE 1 VSYNC '(CODE HERE) WEND
    It says "Stick" is being used wrong
    Replace STICK with TOUCH
    Eyy sorry, minor mistake :| . (I'm used to helping on stick commands a lot sorry lol) But yeah TOUCH OUT.
    Posted
  • #9 ✎ 4 matthew3737 Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Day Person I like the warm sunshine and wake up early! Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    Eyy sorry, minor mistake :| . (I'm used to helping on stick commands a lot sorry lol) But yeah TOUCH OUT.
    Ok I fixed it and sorry for the very late reply
    Posted