The scroller problem - The page is missing 1/3

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Kae
Posts: 7
Joined: Thu May 09, 2013 4:46 am

The scroller problem - The page is missing 1/3

Post by Kae » Sat Nov 16, 2013 11:55 pm

HI,this is a photo album that is need horizontal image scroller. I have already created a scroller. However, the last page of photo is missing 1/3 on right hand side.
This is the code ↓

Code: Select all

local sScrollerID

on preOpenCard
   local tScrollerRect, tContentRect
   if environment() is not "mobile" then exit preOpenCard
   put the rect of group "cards" into tScrollerRect
   mobileControlCreate "scroller", "loremScroll"
   put the result into sScrollerID
   mobileControlSet "loremScroll", "rect", tScrollerRect
   mobileControlSet "loremScroll", "contentRect", "0,0,1600,402"
   mobileControlSet "loremScroll", "visible", true
   mobileControlSet "loremScroll", "scrollingEnabled", true
   mobileControlSet "loremScroll", "hIndicator", false
   mobileControlSet "loremScroll", "hscroll", 0
   
end preOpenCard

on closeCard
   // Delete the scroller
   if environment() is not "mobile" then exit closeCard
   mobileControlDelete sScrollerID
end closeCard

on scrollerDidScroll hOffset, vOffset
   // When the user scrolls move the displayed content
   set the hScroll of group "cards" to hOffset
end scrollerDidScroll
Is there wrong in this code? How to fix this problem?
I'm a bit under pressure here to get this Android version wrapped asap so I'd really appreciate any help. Thanks!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: The scroller problem - The page is missing 1/3

Post by Simon » Sun Nov 17, 2013 12:03 am

Quick answer is that 1600 is incorrect.
Want some else to look at the stack (fastest way)? Go ahead and post it with 1 pic.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: The scroller problem - The page is missing 1/3

Post by Simon » Sun Nov 17, 2013 1:20 am

Just tried your code in the sim and it's working, with:

Code: Select all

 put 0,0,the formattedWidth of img 1,400 into tContentRect --this line added, you'll never have to resize your image
   mobileControlCreate "scroller", "loremScroll"
   put the result into sScrollerID
   mobileControlSet "loremScroll", "rect", tScrollerRect
   mobileControlSet "loremScroll", "contentRect", tContentRect--and here
that was with a 4928X3264 px image that I put markers on the left and right side to make sure I got the whole thing.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Kae
Posts: 7
Joined: Thu May 09, 2013 4:46 am

Re: The scroller problem - The page is missing 1/3

Post by Kae » Sun Nov 17, 2013 1:52 am

HI Simon,
I have already tried to change 1600 to other number, but there is nothing is changed. Also, I tried the changed code and output to my mobile that is not work.
There is the stack and the photo ↓
https://www.dropbox.com/sh/v2tabyrnkzwm0z4/fy9AP2-2fH

Thanks!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: The scroller problem - The page is missing 1/3

Post by Simon » Sun Nov 17, 2013 2:58 am

Hi Kae,
I see what the problem is... it's that subgroup G1 is not up against the left side of group "cards".
To keep your style add a rectangle to group "cards" and
set it's blend level to 99
width 1600
height 400
left 0
top 42

Everything shows up just fine after that.
Given more time we can probably figure out another way.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Kae
Posts: 7
Joined: Thu May 09, 2013 4:46 am

Re: The scroller problem - The page is missing 1/3

Post by Kae » Fri Nov 22, 2013 5:37 pm

Hi Simon,
I'm sorry too late to reply you. I had try your method but that is not work. If I set it's blend level to 99, all photo I cannot see, or "set it's blend level to 99" that is the code?
Also, if I set "width 1600, height 400, left 0, top 42", that is could not scroll. Would you like to send your stack to me?
Thanks!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: The scroller problem - The page is missing 1/3

Post by Simon » Fri Nov 22, 2013 10:18 pm

I'm a bit under pressure here to get this Android version wrapped asap...
I'm sorry too late to reply you.
Due to the delay in your response I'm going to go with neither of those two statements are true as well as
I had try your method but that is not work. If I set it's blend level to 99, all photo I cannot see,
The default rectangle tool draws a rectangle that is not opaque.

Kae, I'm very happy to help here in the forums but I don't work here for you. I responded to your request asap when it turns out it really wasn't that important to you.
Would you like to send your stack to me?
Nope

Good Luck,
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply