Page 1 of 1
Unable to resize
Posted: Wed Jan 02, 2013 6:07 am
by magice
Some time ago I was working on a program that created a "fog of war" effect over a map image for pen and paper role playing games. I can erase the fog in the "GM" window and it would also erase the fog in the corresponding "player" window. I was stuck, and someone on this board sent me a sample of exactly what I needed. After some modification I made it work for my purposes. Now however i need to make it bigger, but when i do the stack stops working. I am uploading the file, If anyone could look at this stack and tell me what I am doing wrong I would appreciate it. I need the image area about 1000 wide by 650 high.
Re: Unable to resize
Posted: Fri Jan 04, 2013 5:39 am
by Simon
Hi magice,
I downloaded your file but can't figure out what is not working. More to the point, what is it supposed to do?
Can you tell me the steps to show 1) it's working 2) it's not working.
Simon
Re: Unable to resize
Posted: Sat Jan 05, 2013 8:03 pm
by magice
Simon wrote:Hi magice,
I downloaded your file but can't figure out what is not working. More to the point, what is it supposed to do?
Can you tell me the steps to show 1) it's working 2) it's not working.
Simon
Ok what it does is simple. It is designed to be used with a projector running on a laptop. The first stack stays on the laptop the second is projected. Now I am converting it to work with a second monitor, or more accurately a 32 inch LCD TV lying on it's back as a gaming table. If you load an image in the first stack, (in practice a game map) it also loads into the second stack, but the second stack is blacked out. As you mouse over the image in the first stack it erases the blacked out area of the second stack revealing the picture (map). This is exactly what I want it to do. However I need to enlarge the image area. The problem is when I do that, it does not stay enlarged. There are 2 hidden buttons in each stack (when you enlarge the stack you will see them) that are scripts to commit the image to the stacks memory, and if my memory serves they have to be run for the image to stay. I have tried that. I have made a new image of a black rectangle 1000 pixels X 650 and changed the image source to that, then ran the scripts, but the blacked out area still fails to stay enlarged. Since the stack was the product of someone elses help, and several hours of trial and error to make my changes, I'm not really sure how I got it to work the first time. The question is, what do I need to do to enlarge the 2 image areas and the two blacked out area images and have the stack still work? Ideally I would also like to be able to scale up the size of the second image, but that is not 100% necessary since i can just lower the screen resolution of the second monitor.
Re: Unable to resize
Posted: Sat Jan 05, 2013 10:25 pm
by Simon
OK I get it now and see why you are having difficulties.
Code: Select all
on restoreFog
set the visible of image "iFog" of card 1 of stack "fog" to true
set the text of image "iWipe" to the cIWipe of this card
set text of image "iFog" of card 1 of stack "fog" to the cIWipe of this card
end restoreFog
The line "set the text of image "iWipe" to the cIWipe of this card" is very interesting because the text is actually an image. To re-size the image you'll have to import into the custom property cIWipe a new larger image.
The 2 groups iOrigGroup and iFogGroup will have to be the same size (you can make them larger) but the stacks can be of different sizes.
I'd really like to know who made this for you as it's pretty cool coding.
If you are still stuck just ask.
Simon
Re: Unable to resize
Posted: Sun Jan 06, 2013 5:23 pm
by magice
You are starting to refresh my memory. That is the part I was originally having trouble with. If I remember correctly I had to import the image as a custom control, but then there was something I had to do to make that image a custom property. It also seems like when done properly, the lower box of the custom properties tab of the property inspector gets unreadable content. I will even go as far as to say it has something to do with the two button scripts. Beyond that I am lost. Here is what i have done.
I have deleted the old custom property cIWipe
I deleted the old image iWipe
I imported a new image iWipe the correct size
I applied the script from the old image iWipe to the new image iWipe and set the transparency.
I re sized and positioned everything the way it needs to be
What doesn't seem to be right is that the image iWipe is not properly becoming the cIWipe custom property.
What am I forgetting?
Re: Unable to resize
Posted: Sun Jan 06, 2013 6:24 pm
by magice
OK I figured it out. The 2 buttons I needed I guess I had deleted. I just needed to run 2 scripts.
Code: Select all
on mouseUp
set the iWipe of this card to the text of image "iWIpe"
end mouseUp
And
Code: Select all
set the imageData of image iWipe to the imageData of image iWipe
Thank you for refreshing my memory. Seems like the older I get the more often I need it. Oh, and the person who originally helped me was Bernd
Re: Unable to resize
Posted: Mon Jan 07, 2013 12:23 am
by Simon
Glad I could help refresh your memory.
Simon