プレイ日記
SomeThing… DJZouk2017
How do I detect when the player touches a sprite on the touch screen? Help will be appreciated.
2そうだね
プレイ済み
返信[1]
親投稿
*J.P.*[P]£ aj2003aj
its the same as normal collision, but i think you put spcol in like DISPLAY 1 SPCOL () DISPLAY 0 but theres honestly nothing different than normal ones. touch screen buttons are different though
0そうだね
プレイ済み
返信[2]
親投稿
raimondz raimondzz
There are two ways: 1. Make a sprite that follow the touch event(TOUCH out TT,TX,TY) and has the propertie to collide with other sprites. 2. Get the properties of the sprite with "spchr out x,y,w,h,a" and check if the touch event is inside the rectangle formed with x,y,w and h
0そうだね
プレイ済み
返信[3]
親投稿
SomeThing… DJZouk2017
No, I meant when the player touches a sprite physically with their stylus.
0そうだね
プレイ済み
返信[4]
親投稿
*J.P.*[P]£ aj2003aj
um... you just make a box on the touch screen using four if statements, im guessing you dont know how to so, start with putting TOUCH OUT TT,TX,TY 'sets up touchscreen' then a box like: IF TX>10 AND TX<50 AND IF TY>10 AND TX<50 THEN (stuff) (for testing i would use a beep to tell if you are touching it as it makes noise) that hopefully makes sense to you, if not tell me and ill help you again.
1そうだね
プレイ済み
返信[5]
親投稿
SomeThing… DJZouk2017
Yes, that makes more sense now.
1そうだね
プレイ済み
返信[6]
親投稿
*J.P.*[P]£ aj2003aj
CCDX is awesome! (the japan cube creator, which is MUCH BETTER!) check out the community
0そうだね
プレイ済み
返信[7]
親投稿
raimondz raimondzz
By the way, use the parameters of the sprites instead of hard coding the box parameters on the "if" posted by @*J.P.*[P]£. (USE SPCHR to get those parameters) If your sprite won't be on the middle of the screen(or if the image will change) then you must obtain the parameters and compare them with the coordinates of TOUCH.
1そうだね
プレイ済み