Page 2 of 2
Posted: Wed Jul 15, 2009 11:36 am
by Klaus
Hi Bidge,
very nice

BUT: Your images and IDs are not in sync, that's why you see these strange "flickering"

Image "s0013.png" has the ID 1004!
OK, here is what you should do, since hiding/showing images are not necessary and may cause
flickering and unneccessary delays!
1. Hide all your PNG imgages!
2. Create an empty image "display" wiht the same dimension as your PNGs = 320*240, location 160,120
3. Set the layer of your button to top!
4. then put this into your button:
Code: Select all
on mouseUp
put the ID of img "display" into tID
repeat 5
repeat for each item i in "0001,0002,0003,0004,0005,0006,0007,0008,0009,0010,0011,0012,0013"
### This is the trick! Only have ONE image so hiding/showing is not neccessary!
put img ("s" & i & ".png") into img "display"
set the windowshape of this stack to tID
wait 100 millisecs
end repeat
end repeat
put empty into img "display"
set the windowShape of this stack to 0
end mouseUp
And be a happy camper just like you cartoon guy

Posted: Wed Jul 15, 2009 11:47 am
by Klaus
To have even more fun do this:
1. Put your stack at the right side of your monitor
2. Add this line right after "on mouseup":
Code: Select all
on mouseup
move this stack rel -600,0 in 6.5 secs without waiting
...
You may want to experiment wiht the duration

Posted: Wed Jul 15, 2009 11:48 am
by bidgeeman
Hello Klaus......I see what you mean about using the one image now...In your code should the "display" be set to? I tried setting it to an image but I just get a grey ghosted aea.
Cheers
Bidge
Posted: Wed Jul 15, 2009 11:59 am
by Klaus
Hi Bidge,
nothing to set to!
You can simply "put" one image into another image.
And my scripts are always usable right out of the box!!!, as long as everything is set up correctly, in this case you need just an empty image named "display".
Best
Klaus
Posted: Wed Jul 15, 2009 12:05 pm
by bidgeeman
Hi Klaus....I get a compile error.....no such object "display"
EDIT :
button "Button": execution error at line 4 (Chunk: no such object) near "display", char 12
Bidge
Posted: Wed Jul 15, 2009 12:08 pm
by Klaus
Sigh...
What exactly do you not understand at point 2. in my list of my post from Wed Jul 15, 2009 10:36 am???
Posted: Wed Jul 15, 2009 12:10 pm
by bidgeeman
I replaced the "display" with an image....image s001.png but I just get a grey ghost?
Bidge
Posted: Wed Jul 15, 2009 12:14 pm
by Klaus
GEEEEEZ! Please read my posts!
OK, maybe this is EVEN MORE understandable???
...
2. Create a NEW (and thus empty) image object AND NAME IT "display" ...
...
Posted: Wed Jul 15, 2009 12:25 pm
by bidgeeman
Okay....thanks I get it. Sorry. I had no idea I had to create a completely empty .png file to see what was going on.
but it works

....and the horizontal movement is a fantastic effect!!!!
Phew!!!!
Many thanks for your patience Klaus.
Cheers
Bidge
Posted: Wed Jul 15, 2009 12:31 pm
by Klaus
Hi Bidge,
bidgeeman wrote:Okay....thanks I get it. Sorry. I had no idea I had to create a completely empty .png file to see what was going on.
Nope!
You just needed to drag an empty image from the Rev tool palette to your stack, name it "display" and set its dimensions and loc as I told you.
bidgeeman wrote:Many thanks for your patience Klaus.
Cheers
Bidge
Kudos goes to my mom (RIP) for educating me so well
Best
Klaus
Posted: Wed Jul 15, 2009 12:35 pm
by bidgeeman
OMG!!!!! I did'nt see those instructions at all!!!!! Sorry sorry sorry Klaus. Noi wonder you were upset. I actually missed them altogether. I just noticed them then
Oh dear
Bidge
Posted: Wed Jul 15, 2009 12:40 pm
by Klaus
GEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEZZZZZZZZZ!

Posted: Wed Jul 15, 2009 4:19 pm
by SparkOut
Or put something like this in the stack script, for fun:
Code: Select all
on arrowKey theArrow
put the loc of this stack into theLoc
switch theArrow
case "up"
subtract 4 from item 2 of theLoc
break
case "down"
add 4 to item 2 of theLoc
break
case "left"
subtract 4 from item 1 of theLoc
break
case "right"
add 4 to item 1 of theLoc
break
end switch
set the loc of this stack to theLoc
end arrowKey
and maybe edit the button script to make a long or infinite loop that you can escape from by holding down the command/control key
Code: Select all
on mouseUp
put the ID of img "display" into tID
repeat forever
repeat for each item i in "0001,0002,0003,0004,0005,0006,0007,0008,0009,0010,0011,0012,0013"
### This is the trick! Only have ONE image so hiding/showing is not neccessary!
put img ("s" & i & ".png") into img "display"
set the windowshape of this stack to tID
put the loc of this stack into theLoc
if the controlKey is down or the commandKey is down then
put empty into img "display"
set the windowShape of this stack to 0
exit to top
end if
wait 100 millisecs with messages
end repeat
end repeat
end mouseUp
Now you can make your man run around the screen by pressing the arrow keys. Of course you should have a different set of graphics that change according to the direction he's running...
Posted: Thu Jul 16, 2009 1:24 am
by bidgeeman
Oh man!!!! That's excellent Spark! I'll get to work and create some more angles
Cheers
Bidge
Posted: Thu Jul 16, 2009 5:06 am
by bidgeeman
Here are some more sprites to play with. Running left, Running right, going up and down. The sprites for up and down should look quite funny....he just stands there with loose limbs as if he is being levitated.
EDIT: Just added: front standing still shot.
http://www.errolgray.com.au/Bidgesprites.zip
Cheers
Bidge