没有合适的资源?快使用搜索试试~ 我知道了~
Vectrosity5 Reference Guide
需积分: 0 0 下载量 56 浏览量
2019-02-23
18:09:05
上传
评论
收藏 237KB PDF 举报
温馨提示
试读
32页
新版的Vectrosity插件帮助文档,Vectrosity可用于Unity3D开发时实时绘制二三级图形。
资源推荐
资源详情
资源评论
VectorLine constructor and properties
........................VectorLine (constructor)! 2
.....................................................active! 3
.........................alignOddWidthToPixels! 3
.............................................capLength! 3
..................................................collider! 3
......................................................color! 3
.................................continuousTexture! 4
............................................drawDepth! 4
................................................drawEnd! 4
..............................................drawStart! 4
.......................................drawTransform! 4
..................................................endCap! 5
..................................endPointsUpdate! 5
.......................................................is2D! 5
......................................................joins! 5
......................................................layer! 5
.................................................lineType! 5
...............................................lineWidth! 6
..................................................material! 6
....................................................matrix! 6
.................................maxWeldDistance! 6
.....................................................name! 6
.....................................physicsMaterial! 6
..................................................points2! 7
..................................................points3! 7
.........................................rectTransform! 7
.........................................smoothColor! 7
.........................................smoothWidth! 7
...................................................texture! 8
..........................................textureOffset! 8
..........................................textureScale! 8
....................................................trigger! 8
..............................useViewportCoords! 8
VectorLine functions
..........................................AddNormals! 9
.........................................AddTangents! 9
......................................................Draw! 9
..................................................Draw3D! 9
........................................Draw3DAuto! 10
..............................................GetColor! 10
...........................................GetLength! 10
..............................................GetPoint! 10
..........................................GetPoint01! 11
..........................................GetPoint3D! 11
......................................GetPoint3D01! 11
...........................GetSegmentNumber! 12
.............................................GetWidth! 12
..............................................MakeArc! 13
..........................................MakeCircle! 14
..........................................MakeCube! 14
..........................................MakeCurve! 15
.........................................MakeEllipse! 16
............................................MakeRect! 17
.............................MakeRoundedRect! 18
.........................................MakeSpline! 19
.............................................MakeText! 20
...................................MakeWireframe! 20
..................................................Resize! 20
..............................................Selected! 21
..........................................SetCanvas! 22
..............................................SetColor! 22
............................................SetColors! 23
.......................................SetDistances! 23
.................................SetEndCapColor! 23
..............................................SetMask! 23
..............................................SetWidth! 24
...........................................SetWidths! 24
...........................StopDrawing3DAuto! 24
VectorLine static functions and properties
.............................BytesToVector2List! 25
.............................BytesToVector3List! 25
.................................................canvas! 25
................................................Destroy! 25
..................................RemoveEndCap! 26
......................................SetCamera3D! 26
..............................SetCanvasCamera! 27
..........................................SetEndCap! 28
................................................SetLine! 29
............................................SetLine3D! 29
.................................................SetRay! 30
............................................SetRay3D! 30
................................................Version! 30
VectorManager functions and properties
............................GetBrightnessValue! 31
........................................ObjectSetup! 31
...................SetBrightnessParameters! 32
..........................................useDraw3D! 32
INDEX
!
VectorLine (name : String,
points : List<Vector2> or List<Vector3>,
texture : Texture = null,
lineWidth : float,
lineType : LineType = LineType.Discrete,
joins : Joins = Joins.None) : VectorLine
Constructs a VectorLine object with the supplied parameters. The texture and parameters after lineWidth are
optional and have the default values indicated, though if you supply joins, you must also supply lineType.
name is a string that’s used to name the GameObject and mesh created for the vector line. The name is also
used to identify bounds meshes made with VectorManager.ObjectSetup.
points is a Vector2 or Vector3 generic List, where each entry is a point in the line using screen-space
coordinates (in the case of a Vector2 list), or world units (in the case of a Vector3 list). The list may be empty
initially, with points added later. If the list is declared with an initial capacity (i.e., “new List<Vector2>(50)”), the
list will have the capacity filled with Vector2.zero or Vector3.zero as appropriate, so the list.Count will equal
the list.Capacity.
The line is drawn using the supplied texture. If the texture is omitted, the line is drawn as a solid color.
The lineWidth is the width in pixels. This is a float, so values like 1.5 are acceptable.
lineType is LineType.Discrete, LineType.Continuous, or LineType.Points. For discrete lines, each line segment
is made from two consecutive entries in the Vector2 or Vector3 list. For continuous lines, the line starts at
entry 0, and each segment is continuously connected to the next point until the end is reached. For points,
each entry in the points list is a separate point.
joins is one of Joins.None, Joins.Fill, or Joins.Weld. Joins.None is the default and draws line segments as
standard rectangles, primarily used with thin lines. Joins.Fill will fill in the gaps seen where lines join at an
angle, primarily used with thick lines with no texture. This only works if using LineType.Continuous.
Joins.Weld is similar, except vertices of sequential line segments are welded, which makes it more
appropriate for textured lines. Joins.Weld works with LineType.Discrete, but only for sequential line
segments. When using LineType.Points, only Joins.None can be used.
A note about function parameters
All parameters where only the type is listed must be supplied. All parameters where a default value is listed
are optional, and will use the default value if they are omitted.
VECTORLINE CONSTRUCTOR
" 2
active
var active : boolean = true;
Sets a VectorLine active or inactive. Inactive VectorLines won’t be rendered, and if an inactive VectorLine is
used with functions like Draw, the function will return immediately without doing anything.
alignOddWidthToPixels
var alignOddWidthToPixels = false;
If true, offsets a line’s RectTransform by (0.5, 0.5). Line segments drawn with odd line widths (1, 3, 5, etc.) are
positioned “between” pixels when they are straight horizontal or vertical, which can result in a blurred
appearance if FSAA is used, most noticeable with a 1-pixel width. Setting alignOddWidthToPixels to true will
align odd line widths to the pixel grid, in order to prevent FSAA blurring.
capLength
var capLength : float = 0;
Sets the line’s capLength to the supplied float. This is the number of pixels added to either end of the line (0
by default). Typically used for filling in gaps seen in thick lines when they are joined at right angles, such as
when drawing selection boxes or other rectangles.
collider
var collider : boolean = false;
If true, the line will generate a matching 2D collider when it’s drawn. The collider is updated if the line is
changed and re-drawn. Setting this to false will disable the collider, if one existed previously. The collider
works with lines made with Vector3 points as well as lines made with Vector2 points. Since 2D colliders are
on the X/Y plane only, the camera should be facing along the Z axis, with no rotation, in order for the collider
to correctly match the line.
color
var color : Color = Color.white;
The color of the VectorLine. When set, all line segments are colored with the supplied value. See also
VectorLine.SetColor and VectorLine.SetColors. Note that VectorLine.color will retain its original value even if
all line segments have been set to different colors when using SetColor or SetColors. The default value is
Color.white when a VectorLine is first constructed.
VECTORLINE PROPERTIES
" 3
continuousTexture
var continuousTexture : boolean = false;
If this is set to true, then any texture used for the line will be stretched evenly along the entire length of the
line, regardless of how many points make up the line or how far apart the points are spaced. If set to false
(which is the default), then the texture is repeated once for every line segment.
drawDepth
var drawDepth : int;
The sibling index of the VectorLine as drawn in the vector canvas. Lines with higher drawDepth values are
drawn on top of lines with lower drawDepth values. Each line has a unique drawDepth value, which is
assigned in order as more VectorLines are created, so changing the drawDepth value for one line may
change the values of others. The minimum is 0, and the maximum depends on the number of VectorLines
parented to an object (which is the vector canvas by default, but can be changed using
VectorLine.rectTransform). VectorLine.drawDepth can’t be used on lines drawn with Draw3D.
drawEnd
var drawEnd : int;
Specifies the index in the VectorLine’s points list at which line drawing should end. Any later points will be
erased when VectorLine.Draw is called. (Erased on-screen, not from the points list.) When used with a
discrete line, drawEnd should be an odd number, although it can be 0. If it’s even (aside from 0), it will be
incremented to the next highest integer. It’s clamped between 0 and points.Count-1. This can be used with
drawStart to specify a range of points to draw in a line.
drawStart
var drawStart : int;
Specifies the index in the VectorLine’s points list at which line drawing should start. Any earlier points will be
erased when VectorLine.Draw is called. (Erased on-screen, not from the points list.) When used with a
discrete line, drawStart should be an even number. If it’s odd, it will be incremented to the next highest
integer. It’s clamped between 0 and points2.Length-1 or points3.Length-1.
drawTransform
var drawTransform : Transform;
When drawn, the line is modified by the supplied transform. For example, if the transform is located at
Vector3(5.0, 2.0, 0.0), then the line is offset by 5 units on the X axis and 2 units on the Y axis. A transform
that’s rotated will cause the line to be rotated by the same amount, and a transform that’s scaled will cause
the line to be scaled by the same amount, though it will always be drawn with the correct thickness. If the
transform is modified, the line will need to be re-drawn in order to reflect the changes.
VECTORLINE PROPERTIES
" 4
endCap
var endCap : String;
Specifies an end cap for the VectorLine, using a name as defined in SetEndCap. The name is case-sensitive,
and SetEndCap must have been called before an end cap can be added. If null or "" is used for the string,
then the end cap is removed from the VectorLine.
endPointsUpdate
var endPointsUpdate : int = 0;
The number of points from the end of the VectorLine that are actually updated when Draw or Draw3D is
called. The other points will be untouched. This is intended to be used as an optimization for cases where
most of the line stays the same and does not need to be recomputed when re-drawn.
Note that when used with discrete lines, endPointsUpdate always uses even numbers. If odd numbers are
supplied, they will be rounded up to the next even number, so 1 becomes 2 and so on.
is2D
var is2D : boolean;
Returns true if the VectorLine was made with Vector2 points, false otherwise.
joins
var joins : Joins;
Returns the Joins type that was used when the line was created, and can be used to change the Joins type
at any time. Does nothing if Joins.Fill is used with a discrete line. Lines made with LineType.Points can only
use Joins.None.
layer
var layer : Layer;
The GameObject layer of the line, for use with culling masks. By default this is the UI layer.
lineType
var lineType : LineType;
Whether a line is LineType.Continuous, LineType.Discrete, or LineType.Points. Changing the line type
removes any individual line segment colors or widths (such as those set by SetColors or SetWidths), since
different line types have different numbers of segments.
VECTORLINE PROPERTIES
" 5
剩余31页未读,继续阅读
资源评论
杜若非
- 粉丝: 4
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功