Can i somehow use Movelayer with #USELAYERPOSITION+1?

Find quick help here to get you started with Hollywood
Post Reply
Bugala
Posts: 691
Joined: Sun Feb 14, 2010 8:11 pm

Can i somehow use Movelayer with #USELAYERPOSITION+1?

Post by Bugala » Mon Feb 02, 2015 2:33 pm

I am trying to make video tutorial 3 for hollywood with designer tutorials, however, i ran into a problem where i myself need tutoring first.

I am using command MoveLayer(id, xa, ya, xb, yb)

and inside this command it is possible to use #USELAYERPOSITION as any of these x and y co-ordinates.

Thing is, I want that object to move 30 pixels towards left, to achieve this I tried:

MoveLayer(id, #USELAYERPOSITION, #USELAYERPOSITION, #USELAYERPOSITION -30, #USELAYERPOSITION)

but when i use this, the strangest thing is that instead of moving it towards left, like i thought it would, it is actually moving it towards right, and seems like it keeps moving it towards right forever since only way i can get anything to happen in my designer project after that, is to use ESC to abort it.

Normally you could use Constants, ie: #MYDEFAULTNUMBER in mathematic calculations, as example: x = #MYDEFAULTNUMBER + 1, but I couldnt use this #USELAYERPOSITION inside HideLayer command for calculations, at least not the way i thought it would work.

Hence, is it possible to do it the way I was planning to do at all, and if yes, then how?

User avatar
Allanon
Posts: 440
Joined: Sun Feb 14, 2010 8:53 pm
Location: Italy
Contact:

Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?

Post by Allanon » Mon Feb 02, 2015 2:45 pm

I think it's not possible because #USELAYERPOSITION and all special constants uses special values, if you try to print #USELAYERPOSITION you will see that it holds a special value that is interpreted by the command at runtime.
If you change the special value adding +1 the special command became another special command with unpredictable results.
So the way I suggest is to use GetAttribute(...) to get the current position of your layer, hold it in variable and then add 1 to the value retrieved.
Another way is to use the TranslateLayer() command that uses an offset to move a layer around.
----------------------------
[Allanon] Fabio Falcucci
AMC - Creative Development // Docs Site // Support Forum
Support me on Patreon for Hollywood libraries!

Bugala
Posts: 691
Joined: Sun Feb 14, 2010 8:11 pm

Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?

Post by Bugala » Mon Feb 02, 2015 3:40 pm

Thanks Allanon.

I will either use hard value in which case i show where to get that hard value, or then use GetAttribute. Or perhaps I even show how to use them both, which might be a good idea actually too.

User avatar
airsoftsoftwair
Posts: 2558
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?

Post by airsoftsoftwair » Sun Feb 08, 2015 12:05 pm

It's not possible to do this, though #CENTER+x or #RIGHT-x will actually work but it isn't supported for #USELAYERPOSITION :)

User avatar
Clyde
Posts: 80
Joined: Sun Feb 14, 2010 1:38 pm
Location: Dresden / Germany

Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?

Post by Clyde » Tue Feb 20, 2018 2:57 pm

Any plans (or possibilities) to add this behavior to #USELAYERPOSITION? That would be superhelpful and as it works for #CENTER and so on ... :-)
Currently using: Hollywood 7.1 with Windows IDE

User avatar
airsoftsoftwair
Posts: 2558
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?

Post by airsoftsoftwair » Wed Feb 21, 2018 8:52 pm

Should be possible to add this.

User avatar
Clyde
Posts: 80
Joined: Sun Feb 14, 2010 1:38 pm
Location: Dresden / Germany

Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?

Post by Clyde » Wed Feb 21, 2018 11:21 pm

That would be most awesome and welcomed! :-) Thanks!
Currently using: Hollywood 7.1 with Windows IDE

Post Reply