Is there an easier way?

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Is there an easier way?

Post by bn » Wed Sep 01, 2010 9:58 am

magice,
I think you run into the problem of the referenced image. Try to do

Code: Select all

set the imageData of image "iBlack" to the imageData of image "iBlack"
just once. Then look in the property inspector. The filename in the basic properties should be empty. Than you do your script.

Code: Select all

set the ciWipe of this card to the text of image "iBlack"
and than hit the refresh button. iWipe should now be be black. It is what I called "making a referenced image local" in the post above.
Try if this works.
regards
Bernd

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Is there an easier way?

Post by magice » Wed Sep 01, 2010 4:06 pm

It worked. :D I don't really understand why that had to be done, but I will file it away as something to remember. It really looks like that line of code does nothing....amazing.

Thank you again

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Is there an easier way?

Post by magice » Wed Sep 01, 2010 7:38 pm

OK new question. I would like to be able to import an image larger then 640x480, but need the display area to remain 640x480 with scrollbars. The only way I have found to make this work, is to unlock size and position on the image, group the image in a group by itself, and add scroll bars to the group with the check boxes in the group property window. This allows me to move the larger image around within the 640x480 area. My question is, how can i reference those scrollbars in order to write a script for mirroring their position in the second stack? since they are a property of the group and not a named object I don't seem to be able to adjust their properties individually.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Is there an easier way?

Post by bn » Wed Sep 01, 2010 8:48 pm

magice,
I did a little stack with 2 graphics each in a group with scrollbars. I used graphics to keep the size of the file down. But the same principle applies to your stack with images.
The property I poll is the vScroll and hScroll of the left group to set both parameters on the right group.
For the horizontal scrollbar I calculate the scroll and invert it so when I scroll the left group to the right the right group scrolls to the left. I think that is what you are looking for.
To make things easy set the borderwidth and the margins of the groups and all objects in the groups to 0.
The only code is in the script of the left group.
regards
Bernd
Attachments
ScrollBarAndInverted.rev.zip
(1.45 KiB) Downloaded 218 times

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Is there an easier way?

Post by magice » Wed Sep 01, 2010 10:08 pm

Nevermind I think I found the way. Rather then try to reference the thumbposition i just adjusted the vscroll and hscroll directly

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Is there an easier way?

Post by magice » Wed Sep 01, 2010 11:15 pm

ok, that is real close to the script for inverting that I was writing. I have given up on making the iWipe and iFog layers enlarge and scroll as the entire script breaks when those images are put into a group. What I have will do for now. Thank you very much

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Is there an easier way?

Post by bn » Wed Sep 01, 2010 11:23 pm

magice,
I forgot, you can not paint on an image that is within a group, that is probably the reason why the script breaks.
Too bad.
regards
Bernd

Edit:
http://runtime-revolution.278305.n4.nab ... 34487.html

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Is there an easier way?

Post by magice » Thu Sep 02, 2010 12:13 am

bn wrote:magice,
I forgot, you can not paint on an image that is within a group, that is probably the reason why the script breaks.
Too bad.
regards
Bernd
That is pretty much what I thought. Again not that big of a deal. One more question though. I created a slider to adjust the eraser size between brush 1 and 4. It works great in a windows build, but the control seems to break in a linux build. Any tricks I should know about making sliders cross platform?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Is there an easier way?

Post by bn » Thu Sep 02, 2010 12:20 am

magice,
sorry, I have no experience with Linux whatsoever. I just work on a Mac.
But RunRev promised to beef up the Linux version.
regards
Bernd

Post Reply