Hi there,
I installed AM 4.0 today. I am currently working on Saab S340B Carenado Instruments. I had buttons move with this function:
move(but.id, but.x+3-gDim.x_offset, but.y+3-gDim.y_offset, 184, 128, "LINEAR")
The buttons did not move anymore. When I add a movement speed parameter, it works again, like this:
move(but.id, but.x+3-gDim.x_offset, but.y+3-gDim.y_offset, 184, 128, "LINEAR", 1)
The speed parameter must be different from 0. I guess the default speed is 0. But the speed parameter is optional according to the API documentation. So the image should move when I say "LINEAR" even without an additional parameter.
No big thing. Great job with the update!
'Thanks
Detlef
API move image function different in AM4.0
Re: API move image function different in AM4.0
I believe that’s an error on the wiki page based on what there for the rotate function. If you think about it, why would a type work on its own without a speed. The rotate function has a similar set of arguments but not one without speed. I expect the older version was using a speed default value but from what you say it seems to have now been removed.
Whatever the fix is, It would be good to make the move and rotate functions the same.
Whatever the fix is, It would be good to make the move and rotate functions the same.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: API move image function different in AM4.0
Tony,Sling wrote: ↑Sun Apr 25, 2021 9:53 am I believe that’s an error on the wiki page based on what there for the rotate function. If you think about it, why would a type work on its own without a speed. The rotate function has a similar set of arguments but not one without speed. I expect the older version was using a speed default value but from what you say it seems to have now been removed.
Whatever the fix is, It would be good to make the move and rotate functions the same.
I suspect, It might be the (Optional) has changed between AM versions.
As Detlef says. Not a big issue. As long as the API indicates the change and is consistent and if (options) are in "sets" or can truly be optional. The description I suppose indicates that.
In this case the animation speed is optional as per description.
Code: Select all
move(node_id, x, y, width, height, animation_type) (from AM/AP 4.0)
move(node_id, x, y, width, height, animation_type, animation_speed) (from AM/AP 4.0)
The SI Guys are extremely busy ATM so not expecting changes tomorrow.
Keith
Last edited by Keith Baxter on Sun Apr 25, 2021 10:34 am, edited 1 time in total.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: API move image function different in AM4.0
The wiki says Rotate only has this variant so whichever way its done they should be consistent. Meaning remove the type only variant from the move wiki page or add the type only variant to the rotate wiki function and alter the AM code to make the move and rotate functions use a default speed when its not used with the type only variants. If the later approach is used it would be good to put the default speed value on the move and rotate wiki pages.
Code: Select all
rotate(node_id, degrees, animation_type, animation_speed)
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D