Difference between revisions of "Move"
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
! # !! Argument !! Type !! Description | ! # !! Argument !! Type !! Description | ||
|- | |- | ||
| 1 || '''node_id''' || ''String'' || | | 1 || '''node_id''' || ''String'' || 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. | | 2 || '''x''' || ''Number'' || This is the most left point of the canvas where your object should be shown. |
Revision as of 15:14, 19 May 2018
Description
move(node_id,x,y) move(node_id,x,y,width,height)
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 | String | 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 )