Blend_Mode
Syntax:
lua
_Blend_Mode(ImageName, blendMode)
Purpose: Sets the blending mode for an image. Supports standard and Porter-Duff modes.
Canvas_Erase
Syntax:
lua
_Canvas_Erase()
Purpose: Clears the painting canvas.
Canvas_Redo
Syntax:
lua
_Canvas_Redo()
Purpose: Redoes the last undone painting element.
Canvas_Set_CanvasColor
Syntax:
lua
_Canvas_Set_CanvasColor(r, g, b, alpha)
Purpose: Sets the background color of the canvas.
Canvas_Set_PaintColor
Syntax:
lua
_Canvas_Set_PaintColor(r, g, b, alpha)
Purpose: Sets the color for painting on a canvas.
Canvas_Set_StrokeWidth
Syntax:
lua
_Canvas_Set_StrokeWidth(width)
Purpose: Sets the width of the paint strokes on a canvas.
Canvas_Undo
Syntax:
lua
_Canvas_Undo()
Purpose: Undoes the last painting element.
Canvas_is_Enabled
Syntax:
lua
_Canvas_is_Enabled(value)
Purpose: Enables or disables painting on a canvas.
Capture_Photo
Syntax:
lua
_Capture_Photo("FileName.jpg", Image_Width, Image_Height,
Preserve_Aspect, Compression, Function_to_Run)
Purpose: Takes a photo using the camera, with resizing and compression options.
Capture_Region
Syntax:
lua
_Capture_Region("FileName.jpg", x1, y1, x2, y2,
Image_Width, Image_Height, Preserve_Aspect, Compression,
Function_to_Run)
Purpose: Captures a specific region of the screen, with resizing and compression options.
Capture_Screen
Syntax:
lua
_Capture_Screen("FileName.jpg", Image_Width, Image_Height,
Preserve_Aspect, Compression, Function_to_Run)
Purpose: Captures a screenshot of the entire screen, with resizing and compression options.
Capture_Video
Syntax:
lua
_Capture_Video(preferredQuality, preferredMaxDuration,
Var_to_get_OutputVideoFile, Function_to_Run)
Purpose: Records a video with the device camera and returns the file path in Var_to_get_OutputVideoFile.
Check_Image_Content
Syntax:
lua
_Check_Image_Content(ImageName)
Purpose: Returns the filename associated with an image object.
Check_Object_ID
Syntax:
lua
_Check_Object_ID(ObjectName)
Purpose: Returns the unique ID of an object.
Color_Picker
Syntax:
lua
_Color_Picker(preset_R, preset_G, preset_B, preset_Alpha,
function_to_receive_selection)
Purpose: Displays a color picker dialog and sends the selected color (r, g, b, a) to the specified function.
Color_Sample
Syntax:
lua
_Color_Sample(x, y, onComplete)
Purpose: Gets the color of a pixel at screen coordinates (x, y). Sends color information (r, g, b, a) to the onComplete function.
Color_Sample_[RGBA]
Syntax:
lua
_Color_Sample_R(), _Color_Sample_G(), etc...
Purpose: Shortcuts to getting individual color components (Red, Green, Blue, Alpha) from a screen pixel.
Copy_Picture_Display_To_Display
Syntax:
lua
_Copy_Picture_Display_To_Display(imgName1, imgName2)
Purpose: Copies the image from one display object to another.
Copy_Picture_FileName_To_Display
Syntax:
lua
_Copy_Picture_FileName_To_Display(filename, imgName)
Purpose: Sets an image file to a display object.
Create_Animation
Syntax:
lua
_Create_Animation([parameters])
Purpose: Creates an animated object using a spritesheet (must be in the Resource folder).
Create_Arc
Syntax:
lua
Create_Arc(insert_on_scene, ObjectName, x, y, width, height,
start_degrees, end_degrees, line_color[RGBA], line_width, Forced_a)
Purpose: Creates an arc with a prefix of 'arc_'.
Create_Arc_Filled
Syntax:
lua
_Create_Arc_Filled([parameters])
Purpose: Creates a filled arc (prefix 'arc_').
Create_Canvas
Syntax:
lua
_Create_Canvas(x, y, width, height, Forced_a)
Purpose: Creates a canvas for drawing. Shows up as "_Paint_Canvas".
Create_Chain
Syntax:
lua
_Create_Chain([parameters])
Purpose: Creates a chain of linked objects suitable for physics interactions.
Create_Circle
Syntax:
lua
_Create_Circle([parameters])
Purpose: Creates a circle object with the prefix 'img_'.
Create_Circle_At_Each_Pair_C
Syntax:
lua
_Create_Circle_At_Each_Pair_C([parameters])
Purpose: Creates multiple circles based on coordinates provided in Pairs_Data.
Create_Enclosure
Syntax:
lua
_Create_Enclosure([parameters])
Purpose: Creates four rectangular image objects (_top, _bottom, _left, _right) to form an enclosure.
Create_Grid
Syntax:
lua
_Create_Grid([parameters])
Purpose: Creates a grid with a prefix of 'grid_'.
Create_Line
Syntax:
lua
_Create_Line([parameters])
Purpose: Creates a line object with a prefix of 'line_'.
Create_Polygon
Syntax:
lua
_Create_Polygon([parameters])
Purpose: Creates a polygon image object with a prefix of 'img_'.
Important Note: Avoid using physics simulations on polygons without an image texture.
Create_Rectangle
Syntax:
lua
_Create_Rectangle(insert_on_scene, Rectangle_Name, x, y, width,
height, texture_Image, began_touch_function, moved_touch_function,
ended_touch_function, swipe_function, tap_function, Forced_a)
Purpose: Creates a rectangular image object (prefixed with 'img_').
Create_Rounded_Rectangle
Syntax:
lua
_Create_Rounded_Rectangle([same parameters as Create_Rectangle])
Purpose: Creates a rectangular image object with rounded corners (prefixed with 'img_').
Create_Spinner
Syntax:
lua
_Create_Spinner(insert_on_scene, Spinner_Name, x, y, width, height,
texture_Image, step_angle, time_milliseconds, began_touch_function,
moved_touch_function, ended_touch_function, swipe_function,
tap_function, Forced_a)
Purpose: Creates a spinnable image object (prefixed with 'img_').
Create_Stat_Graph
Syntax:
lua
_Create_Stat_Graph(GraphType, Is_3D, Graph_Name, Title, x, y, dx,
dy, Width, Height, Backcolor_R, Backcolor_G, Backcolor_B,
Stat_Information, Stat_Options, function_to_execute,
SSL_Lu_C_Server, Forced_a)
Purpose: Creates a statistical graph (pie charts, bar charts, etc.)
Display_Images_List
Syntax:
lua
_Display_Images_List()
Purpose: Lists all currently loaded images (names and count) to the console.
Frame_Animation
Syntax:
lua
_Frame_Animation(ImageName, frameIndex)
Purpose: Sets the current frame of an animation.
Get_Blend_Mode
Syntax:
lua
_Get_Blend_Mode(ImageName)
Purpose: Retrieves the blending mode property of an image.
Get_CanvasColor
Syntax:
lua
_Get_CanvasColor()
Purpose: Returns the current canvas background color (r, g, b, alpha).
Get_Content_Bounds
Syntax:
lua
_Get_Content_Bounds(ImageName)
Purpose: Returns the bounding rectangle of an image's content (xMin, yMin, xMax, yMax).
Get_Content_Center
Syntax:
lua
_Get_Content_Center(ImageName)
Purpose: Returns the center coordinates (xCenter, yCenter) of an image's content.
Get_Content_Height
Syntax:
lua
_Get_Content_Height(ImageName)
Purpose: Returns the height of an image's content.
Get_Content_To_Local
Syntax:
lua
_Get_Content_To_Local(ImageName, xContent, yContent)
Purpose: Retrieves the xContent and yContent properties.
Get_Content_Width
Syntax:
lua
_Get_Content_Width(ImageName)
Purpose: Returns the width of an image's content.
Get_Defined
Syntax:
lua
_Get_Defined(ImageName)
Purpose: Retrieves the '_defined' property.
Get_Detected_Content_Bounds
Syntax:
lua
_Get_Detected_Content_Bounds(ImageName, show_debug_lines)
Purpose: Returns the bounding rectangle of an image's detected content (for physics bodies).
Get_Detected_Content_Center
Syntax:
lua
_Get_Detected_Content_Center(ImageName, show_debug_lines)
Purpose: Returns the center coordinates of an image's detected content (for physics bodies).
Get_Image_Id
Syntax:
lua
Get_Image_Id(ImageName)
Purpose: Retrieves the unique ID of an image object.
Get_Image_Size
Syntax:
lua
_Get_Image_Size(image_FileName)
Purpose: Returns the width and height of an image file.
Get_Is_Hit_Test_Masked
Syntax:
lua
_Get_Is_Hit_Test_Masked(ImageName)
Purpose: Retrieves the 'isHitTestMasked' property.
Get_Is_Hit_Testable
Syntax:
lua
_Get_Is_Hit_Testable(ImageName)
Purpose: Retrieves the 'isHitTestable' property.
Get_Joint
Syntax:
lua
_Get_Joint(Chain_Link)
Purpose: Retrieves information about joints in a chain created with Create_Chain.
Get_Last_Change
Syntax:
lua
_Get_Last_Change(ImageName)
Purpose: Retrieves the '_lastChange' property.
Get_Local_To_Content
Syntax:
lua
_Get_Local_To_Content(ImageName, x, y)
Purpose: Retrieves the 'x' and 'y' localToContent properties.
Get_Mask_Scale_X/Y
Syntax:
lua
_Get_Mask_Scale_X(ImageName)
,
lua
_Get_Mask_Scale_Y(ImageName)
Purpose: Retrieve the 'maskScaleX' and 'maskScaleY' properties, respectively.
Get_Mask_X/Y
Syntax:
lua
_Get_Mask_X(ImageName)
,
lua
_Get_Mask_Y(ImageName)
Purpose: Retrieve the 'maskX' and 'maskY' properties, respectively.
Get_PaintColor
Syntax:
lua
_Get_PaintColor()
Purpose: Returns the current canvas painting color (r, g, b, alpha).
Get_Properties
Syntax:
lua
_Get_Properties(ImageName)
Purpose: Retrieves the '_properties' property.
Get_Ray_Cast_Hit_Fraction/Normal_XY/Object_Name/Position_XY
Syntax:
lua
_Get_Ray_Cast_Hit_Fraction(n)
,
etc.
Purpose: Retrieve various raycast hit information. (See Lu-C documentation for details on these functions)
Get_Ray_Cast_Hits
Syntax:
lua
_Get_Ray_Cast_Hits()
Purpose: Retrieves the number of raycast hits.
Get_Sample_Points_Around_Detected_Content
Syntax:
lua
_Get_Sample_Points_Around_Detected_Content(ImageName, max_nPoints,
min_DistanceBetweenPoints, show_debug_lines)
Purpose: Gets sample points around an image's detected content (for physics bodies).
Get_Sequence
Syntax:
lua
_Get_Sequence(ImageName)
Purpose: Retrieves the current animation sequence for an animated image.
Image_Composite
Syntax:
lua
_Image_Composite(ImageName, Composite_ImageName, Effect, Options)
Purpose: Applies a composite effect to an existing image by overlaying a secondary image.
Image_Composite_Options
Syntax:
lua
_Image_Composite_Options(ImageName, Options)
Purpose: Modifies an existing composite effect on an image.
Image_Filter
Syntax:
lua
_Image_Filter(ImageName, Effect, Options)
Purpose: Applies a filter or generator effect to an image.
Image_Filter_Options
Syntax:
lua
_Image_Filter_Options(ImageName, Options)
Purpose: Modifies an existing filter or generator effect on an image.
Inside_Polygon
Syntax:
lua
_Inside_Polygon(Polygon_name, X, Y)
Purpose: Returns true if the point (X, Y) is located within an existing Static Polygon.
Line_RGB_Alpha
Syntax:
lua
_Line_RGB_Alpha(ObjectName, R, G, B, Alpha)
Purpose: Sets the color and opacity (alpha) of a line object.
Line_Width
Syntax:
lua
_Line_Width(ObjectName, line_width)
Purpose: Sets the thickness of a line object.
Line_XY_1
Syntax:
lua
_Line_XY_1(ObjectName, x1, y1)
Purpose: Sets the starting point (x1, y1) of a line object.
Line_XY_1_XY_2
Syntax:
lua
_Line_XY_1_XY_2(ObjectName, x1, y1, x2, y2)
Purpose: Defines a line object by its starting point (x1, y1) and ending point (x2, y2).
Line_XY_2
Syntax:
lua
_Line_XY_2(ObjectName, x2, y2)
Purpose: Sets the ending point (x2, y2) of a line object (assuming a previous Line_XY_1 command).
Load_Video
Syntax:
lua
_Load_Video(VideoObject, Full_Path_VideoFile)
Purpose: Loads a video file into a Video object, resizing if necessary.
Mask
Syntax:
lua
_Mask(ImageName, mask)
Purpose: Applies a mask to an image object. The mask must be created with .newMask.
Mask_Remove
Syntax:
lua
_Mask_Remove(ImageName)
Purpose: Removes the mask from an image object.
Mask_Scale_X
Syntax:
lua
_Mask_Scale_X(ImageName, maskScaleX)
Purpose: Sets the horizontal scaling factor of an image's mask.
Mask_Scale_Y
Syntax:
lua
_Mask_Scale_Y(ImageName, maskScaleY)
Purpose: Sets the vertical scaling factor of an image's mask.
Mask_X
Syntax:
lua
_Mask_X(ImageName, maskX)
Purpose: Sets the horizontal position of an image's mask.
Mask_XY
Syntax:
lua
_Mask_XY(ImageName, maskX, maskY)
Purpose: Sets the horizontal (maskX) and vertical (maskY) position of an image's mask.
Mask_Y
Syntax:
lua
_Mask_Y(ImageName, maskY)
Purpose: Sets the vertical position of an image's mask
New_Line_Points
Syntax:
lua
_New_Line_Points(n, coord_X, coord_Y, points)
Purpose: Creates a polygon with index 'n'. Returns true if points are valid (numeric), false otherwise.
Pause_Animation
Syntax:
lua
_Pause_Animation(ImageName)
Purpose: Pauses the animation of an image object.
Play_Animation
Syntax:
lua
_Play_Animation(ImageName)
Purpose: Resumes the animation of an image object.
Perspective
Syntax:
lua
_Perspective(ImageName, x1, y1, x2, y2, x3, y3, x4, y4)
Purpose: Simulates 3D by applying a perspective effect to an existing object.
Ray_Cast
Syntax:
lua
_Ray_Cast(fromX, fromY, toX, toY, behavior)
Purpose: Finds objects colliding with a line and returns collision points along the line. Positions returned in content space, normals in local space.
Reflect_Ray
Syntax:
lua
_Reflect_Ray(fromX, fromY, toX, toY)
Purpose: Reflects a vector (as returned by physics.rayCast()) and calculates the direction of the reflection. The reflected vector has a magnitude of 1.
Remove_Canvas
Syntax:
lua
_Remove_Canvas()
Purpose: Removes the current painting canvas.
Resize_Picture
Syntax:
lua
_Resize_Picture("FileName.jpg", Image_Width, Image_Height,
Compression_Level)
Purpose: Resizes and compresses an image (JPG only).
Resize_Picture_Max_Width_Height
Syntax:
lua
_Resize_Picture_Max_Width_Height("FileName.jpg", maxwidth,
maxheight, Compression_Level)
Purpose: Resizes an image to a maximum width and height while preserving the aspect ratio.
Resize_Picture_Tool
Syntax:
lua
_Resize_Picture_Tool(Top_Title, Top_Subtitle, Target_Width,
Target_Height, Upload_Folder, Temp_FileName, Target_FileName,
Return_a, Function_to_Execute_When_Completed,
Function_to_Execute_When_Cancelled)
Purpose: Provides an interactive tool to resize an image.
Resize_Picture_Tool_480_1040
Syntax:
lua
_Resize_Picture_Tool_480_1040(...)
Purpose: A version of Resize_Picture_Tool specifically designed for resolutions of 480x1040.
Select_Photo
Syntax:
lua
_Select_Photo("FileName.jpg", Image_Width, Image_Height,
Preserve_Aspect, Compression, Function_to_Run)
Purpose: Selects a picture from the photo gallery, resizes it, and compresses it (JPG only).
Select_Video
Syntax:
lua
_Select_Video(Full_Path_VideoFile, Function_to_Run)
Purpose: Selects a video from the video gallery and returns its full path.
Sequence_Animation
Syntax:
lua
_Sequence_Animation(ImageName, sequenceName, StartonLoad)
Purpose: Loads an animation sequence by name. Supports wildcards.
Set_Hit_Test_Masked
Syntax:
lua
_Set_Hit_Test_Masked(ImageName, isHitTestMasked)
Purpose: Sets the 'isHitTestMasked' property of an image object.
Set_Hit_Testable
Syntax:
lua
_Set_Hit_Testable(ImageName, isHitTestable)
Purpose: Sets the 'isHitTestable' property of an image object, controlling the object's responsiveness to hit events.
Texture
Syntax:
lua
_Texture(ImageName, textureImage)
Purpose: Applies a texture to an image object.
Trajectory_Object
Syntax:
lua
_Trajectory_Object(trajectory_name, object_name, trajectory_points,
speed_msecs_per_segment, initial_delay,
function_to_run_when_completed)
Purpose: Moves an object along a specified trajectory.
Wave_Image
Syntax:
lua
_Wave_Image(image_name, Num_Slices, Max_Amplitude, Period_Time,
Num_Waves, Max_Alpha, Min_Alpha, Time_To_Remove,
Function_After_Removed, Time_To_Fade_In,
Function_To_Run_After_Complete_Fade_In, Time_To_Fade_Out,
Function_To_Run_After_Complete_Fade_Out)
Purpose: Applies a waving (flag-like) effect to an image, centered on the screen.