User Tools

Site Tools


sample_code:img_toggle_button

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
sample_code:img_toggle_button [2014/11/26 09:41]
stevegarman mention OnTouch callbacks
sample_code:img_toggle_button [2014/11/26 09:58]
stevegarman button size
Line 7: Line 7:
 The sample code passes one of each. The sample code passes one of each.
  
-In case it is not obvious, the actual toggling is done in the OnTouchUp handler.+The first image decides the size of the button. 
 + 
 +In case it is not obvious, the actual toggling is done in the OnTouchDown handler.
  
 You could move this to any of the OnTouch events but be aware that some of them (such as SetOnTouch) may fire more often than you expect. You could move this to any of the OnTouch events but be aware that some of them (such as SetOnTouch) may fire more often than you expect.
Line 43: Line 45:
 function CreateImageToggle(img1,img2){ function CreateImageToggle(img1,img2){
   // accepts images or file-paths   // accepts images or file-paths
-  //img1 represents false, img1 true(toggled)+  //img1 represents false, img2 true(toggled)
   if (typeof img1 == "string") {   if (typeof img1 == "string") {
      img1 = app.CreateImage(img1);      img1 = app.CreateImage(img1);
sample_code/img_toggle_button.txt · Last modified: 2015/01/13 17:55 (external edit)