Scrolling a group

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Scrolling a group

Post by JosepM » Mon Oct 15, 2012 4:44 pm

Hi,

I'm lost about how deal with this.

I have a image, 2048x1536 pixels, not retina scale, only a big background. With this image I group some other images, so I have a group that I want scroll. With "grab me" command all is ok. I can scroll and "click" over the images inside the group, but when I apply a "scroll" object nothing work. Also I need a toolbar over the scroll region, so the user must actuate clicking the images inside the group and the toolbar.

I post a image for a best explantion.

The blue area is the image and the stars are the controls that from the group.

It's posible do that I need? Any experience?

Salut,
Josep M
Attachments
screen_mockup.jpg

scotttyang
Posts: 125
Joined: Sat Jan 31, 2009 12:01 am

Re: Scrolling a group

Post by scotttyang » Tue Oct 16, 2012 12:11 am

see the attached app call mapscroll.livecode. similar to what you are doing, except it's a map and has groups with buttons on it that when clicked gives the name of the country.
Attachments
mapscroll.zip
(126.15 KiB) Downloaded 278 times

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: Scrolling a group

Post by JosepM » Tue Oct 16, 2012 12:56 am

Hi Scotty,

Big thanks! :) just what I need.

In my code I assign the rect and the contentrect directly from the image properties, this is basically the difference, and the "grab me" :?

One question more. How drag a button inside the scroll group? With "grab me" only I move a little but don't work.
I need a "double tap" to create a object inside the map group and move it to a desired position. Any idea how do that?

Salut,
Josep M

scotttyang
Posts: 125
Joined: Sat Jan 31, 2009 12:01 am

Re: Scrolling a group

Post by scotttyang » Tue Oct 16, 2012 1:14 am

That's a dangerous question. Your asking to move a object in a moving object. I've never tried moving an object in a scroll group!

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: Scrolling a group

Post by JosepM » Tue Oct 16, 2012 7:03 am

And scroll to a region? In your example, the user click into the toolbar to show europe, usa, asia... and the scrolling move to the x,y position into the scroller... :|

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: Scrolling a group

Post by JosepM » Tue Oct 16, 2012 3:29 pm

Hi,

Autoanswer...

To scroll to any X,Y use and put at mainstack or card level where you create the scroller.

Code: Select all

on moveTo vS,hS
   iphoneControlSet sScrollerId, "vscroll", vS
   iphoneControlSet sScrollerId, "hscroll", hS
end moveTo

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: Scrolling a group

Post by JosepM » Tue Oct 16, 2012 3:31 pm

Hi,

Now left the drag controls inside a scroller... any experience?

Salut,
Josep M

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: Scrolling a group

Post by JosepM » Tue Oct 16, 2012 7:22 pm

Hi,

I try to positionate the scroller into a X,Y in the preOpenCard but nothing happen, nor OpenCard...

Code: Select all

on opencard
   if the environment is not "mobile" then
      exit opencard
   end if
   iphoneControlSet sScrollerId, "hscroll", 2126
   iphoneControlSet sScrollerId, "vscroll", 355
end opencard
But If I call this from a button, work. :(
What I'm doing wrong?

Salut,
Josep M

Post Reply