Im creating a form with 5 buttons, 3 of them work perfectly when touching them while the other two are not, one doesnt even change state while the other works half of the button. Is there a way to change the mapping size manually?
img_ClearAttributes(hndl, iUserbutton1, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
img_Show(hndl, iUserbutton1); // show button, only do this once
img_SetWord(hndl, iUserbutton1, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
img_ClearAttributes(hndl, iUserbutton2, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
img_Show(hndl, iUserbutton2); // show button, only do this once
img_SetWord(hndl, iUserbutton2, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
img_ClearAttributes(hndl, iUserbutton3, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
img_Show(hndl, iUserbutton3); // show button, only do this once
img_SetWord(hndl, iUserbutton3, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
img_ClearAttributes(hndl, iUserbutton4, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
img_Show(hndl, iUserbutton4); // show button, only do this once
img_SetWord(hndl, iUserbutton4, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
img_ClearAttributes(hndl, iUserbutton5, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
img_Show(hndl, iUserbutton5); // show button, only do this once
img_SetWord(hndl, iUserbutton5, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
var n,frame,read;
read:=0;
repeat
state := touch_Get(TOUCH_STATUS); // get touchscreen status
n := img_Touched(hndl,-1) ;
if(state == TOUCH_PRESSED) // if there's a press
print(n);
frame:=1;
read:=1;
endif
if(state == TOUCH_RELEASED) // if there's a released
frame:=0;
read:=1;
endif
if(read==1)
if (n == iUserbutton1)
img_SetWord(hndl, iUserbutton1, IMAGE_INDEX, frame); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down, or 5 total states
img_Show(hndl,iUserbutton1) ;
endif
if (n == iUserbutton2)
img_SetWord(hndl, iUserbutton2, IMAGE_INDEX, frame); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down, or 5 total states
img_Show(hndl,iUserbutton2) ;
endif
if (n == iUserbutton3)
img_SetWord(hndl, iUserbutton3, IMAGE_INDEX, frame); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down, or 5 total states
img_Show(hndl,iUserbutton3) ;
endif
if (n == iUserbutton4)
img_SetWord(hndl, iUserbutton4, IMAGE_INDEX, frame); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down, or 5 total states
img_Show(hndl,iUserbutton4) ;
endif
if (n == iUserbutton5)
img_SetWord(hndl, iUserbutton5, IMAGE_INDEX, frame); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down, or 5 total states
img_Show(hndl,iUserbutton5) ;
endif
read:=0;
endif
forever
img_ClearAttributes(hndl, iUserbutton1, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
img_Show(hndl, iUserbutton1); // show button, only do this once
img_SetWord(hndl, iUserbutton1, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
img_ClearAttributes(hndl, iUserbutton2, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
img_Show(hndl, iUserbutton2); // show button, only do this once
img_SetWord(hndl, iUserbutton2, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
img_ClearAttributes(hndl, iUserbutton3, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
img_Show(hndl, iUserbutton3); // show button, only do this once
img_SetWord(hndl, iUserbutton3, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
img_ClearAttributes(hndl, iUserbutton4, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
img_Show(hndl, iUserbutton4); // show button, only do this once
img_SetWord(hndl, iUserbutton4, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
img_ClearAttributes(hndl, iUserbutton5, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
img_Show(hndl, iUserbutton5); // show button, only do this once
img_SetWord(hndl, iUserbutton5, IMAGE_INDEX, state); // where state is 0 for up and 1 for down, or 2 total states
var n,frame,read;
read:=0;
repeat
state := touch_Get(TOUCH_STATUS); // get touchscreen status
n := img_Touched(hndl,-1) ;
if(state == TOUCH_PRESSED) // if there's a press
print(n);
frame:=1;
read:=1;
endif
if(state == TOUCH_RELEASED) // if there's a released
frame:=0;
read:=1;
endif
if(read==1)
if (n == iUserbutton1)
img_SetWord(hndl, iUserbutton1, IMAGE_INDEX, frame); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down, or 5 total states
img_Show(hndl,iUserbutton1) ;
endif
if (n == iUserbutton2)
img_SetWord(hndl, iUserbutton2, IMAGE_INDEX, frame); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down, or 5 total states
img_Show(hndl,iUserbutton2) ;
endif
if (n == iUserbutton3)
img_SetWord(hndl, iUserbutton3, IMAGE_INDEX, frame); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down, or 5 total states
img_Show(hndl,iUserbutton3) ;
endif
if (n == iUserbutton4)
img_SetWord(hndl, iUserbutton4, IMAGE_INDEX, frame); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down, or 5 total states
img_Show(hndl,iUserbutton4) ;
endif
if (n == iUserbutton5)
img_SetWord(hndl, iUserbutton5, IMAGE_INDEX, frame); // where state is 0 for up, 1 for down, 2 for 'on' up and 3 for 'on' down, or 5 total states
img_Show(hndl,iUserbutton5) ;
endif
read:=0;
endif
forever
Comment