Is there a way to move an object around without using code?
Using the Move Object Event seem to only support using absolute X and Y coordinates, so you cant use that if you want to just move it a few pixels left or right.
Move Object
Re: Move Object
What kind of object?
And why doesn't your program know the position of this object?
But using layers you could read the position of an object:
And why doesn't your program know the position of this object?
But using layers you could read the position of an object:
Code: Select all
@DISPLAY {Width = 400, Height = 300, Layers = True}
Circle(10, 10, 30, #GRAY, {Name="circle1"})
For i=1 To 10
st = GetLayerStyle("circle1")
MoveLayer("circle1", st.x, st.y, st.x+30, st.y+20,{Speed=#SLOWSPEED})
Wait(1,#SECONDS)
Next
Re: Move Object
Thanks for your reply and your code sample.
Although I can use Hollywood code in Designer, I want to explore the other ways to do things in Designer.
Thats why I posted this in the Designer section of the forum, not Hollywood.
Re: Move Object
Sorry, I should have looked more closely at the subforum.
Re: Move Object
Hello amyren.
With RMB on your object, for example an image, go to Events and select what you need (on mouse over, mouse click, etc). Click New and select the type of event from the list. You can try Animate Object or Move Object, according to your needs. You can also use Action scripts,no need to write code also if you don't want too.
In both cases you can mix several events, like wait for mouse click, or time, or to finish another animation, for example.
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
Re: Move Object
emeck wrote: ↑Sat Jan 15, 2022 10:50 amHello amyren.
With RMB on your object, for example an image, go to Events and select what you need (on mouse over, mouse click, etc). Click New and select the type of event from the list. You can try Animate Object or Move Object, according to your needs. You can also use Action scripts,no need to write code also if you don't want too.
In both cases you can mix several events, like wait for mouse click, or time, or to finish another animation, for example.
I did do that, and selecting Move Object. But the Move Object dialog does not support moving the object eg. 5 pixels, you can only set the absolute X and Y positions.
Re: Move Object
Try Animate Object. You can move objects specifying X and Y pixels independently and relative to the starting position.I did do that, and selecting Move Object. But the Move Object dialog does not support moving the object eg. 5 pixels, you can only set the absolute X and Y positions.
Edit: From the animate object documentation.
The following options are currently supported:
‘Move’
Here you can specify values for moving the object. You can specify separate values for the x and y axes. Please note that these values are delta values, i.e. they are relative to the current position of the object. If you enter "100" for x, the object will be moved 100 pixels to the right starting from the current position of the object. If you enter "-100" for x, the object will be moved 100 pixels to the left starting from the current position.
PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
Re: Move Object
Thanks, that looks to be what I was after.
I will try that.
I will try that.