Alternating stripes in fields

Sarah Reichelt sarahr at genesearch.com.au
Tue Mar 8 19:31:03 EST 2005


> Ah yes... I worked this out once. You need a series of patterns that 
> you set as the user scrolls. The number of images depends on the line 
> height of your field. From memory you need the line height X 2 images. 
> You will need to fix the line height then create your images. In 
> Photoshop or some other image editor create a an image that is 4 lines 
> high. Draw your lines then resize the canvas to the bottom two lines. 
> Repeat the following:
> - save the image
> - shift the image down 1 pixel
>
> Until you have completed the cycle.
>
> Then you import the images into rev. They need names that include 
> their number starting with 0. Something line "lines0","lines1" etc.
>
> In the field you need a script that does this:
> on scrollBarDrag
>   set the backPattern of me to the id of image \
>      ("lines"&the vScroll of me mod (the lineHeight of me *2))
> end scrollBarDrag
>
I tried this solution too, Monte :-) It's problem was that the height & 
width of the backgroundPattern image must be a factor of 8. I needed to 
do this for a field with a textHeight of 18, so there was no way to get 
your idea to work, although it was really good for fields with a 
textHeight of 16.

Sarah



More information about the use-livecode mailing list