Picture-Scroller with a group?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

Picture-Scroller with a group?

Post by DevBoyLars » Fri Oct 24, 2014 9:25 am

Hi there,
I want to build a horizontal scroller for some pictures inside an App.

I need to fill the scroller with pictures at runtime.

Has anyone experiences with something like this and can give me an examples?

Maybe it is possible to build a group, which is bigger than the screen and hide the scoller-bars? But if this could work, how to add/remove pictures at runtime in this group?

Thank you!! :)

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Picture-Scroller with a group?

Post by jmburnod » Fri Oct 24, 2014 10:07 am

Hi,
Maybe it is possible to build a group, which is bigger than the screen and hide the scoller-bars?
Yes, and you can scroll your group with Horizontal or vertical move :D
You can see one example called "StResizeAndMoveGroupH" from revOnline
But if this could work, how to add/remove pictures at runtime in this group?
You can copy one control in your group

Code: Select all

copy control "ImageMaster" to group pGroup
and set the properties of all controls of group in a loop
Best regards
Jean-Marc
https://alternatic.ch

DevBoyLars
Posts: 216
Joined: Wed Feb 27, 2013 9:04 pm

Re: Picture-Scroller with a group?

Post by DevBoyLars » Sat Oct 25, 2014 9:01 am

Thank you :)

What does the last thing means?

"set the properties of all controls of group in a loop"

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Picture-Scroller with a group?

Post by jmburnod » Sat Oct 25, 2014 9:28 am

Welcome,

Once you have created all controls of your group you can set the properties of all controls of group.
As properties I mean "location,rect, filename etc...
This script place all images of a group verticaly

Code: Select all

on doImgGroupVertical
   put the num of images of group "grMyGroup" into nbImg
   put the bottomleft of image 1 of group "grMyGroup" into tDepBL 
   repeat with i = 2 to nbImg
      set the topleft of image i of group "grMyGroup" to tDepBL
      put the bottomleft of image i of group "grMyGroup" into tDepBL 
      add 2 to item 2 of tDepBL --marginV 2 px
      wait 1 milliseconds
   end repeat
end doImgGroupVertical
Best regards
Jean-Marc
https://alternatic.ch

Post Reply