Elements - Line
| User Guide Contents | Buy Orthello Elements | C# Class Reference | Download 100% Free Edition
The OTLineElement
The OTLineElement is an orthello element that lets you create all kinds of lines using orthello sprites. A line can have one or more unerlying sprites that will be stretched between a start and end point. Using a OTFilledSprite with a scrolling value you could even create a scrollable line, as seen in the demo.
In the editor the pivot point of the line is always on line.start and you will have to set line.width and line.height to adjust the line. the underlying sprites will be automaticly adjusted.
When changing the line by code, the regular approach would be to use line.start and line.end to set the start en end point.
!IMPORTANT To be functional, the OTLineElement needs to have a localscale of (1,1,1). If you would like to alter the appearence of the line, use the sprite childs within the line element.
!IMPORTANT Also ... the OTLineElement must be located in your scene's root or in a parent located at 0,0,0 and has a 1,1,1 world scale ( so towards the root of your scene ).
The OTLineElement properties
The OTLineElement has the following properties :
- depth : int
The z-value of this element relative to the parent - width : float
The width (thickness) of the line. - height : float
The height (length) of the line . - color : Color
Color tint of the line. Setting this will automaticly set the sprite.colorTint value of all underlying sprites.
Only active when useTint == true. - useTint : bool
Color value will be used when this is checked. - alpha : float
alpha (transparency) value of the line. Setting this will automaticly set the sprite.alpha value of all underlying sprites. - start : Vector2
Start position of the line. - end : Vector2
End position of the line.
Also useful..
OTLineElement line = OTElement.Line(lineName);
to quickly find a line in your scene.
(OTLineElement) line.visible = true/false;
to show and hide lines in your scene.
OTObject line.child(name);
to quickly get a underlying child sprite.
This function will match the start of the name.
| Previous : OTButtonElement | Next : OTMenuCircleElement |