Page 1 of 1

MoveLayer in Designer 3.0

Posted: Wed Apr 06, 2011 8:40 pm
by djrikki
Hello fellow Hollywooders,

I am trying to add some code into an object, I simply want to position an Image off the page and fly it from the left and off the page to the right.

a) Setting an X position off the page is easy. DONE CHECK.

b) Add code to the object I want to move, done some research inserted the correct code to get it move.

Code: Select all

For i = 0 to 800
MoveLayer("LOGOIMAGE",#USELAYERPOSITION, #USELAYERPOSITION, i, 0, #SMOOTHOUT)
Next
c) Start slideshow. Page does its business, I wait for image to fly from left to right... nothing happens. I wait a little longer... ahh the image has appeared 800 pixels away from its starting point!

...except I never saw it moving from its start and into its finish position.

Do I have to set something or insert some more code to get the slide to show me the object moving across the path?

EDIT: Sorry this was meant to be in the Designer section!! Ah well

Re: MoveLayer in Designer 3.0

Posted: Wed Apr 06, 2011 9:16 pm
by Allanon
Hi,
I think you should use:

Code: Select all

; The SMOOTHOUT effect can't be achieved with this code but only a plain movement
For i = 0 to 800
   SetLayerStyle("LOGOIMAGE", { X = i })
   ; Instead of <SetLayerStyle> you can also use:
   ; ShowLayer("LOGOIMAGE", i, #USELAYERPOSITION)
   ; You can even use a Wait() command to slow down movement
Next
If you like to use MoveLayer() because of the effects you don't have to use a for/next loop because you have to specify a starting and ending position so you should use in this way:

Code: Select all

;For i = 0 to 800 <-- NOT NEEDED!
   MoveLayer("LOGOIMAGE", 0, #USELAYERPOSITION, 800, #USELAYERPOSITION, { FX = #SMOOTHOUT})
;Next <-- NOT NEEDED!

Re: MoveLayer in Designer 3.0

Posted: Wed Apr 06, 2011 11:12 pm
by djrikki
Ah ShowLayer... excellent.

Used this is the end:

Code: Select all

For x = 0 to 1000 step 20
    ShowLayer("LOGOIMAGE",x)
    Wait(1)
Next
Not very smooth mind, perhaps because the brush is 1980x1080 xD Think I'll use a smaller version. lol

Re: MoveLayer in Designer 3.0

Posted: Wed Apr 06, 2011 11:30 pm
by djrikki
Replaced it with this, was much smoother, also resizing the image to 800x600 also helped. I wonder if because I don't have hardware compositing yet its not very smooth.

ShowLayer("BG1",#USELAYERPOSITION,#USELAYERPOSITION)
MoveLayer("BG1", #USELAYERPOSITION, #USELAYERPOSITION, 1200, #USELAYERPOSITION, {Speed = #FASTSPEED} )