Page 1 of 1

The scroller problem - The page is missing 1/3

Posted: Sat Nov 16, 2013 11:55 pm
by Kae
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!

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

Posted: Sun Nov 17, 2013 12:03 am
by Simon
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

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

Posted: Sun Nov 17, 2013 1:20 am
by Simon
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

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

Posted: Sun Nov 17, 2013 1:52 am
by Kae
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!

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

Posted: Sun Nov 17, 2013 2:58 am
by Simon
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

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

Posted: Fri Nov 22, 2013 5:37 pm
by Kae
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!

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

Posted: Fri Nov 22, 2013 10:18 pm
by Simon
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