Running img add hor
Jump to navigation
Jump to search
Description
running_img_id = running_img_add_hor(filename, x,y,nr_visible_items,item_width,item_height)
running_img_add_hor is used to add a running image object. Running imagecan be used to make multiple image objects scrollable horizontally.
Return value
Argument | Type | Description |
---|---|---|
running_img_id | ID | This value can be used for further reference. Functions such as running_img_move_carot can use this running_img_id. Its good practice to store this running_img_id in your logic code. |
Arguments
# | Argument | Type | Description |
---|---|---|---|
1 | filename | String | This is the filename of the image you would like to show. Note that this is both filename and extension. Its good practice to always the PNG format for images. JPG and BMP are also supported, but not recommended. |
2 | x | Number | This is the most left point of the canvas where your running image should be shown. |
3 | y | Number | This is the most top point of the canvas where your running image should be shown. |
4 | nr_visible_items | Number | Number of image items that should be shown. |
5 | item_width | Number | The width of every image object in pixels. |
6 | item_height | Number | The height of every image object in pixels. |
Example
-- This will generate 7 image_objects horizontally.
my_running_img_id = running_img_add_hor("picture.png",100,100,7,200,100)
-- Set carot to 1
running_img_move_carot(my_running_img_id , 1)
-- Or to 2...
running_img_move_carot(my_running_img_id , 2)