This content has been marked as final. Show 5 replies
You can get access to any of the loop's sprites through the loop-sprite's movie property. Assuming you used sprite channel 1 for your 4 frame loop, then the following behavior will rotate those sprites inside the film loop.
on beginSprite me
pMovieSprite = sprite(me.spriteNum).movie.sprite(1)
on enterframe me
pMovieSprite.rotation = pMovieSprite.rotation + 10
In the property inspector select the "Film Loop" tab for your film loop member and select the "Crop" and "Center" radio buttons. This will enable you to resize the film loop sprite to fix any cropping issues.
Note: This will also work for LDMs - Linked Director Movies, if you want to use these "Loops" across multiple movies.
Thanks for this. The film loop consists of 4 (4 frame stills) sprites in a row to suggest a walk cycle. I had a go with it but the sprite insists on 'switching back' to its original rotation before being set to the current desired rotation. Presumably as it meets each sprite it has to correct it. I tried a couple of different event handlers (enter, exit, prepareframe) but didn't seem to make any difference. I may just have to settle for the animated gif.
Right. The beginsprite is resetting the value.
If you use a behavior to cycle through the walk cycle images it should work. You will need to call exitFrame directly on the sprite inside the film loop to make it work though.
I know that is a bit cryptic. I'll try to post some code tomorrow if you have not figured it out by then.
Here's a link to more details on how to control a film loop. http://director-online.com/forums/read.php?2,10116,10148#msg-10148
I threw together a basic image cycling behavior. To use it, place your walk cycle images in their own folder. Drag the first image to the stage and attach the behavior. You should have the same effect as a film loop, except now you can rotate the sprite because it is not a film loop.
Depending on your needs you may want to create each movement cycle as a seperate Director movie and then bring them into your main movie as linked Director movies with the "scripts enabled" button checked. This would make things more modular. If you take this route then the Rotation script I provided will work.
Thanks for the time you put in on this. There's always a way round Director's seeming (or actual) shortcomings.