Lines
From TargetWiki
Lines is a type of widget. All widget functions can also be called on a lines widget. Since a lines widget is a Lua object, calls should use the object:function() syntax. Also, all Lua object functions can also be called on lines.
A Lines widget is a collection of lines, circles, and other shapes.
[edit]
Functions
- offset()
- Returns the current offset as two numbers: <x> and <y>.
- setoffset( <x>, <y> )
- Sets the origin for all of the lines and shapes contained in the widget.
- clip()
- Returns the clip state.
- setclip( <boolean> )
- Sets the clip state. If true, the contents of the group won't be drawn outside the boundary of the clip.
- color()
- Return the line color as four numbers: red, green, blue, and alpha.
- setcolor( <red>, <green>, <blue>, <alpha> )
- Set the color for the lines. Valid values for the parameters are 0 to 255.
- width()
- Returns the width of the lines in pixels.
- setwidth( <integer> )
- Sets the width of the lines in pixels.
- line( <x1>, <y1>, <x2>, <y2> )
- Adds a line connecting (<x1>, <y1>) to (<x2>, <y2>).
- circle( <x>, <y>, <radius>, <numpoints> )
- Adds a circle specified by the center point (<x>, <y>), the radius and the number of line segments to draw to make up the circle.
- rect( <x1>, <y1>, <x2>, <y2> )
- Adds a rectangle defined by the top-left point: (<x1>, <y1>) and the bottom-right pint:(<x2>, <y2>).
- clear()
- Clear all of the lines and shapes in the widget.
Categories: Lua | GUI | Widgets
