MoveLayer in Designer 3.0

Find quick help here to get you started with Hollywood
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

MoveLayer in Designer 3.0

Post 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
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: MoveLayer in Designer 3.0

Post 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!
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: MoveLayer in Designer 3.0

Post 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
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: MoveLayer in Designer 3.0

Post 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} )
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
Post Reply