Announcement

Collapse
No announcement yet.

Object coordinates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16


    Ahhh, now the light comes on Sorry.

    Buttons are in effect videos, and videos, by default have touch disabled, so you need to enable touch for them them, with

    img_ClearAttributes(hndl, iWinbutton1, I_TOUCH_DISABLE); // ensure touch is enabled

    Similarly the static text will have touch enabled (being an image), so you probably want to disable it

    img_SetAttributes(hndl, iStatictest1, I_TOUCH_DISABLE); // ensure touch is disabled

    Also, you could do the show in one hit (if you want everything shown), eg

    img_Show(hndl, ALL) ;
    Mark

    Comment


    • #17


      ESPsupport wrote:
      img_ClearAttributes(hndl, iWinbutton1, I_TOUCH_DISABLE); // ensure touch is enabled
      Should this be:

      img_ClearAttributes(hndl, iWinbutton1, I_TOUCH_ENABLE); // ensure touch is enabled

      ?

      Comment


      • #18


        No, as confusing as it seems, the bit is set to disable touch, so you clear it to enable touch

        img_ClearAttributes(hndl, iWinbutton1, I_TOUCH_DISABLE); // ensure touch is enabled

        is correct
        Mark

        Comment


        • #19


          Ok so I added this to the routine:

          repeat idx from 1 to 5
          Img_ClearAttributes(hndl, idx, $8000)

          to enable just the 5 buttons. I get a 0x060001 response to each of the index loops indicating success.

          but alas I still get a 0x06FFFF response when I touch any one of the 5 buttons.

          So here is my logic:



          1. Mount the sd card.
          2. Load Image control using the dat and gci files from sd card. The value returned from this command will be the "handle".
          3. Show all the objects on the display using the "handle" from step 2 and indexing from 0 to 5 from dat list above in show_image.
          4. Clear the attributes of the 5 buttons to enable touch using method above.
          5. Enable touch controller using touch_set(0x0000)
          6. Now do a repeat loop waiting for any touch using touch_get(0x0000)
          7. If step 5 above = 0x01 then get the image index by using img_touched(handle, -1). Note: I use -1 as indicated in manual to enable all objects in image
          8. If the display was touched AND if it was an object (image) that was touched then I should get the image index number correct?





          Loading...

          Comment


          • #20


            I_TOUCH_DISABLE 0x0020 // bit 5, set to disable touch for this image, default=1 for movie, 0 for image

            Um, where did you get the 0x8000 from?
            Mark

            Comment


            • #21


              Look at page 151 of Picaso Serial Environment Rev 1.11. It only shows attributes for bits 15 to 8. So if there are more than this then they are missing from the manual. If so where do I find a complete list? Is there some other file that might show it?

              I got the $8000 from there. It listed I_ENABLED as that so that is what I used.

              Comment


              • #22


                Finally success!!!

                Comment


                • #23
                  Hmm, they are all defined in C:\Users\Public\Documents\4D Labs\Picaso Serial\C\Include\PICASO_CONST4D.H for C for example.

                  Note sure why the missing ones are not there, hmm, of the missing ones I_TOUCH_DISABLE is the only one 'of use'.

                  We'll get that fixed, along with a few other missleading bits.
                  Mark

                  Comment


                  • #24


                    Looks like Set Image Attributes is missing stuff as well.

                    Thanks for your help on this.

                    Comment

                    Working...
                    X