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?
Can i somehow use Movelayer with #USELAYERPOSITION+1?
Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?
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.
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 | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?
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.
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.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?
It's not possible to do this, though #CENTER+x or #RIGHT-x will actually work but it isn't supported for #USELAYERPOSITION
Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?
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 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?
Should be possible to add this.
Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?
That would be most awesome and welcomed! Thanks!
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?
Code: Select all
- New: Offsets can also be added to and subtracted from #USELAYERPOSITION now in the same way you can
fine-tune other special constants like #CENTER or #RIGHT
Re: Can i somehow use Movelayer with #USELAYERPOSITION+1?
Thanks a lot! This will save some hassle.