Swiping between cards - metaphor end-of-the-road?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Swiping between cards - metaphor end-of-the-road?

Sannyasin Brahmanathaswami via use-livecode
Hi All,

Check this script. This code would be a starting point for a script that
implement this swiping card feature. Maybe I will try to code it myself
when my headache ends.

After we have 3 images (from previous, current and next card,) the script
of top image (image of current card) just have to change the layer of
previous and next card images, depending of movement direction:

a) moving the image to left or down or diagonally to the left
will show the image of next card

b) moving the image to right or up or diagonally to the right
will show the image of next card

In countries that reads from right to left, like Japan,
these movements would be reversed.

on mouseup
   lock screen

   put the rect of this cd into q
   export snapshot from rect q of this cd to myVar as PNG
   create img
   set the text of it to myVar

   go prev -- previous card
    put the rect of this cd into q
    export snapshot from rect q of this cd to myVar as PNG
    go back -- we return to the card where we started
   create img
   set the text of it to myVar


   go next
   put the rect of this cd into q
   export snapshot from rect q of this cd to myVar as PNG
   go back
   create img
   set the text of it to myVar

   put the number of images of this card into w
   put the number of controls of this card into r

   set the layer of img (w-2) of this card to r
   -- image of current card is moved to top layer

   unlock screen
end mouseup

Al
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Swiping between cards - metaphor end-of-the-road?

Sannyasin Brahmanathaswami via use-livecode
Alejandro Tejada wrote:

 > Check this script. This code would be a starting point for a script
 > that implement this swiping card feature. Maybe I will try to code it
 > myself when my headache ends.

Your headache won't end until your RAM chips arrive. :)\


 > After we have 3 images (from previous, current and next card,) the
 > script of top image (image of current card) just have to change
 > the layer of previous and next card images, depending of movement
 > direction:
 >
 > a) moving the image to left or down or diagonally to the left
 > will show the image of next card
 >
 > b) moving the image to right or up or diagonally to the right
 > will show the image of next card
 >
 > In countries that reads from right to left, like Japan,
 > these movements would be reversed.
 >
 > on mouseup
 >    lock screen
 >
 >    put the rect of this cd into q
 >    export snapshot from rect q of this cd to myVar as PNG
 >    create img
 >    set the text of it to myVar
 >
 >    go prev -- previous card
 >     put the rect of this cd into q
 >     export snapshot from rect q of this cd to myVar as PNG
 >     go back -- we return to the card where we started
 >    create img
 >    set the text of it to myVar
 >
 >
 >    go next
 >    put the rect of this cd into q
 >    export snapshot from rect q of this cd to myVar as PNG
 >    go back
 >    create img
 >    set the text of it to myVar
 >
 >    put the number of images of this card into w
 >    put the number of controls of this card into r
 >
 >    set the layer of img (w-2) of this card to r
 >    -- image of current card is moved to top layer
 >
 >    unlock screen
 > end mouseup

I like DIY solutions that don't require waiting for the engine team, but
I wonder how smoothly performant this would feel in actual use?

On modern high-end phones those bitmaps will be pretty big.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode