Move
Jump to navigation
Jump to search
Description
move(node_id, x) move(node_id, x, y) move(node_id, x, y, width) move(node_id, x, y, width, height) 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)
move is used to move an object. This can be an image, text, switch, button, joystick, slider, dial, scroll wheel or a map.
Return value
This function won't return any value.
Arguments
# | Argument | Type | Description |
---|---|---|---|
1 | node_id | ID | Node identifier. This number can be obtained by calling functions like img_add or txt_add. |
2 | x | Number | This is the most left point of the canvas where your object should be shown. |
3 | y | Number | This is the most top point of the canvas where your object should be shown. |
4 | width | Number | (Optional) The new width of the object. |
5 | height | Number | (Optional) The new height of the object |
Example
-- Load and display text and images
myimage1 = img_add_fullscreen("myimage1.png")
-- Move image1 to x,y = 100,100, width=200, height=250
move(myimage1,100,100,200,250 )
-- Move image1 to x=200
-- Note that using 'nil' will ignore that parameter (original value will be preserved)
move(myimage1,200,nil,nil,nil )