[伊利丹·怒风] Unity3D 绘制矩形(DrawRect)及可视化调试
来源:互联网 发布:淘宝美工用色 编辑:程序博客网 时间:2024/05/18 03:59
背景
由于要做Native2D的A* 算法寻路,所以必须进行Scene的网格划分,而进行了网格划分需要进行可视化的调试,需求就是这个逻辑。具体是实现如下效果,这里绿色的区域就是角色不能进入的区域(或者是走不进去的地方,大家玩网游都遇到过吧)
按照这个思路基本是两个问题,1、如何实现可视化调试;2、Unity如何绘制网格
实现
1、Unity如何实现可视化调试
本文的实现完全围绕需求来走,就是需要在2D环境中实现可配置网格显示。先按照背景中的思路学习轮子,百度下基本下篇大牛的总结比较好,比较全
【风宇冲】图形化调试 http://blog.sina.com.cn/s/blog_471132920101gxzf.html
这里可耻的转载一下
Unity中图形化调试主要4种
Debug.Draw
Gizmos.Draw
Graphic.DrawMesh
GL
只需在Scene窗口显示的调试图像
一直显示的 OnDrawGizmos + Gizmos.Draw
选中显示的 OnDrawGizmosSelected + Gizmos.Draw
脚本控制的 Update + Debug.Draw
需要在实际设备屏幕显示的调试图像
Update+Graphic.DrawMesh
OnRenderObject+GL
Graphic.DrawMesh和Debug.Draw 调用一致,都是在Update系里
Graphic.DrawMesh和GL 显示类似,都在各个窗口显示,并且可以设置材质。
这里根据我自己的要求,只要能在Editor模式下的Scene和Game中显示就可以了。
2、Unity如何绘制网格
在1中 大牛已经给出了方向和简单的列子,下面就是自己实现了,刚开始比较懒,还是想一步到位,直接找到一个类似DrawRect的函数直接在中绘制矩形,结果果然失败,找了很久也没有这样的函数和或者别人分享的。下面分享下自己搜集的方案
A、使用Mesh网格进行绘制
说实话我觉得这种方法对于我的需求是没什么实际作用的,而且看起来有些虚,最主要的问题是网格不可控制。
public
class
Grid : MonoBehaviour
{
[ SerializeField ]
private
Transform _transform;
[ SerializeField ]
private
Material _material;
[ SerializeField ]
private
Vector2 _gridSize;
[ SerializeField ]
private
int
_rows;
[ SerializeField ]
private
int
_columns;
void
Start()
{
UpdateGrid();
}
public
void
UpdateGrid()
{
_transform.localScale =
new
Vector3( _gridSize.x, _gridSize.y, 1.0f );
_material.SetTextureScale( \"_MainTex\",
new
Vector2( _columns, _rows ) );
}
}
B、第二个方法就是使用GL
这种方法其实还是比较底层的,竟然还用到了传说中的Shader,用于拔高也是不错的列子,而且看起来也不虚,但最主要的问题是网格不可控制。再说我也觉得用GL有点杀鸡用牛刀的感觉。
using
UnityEngine;
using
System.Collections;
//http://answers.unity3d.com/questions/482128/draw-grid-lines-in-game-view.html?page=2&pageSize=5&sort=votes
public
class
ShowGrid : MonoBehaviour {
public
bool
showMain =
true
;
public
bool
showSub =
false
;
public
float
gridSizeX;
public
float
gridSizeY;
public
float
smallStep;
public
float
largeStep;
public
float
startX;
public
float
startY;
public
float
offsetY;
public
float
offsetX;
private
Material lineMaterial;
private
Color mainColor =
new
Color(0f, 1f, 0f, 1f);
private
Color subColor =
new
Color(0f, 0.5f, 0f, 1f);
void
Start()
{
gridSizeX *= smallStep;
gridSizeY *= smallStep;
}
void
Update()
{
}
void
CreateLineMaterial()
{
if
(!lineMaterial)
{
lineMaterial =
new
Material(\
"Shader \\"
Lines/Colored Blended\\" {\" +
\"SubShader { Pass { \" +
\" Blend SrcAlpha OneMinusSrcAlpha \" +
\" ZWrite Off Cull Off Fog { Mode Off } \" +
\" BindChannels {\" +
\
" Bind \\"
vertex\\
", vertex Bind \\"
color\\", color }\" +
\"} } }\");
lineMaterial.hideFlags = HideFlags.HideAndDontSave;
lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
}
}
void
OnRenderObject()
{
CreateLineMaterial();
// set the current material
lineMaterial.SetPass(0);
GL.Begin(GL.LINES);
if
(showSub)
{
GL.Color(subColor);
//Layers
for
(
float
j = 0; j <= gridSizeY; j += smallStep)
{
//X axis lines
GL.Vertex3(startX + offsetX, j + offsetY, 0);
GL.Vertex3(gridSizeX + offsetX, j + offsetY, 0);
}
//Y axis lines
for
(
float
k = 0; k <= gridSizeX; k += smallStep)
{
GL.Vertex3(startX + k + offsetX, startY + offsetY, 0);
GL.Vertex3(startX + k + offsetX, gridSizeY + offsetY, 0);
}
}
if
(showMain)
{
GL.Color(mainColor);
//Layers
for
(
float
j = 0; j <= gridSizeY; j += largeStep)
{
//X axis lines
GL.Vertex3(startX + offsetX, j + offsetY, 0);
GL.Vertex3(gridSizeX + offsetX, j + offsetY, 0);
}
//Y axis lines
for
(
float
k = 0; k <= gridSizeX; k += largeStep)
{
GL.Vertex3(startX + k + offsetX, startY + offsetY, 0);
GL.Vertex3(startX + k + offsetX, gridSizeY + offsetY, 0);
}
}
GL.End();
}
}
C、第三个方法Gizmos.Draw
这也是我最终使用的方法,实现效果如下所示,其实Gizmos的功能很强大,可以绘制Mesh和Cude,在3D调试中用处不能小视。
这里主要遇到的问题是Gizmos没有提供DrawRect函数需要自己实现,这里其实本身没有什么技术难度,因为已经提供了DrawLine函数。自己比较懒,本来想看是否有现成的直接剽窃下,后来Seach未果,只能自己实现了,下面是实现函数,同时提供DrawPath和DrawLine函数这里是从itween里提取出来的
/// <summary>
/// When called from an OnDrawGizmos() function it will draw a curved path through the provided array of Vector3s.
/// </summary>
/// <param name="\"path\"">
/// A <see cref="\"Vector3s[]\"/">
///
/// <param name="\"color\"">
/// A <see cref="\"Color\"/">
///
public
static
void
DrawPath(Vector3[] path, Color color)
{
if
(path.Length > 0)
{
DrawPathHelper(path, color, \"gizmos\");
}
}
/// <summary>
/// When called from an OnDrawGizmos() function it will draw a line through the provided array of Vector3s.
/// </summary>
/// <param name="\"line\"">
/// A <see cref="\"Vector3s[]\"/">
///
/// <param name="\"color\"">
/// A <see cref="\"Color\"/">
///
public
static
void
DrawLine(Vector3[] line, Color color)
{
if
(line!=
null
&& line.Length > 0)
{
DrawLineHelper(line, color, \"gizmos\");
}
}
public
static
void
DrawRect( Rect rect, Color color)
{
Vector3[] line =
new
Vector3[5];
line[0] =
new
Vector3(rect.x,rect.y,0);
line[1] =
new
Vector3(rect.x+rect.width, rect.y, 0);
line[2] =
new
Vector3(rect.x + rect.width, rect.y + rect.height, 0);
line[3] =
new
Vector3(rect.x, rect.y + rect.height, 0);
line[4] =
new
Vector3(rect.x, rect.y, 0);
if
(line !=
null
&& line.Length > 0)
{
DrawLineHelper(line, color, \"gizmos\");
}
}
private
static
void
DrawLineHelper(Vector3[] line, Color color,
string
method)
{
Gizmos.color = color;
for
(
int
i = 0; i < line.Length - 1; i++)
{
if
(method == \"gizmos\")
{
Gizmos.DrawLine(line[i], line[i + 1]); ;
}
else
if
(method == \"handles\")
{
Debug.LogError(\"iTween Error: Drawing a line with Handles
is
temporarily disabled because of compatability issues with Unity 2.6!\");
//UnityEditor.Handles.DrawLine(line[i], line[i+1]);
}
}
}
private
static
void
DrawPathHelper(Vector3[] path, Color color,
string
method)
{
Vector3[] vector3s = PathControlPointGenerator(path);
//Line Draw:
Vector3 prevPt = Interp(vector3s, 0);
Gizmos.color = color;
int
SmoothAmount = path.Length * 20;
for
(
int
i = 1; i <= SmoothAmount; i++)
{
float
pm = (
float
)i / SmoothAmount;
Vector3 currPt = Interp(vector3s, pm);
if
(method == \"gizmos\")
{
Gizmos.DrawLine(currPt, prevPt);
}
else
if
(method == \"handles\")
{
Debug.LogError(\"iTween Error: Drawing a path with Handles
is
temporarily disabled because of compatability issues with Unity 2.6!\");
//UnityEditor.Handles.DrawLine(currPt, prevPt);
}
prevPt = currPt;
}
}
/// <summary>
/// 三点计算抛物线.
/// </summary>
/// <returns>组成抛物线的点.</returns>
/// <param name="\"path\"">确定抛物线的三个点或者更多的点的数组.
public
static
List<vector3> DrawPathHelper(Vector3[] path)
{
List<vector3> array =
new
List<vector3>(177);
Vector3[] vector3s = PathControlPointGenerator(path);
//Line Draw:
Vector3 prevPt = Interp(vector3s, 0);
int
SmoothAmount = path.Length * 20;
for
(
int
i = 1; i <= SmoothAmount; i++)
{
float
pm = (
float
)i / SmoothAmount;
Vector3 currPt = Interp(vector3s, pm);
array.Add(currPt);
prevPt = currPt;
}
return
array;
}
private
static
Vector3[] PathControlPointGenerator(Vector3[] path)
{
Vector3[] suppliedPath;
Vector3[] vector3s;
//create and store path points:
suppliedPath = path;
//populate calculate path;
int
offset = 2;
vector3s =
new
Vector3[suppliedPath.Length + offset];
System.Array.Copy(suppliedPath, 0, vector3s, 1, suppliedPath.Length);
//populate start and end control points:
//vector3s[0] = vector3s[1] - vector3s[2];
vector3s[0] = vector3s[1] + (vector3s[1] - vector3s[2]);
vector3s[vector3s.Length - 1] = vector3s[vector3s.Length - 2] + (vector3s[vector3s.Length - 2] - vector3s[vector3s.Length - 3]);
//is this a closed, continuous loop? yes? well then so let's make a continuous Catmull-Rom spline!
if
(vector3s[1] == vector3s[vector3s.Length - 2])
{
Vector3[] tmpLoopSpline =
new
Vector3[vector3s.Length];
System.Array.Copy(vector3s, tmpLoopSpline, vector3s.Length);
tmpLoopSpline[0] = tmpLoopSpline[tmpLoopSpline.Length - 3];
tmpLoopSpline[tmpLoopSpline.Length - 1] = tmpLoopSpline[2];
vector3s =
new
Vector3[tmpLoopSpline.Length];
System.Array.Copy(tmpLoopSpline, vector3s, tmpLoopSpline.Length);
}
return
(vector3s);
}
//andeeee from the Unity forum's steller Catmull-Rom class ( http://forum.unity3d.com/viewtopic.php?p=218400#218400 ):
private
static
Vector3 Interp(Vector3[] pts,
float
t)
{
int
numSections = pts.Length - 3;
int
currPt = Mathf.Min(Mathf.FloorToInt(t * (
float
)numSections), numSections - 1);
float
u = t * (
float
)numSections - (
float
)currPt;
Vector3 a = pts[currPt];
Vector3 b = pts[currPt + 1];
Vector3 c = pts[currPt + 2];
Vector3 d = pts[currPt + 3];
return
.5f * (
(-a + 3f * b - 3f * c + d) * (u * u * u)
+ (2f * a - 5f * b + 4f * c - d) * (u * u)
+ (-a + c) * u
+ 2f * b
);
}</vector3></vector3></vector3></see></see></see></see>
总结
程序员都懒总想找现成的,这次我提供个现成的给你哦。如果真对你有用别忘记给我投一票。
2016年度游戏蛮牛最受欢迎专栏作家评选,为他们投票! 别忘记我是恶魔猎手哦(wind2006)
背景
由于要做Native2D的A* 算法寻路,所以必须进行Scene的网格划分,而进行了网格划分需要进行可视化的调试,需求就是这个逻辑。具体是实现如下效果,这里绿色的区域就是角色不能进入的区域(或者是走不进去的地方,大家玩网游都遇到过吧)
按照这个思路基本是两个问题,1、如何实现可视化调试;2、Unity如何绘制网格
实现
1、Unity如何实现可视化调试
本文的实现完全围绕需求来走,就是需要在2D环境中实现可配置网格显示。先按照背景中的思路学习轮子,百度下基本下篇大牛的总结比较好,比较全
【风宇冲】图形化调试 http://blog.sina.com.cn/s/blog_471132920101gxzf.html
这里可耻的转载一下
Unity中图形化调试主要4种
Debug.Draw
Gizmos.Draw
Graphic.DrawMesh
GL
只需在Scene窗口显示的调试图像
一直显示的 OnDrawGizmos + Gizmos.Draw
选中显示的 OnDrawGizmosSelected + Gizmos.Draw
脚本控制的 Update + Debug.Draw
需要在实际设备屏幕显示的调试图像
Update+Graphic.DrawMesh
OnRenderObject+GL
Graphic.DrawMesh和Debug.Draw 调用一致,都是在Update系里
Graphic.DrawMesh和GL 显示类似,都在各个窗口显示,并且可以设置材质。
这里根据我自己的要求,只要能在Editor模式下的Scene和Game中显示就可以了。
2、Unity如何绘制网格
在1中 大牛已经给出了方向和简单的列子,下面就是自己实现了,刚开始比较懒,还是想一步到位,直接找到一个类似DrawRect的函数直接在中绘制矩形,结果果然失败,找了很久也没有这样的函数和或者别人分享的。下面分享下自己搜集的方案
A、使用Mesh网格进行绘制
说实话我觉得这种方法对于我的需求是没什么实际作用的,而且看起来有些虚,最主要的问题是网格不可控制。
public
class
Grid : MonoBehaviour
{
[ SerializeField ]
private
Transform _transform;
[ SerializeField ]
private
Material _material;
[ SerializeField ]
private
Vector2 _gridSize;
[ SerializeField ]
private
int
_rows;
[ SerializeField ]
private
int
_columns;
void
Start()
{
UpdateGrid();
}
public
void
UpdateGrid()
{
_transform.localScale =
new
Vector3( _gridSize.x, _gridSize.y, 1.0f );
_material.SetTextureScale( \"_MainTex\",
new
Vector2( _columns, _rows ) );
}
}
B、第二个方法就是使用GL
这种方法其实还是比较底层的,竟然还用到了传说中的Shader,用于拔高也是不错的列子,而且看起来也不虚,但最主要的问题是网格不可控制。再说我也觉得用GL有点杀鸡用牛刀的感觉。
using
UnityEngine;
using
System.Collections;
//http://answers.unity3d.com/questions/482128/draw-grid-lines-in-game-view.html?page=2&pageSize=5&sort=votes
public
class
ShowGrid : MonoBehaviour {
public
bool
showMain =
true
;
public
bool
showSub =
false
;
public
float
gridSizeX;
public
float
gridSizeY;
public
float
smallStep;
public
float
largeStep;
public
float
startX;
public
float
startY;
public
float
offsetY;
public
float
offsetX;
private
Material lineMaterial;
private
Color mainColor =
new
Color(0f, 1f, 0f, 1f);
private
Color subColor =
new
Color(0f, 0.5f, 0f, 1f);
void
Start()
{
gridSizeX *= smallStep;
gridSizeY *= smallStep;
}
void
Update()
{
}
void
CreateLineMaterial()
{
if
(!lineMaterial)
{
lineMaterial =
new
Material(\
"Shader \\"
Lines/Colored Blended\\" {\" +
\"SubShader { Pass { \" +
\" Blend SrcAlpha OneMinusSrcAlpha \" +
\" ZWrite Off Cull Off Fog { Mode Off } \" +
\" BindChannels {\" +
\
" Bind \\"
vertex\\
", vertex Bind \\"
color\\", color }\" +
\"} } }\");
lineMaterial.hideFlags = HideFlags.HideAndDontSave;
lineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
}
}
void
OnRenderObject()
{
CreateLineMaterial();
// set the current material
lineMaterial.SetPass(0);
GL.Begin(GL.LINES);
if
(showSub)
{
GL.Color(subColor);
//Layers
for
(
float
j = 0; j <= gridSizeY; j += smallStep)
{
//X axis lines
GL.Vertex3(startX + offsetX, j + offsetY, 0);
GL.Vertex3(gridSizeX + offsetX, j + offsetY, 0);
}
//Y axis lines
for
(
float
k = 0; k <= gridSizeX; k += smallStep)
{
GL.Vertex3(startX + k + offsetX, startY + offsetY, 0);
GL.Vertex3(startX + k + offsetX, gridSizeY + offsetY, 0);
}
}
if
(showMain)
{
GL.Color(mainColor);
//Layers
for
(
float
j = 0; j <= gridSizeY; j += largeStep)
{
//X axis lines
GL.Vertex3(startX + offsetX, j + offsetY, 0);
GL.Vertex3(gridSizeX + offsetX, j + offsetY, 0);
}
//Y axis lines
for
(
float
k = 0; k <= gridSizeX; k += largeStep)
{
GL.Vertex3(startX + k + offsetX, startY + offsetY, 0);
GL.Vertex3(startX + k + offsetX, gridSizeY + offsetY, 0);
}
}
GL.End();
}
}
C、第三个方法Gizmos.Draw
这也是我最终使用的方法,实现效果如下所示,其实Gizmos的功能很强大,可以绘制Mesh和Cude,在3D调试中用处不能小视。
这里主要遇到的问题是Gizmos没有提供DrawRect函数需要自己实现,这里其实本身没有什么技术难度,因为已经提供了DrawLine函数。自己比较懒,本来想看是否有现成的直接剽窃下,后来Seach未果,只能自己实现了,下面是实现函数,同时提供DrawPath和DrawLine函数这里是从itween里提取出来的
/// <summary>
/// When called from an OnDrawGizmos() function it will draw a curved path through the provided array of Vector3s.
/// </summary>
/// <param name="\"path\"">
/// A <see cref="\"Vector3s[]\"/">
///
/// <param name="\"color\"">
/// A <see cref="\"Color\"/">
///
public
static
void
DrawPath(Vector3[] path, Color color)
{
if
(path.Length > 0)
{
DrawPathHelper(path, color, \"gizmos\");
}
}
/// <summary>
/// When called from an OnDrawGizmos() function it will draw a line through the provided array of Vector3s.
/// </summary>
/// <param name="\"line\"">
/// A <see cref="\"Vector3s[]\"/">
///
/// <param name="\"color\"">
/// A <see cref="\"Color\"/">
///
public
static
void
DrawLine(Vector3[] line, Color color)
{
if
(line!=
null
&& line.Length > 0)
{
DrawLineHelper(line, color, \"gizmos\");
}
}
public
static
void
DrawRect( Rect rect, Color color)
{
Vector3[] line =
new
Vector3[5];
line[0] =
new
Vector3(rect.x,rect.y,0);
line[1] =
new
Vector3(rect.x+rect.width, rect.y, 0);
line[2] =
new
Vector3(rect.x + rect.width, rect.y + rect.height, 0);
line[3] =
new
Vector3(rect.x, rect.y + rect.height, 0);
line[4] =
new
Vector3(rect.x, rect.y, 0);
if
(line !=
null
&& line.Length > 0)
{
DrawLineHelper(line, color, \"gizmos\");
}
}
private
static
void
DrawLineHelper(Vector3[] line, Color color,
string
method)
{
Gizmos.color = color;
for
(
int
i = 0; i < line.Length - 1; i++)
{
if
(method == \"gizmos\")
{
Gizmos.DrawLine(line[i], line[i + 1]); ;
}
else
if
(method == \"handles\")
{
Debug.LogError(\"iTween Error: Drawing a line with Handles
is
temporarily disabled because of compatability issues with Unity 2.6!\");
//UnityEditor.Handles.DrawLine(line[i], line[i+1]);
}
}
}
private
static
void
DrawPathHelper(Vector3[] path, Color color,
string
method)
{
Vector3[] vector3s = PathControlPointGenerator(path);
//Line Draw:
Vector3 prevPt = Interp(vector3s, 0);
Gizmos.color = color;
int
SmoothAmount = path.Length * 20;
for
(
int
i = 1; i <= SmoothAmount; i++)
{
float
pm = (
float
)i / SmoothAmount;
Vector3 currPt = Interp(vector3s, pm);
if
(method == \"gizmos\")
{
Gizmos.DrawLine(currPt, prevPt);
}
else
if
(method == \"handles\")
{
Debug.LogError(\"iTween Error: Drawing a path with Handles
is
temporarily disabled because of compatability issues with Unity 2.6!\");
//UnityEditor.Handles.DrawLine(currPt, prevPt);
}
prevPt = currPt;
}
}
/// <summary>
/// 三点计算抛物线.
/// </summary>
/// <returns>组成抛物线的点.</returns>
/// <param name="\"path\"">确定抛物线的三个点或者更多的点的数组.
public
static
List<vector3> DrawPathHelper(Vector3[] path)
{
List<vector3> array =
new
List<vector3>(177);
Vector3[] vector3s = PathControlPointGenerator(path);
//Line Draw:
Vector3 prevPt = Interp(vector3s, 0);
int
SmoothAmount = path.Length * 20;
for
(
int
i = 1; i <= SmoothAmount; i++)
{
float
pm = (
float
)i / SmoothAmount;
Vector3 currPt = Interp(vector3s, pm);
array.Add(currPt);
prevPt = currPt;
}
return
array;
}
private
static
Vector3[] PathControlPointGenerator(Vector3[] path)
{
Vector3[] suppliedPath;
Vector3[] vector3s;
//create and store path points:
suppliedPath = path;
//populate calculate path;
int
offset = 2;
vector3s =
new
Vector3[suppliedPath.Length + offset];
System.Array.Copy(suppliedPath, 0, vector3s, 1, suppliedPath.Length);
//populate start and end control points:
//vector3s[0] = vector3s[1] - vector3s[2];
vector3s[0] = vector3s[1] + (vector3s[1] - vector3s[2]);
vector3s[vector3s.Length - 1] = vector3s[vector3s.Length - 2] + (vector3s[vector3s.Length - 2] - vector3s[vector3s.Length - 3]);
//is this a closed, continuous loop? yes? well then so let's make a continuous Catmull-Rom spline!
if
(vector3s[1] == vector3s[vector3s.Length - 2])
{
Vector3[] tmpLoopSpline =
new
Vector3[vector3s.Length];
System.Array.Copy(vector3s, tmpLoopSpline, vector3s.Length);
tmpLoopSpline[0] = tmpLoopSpline[tmpLoopSpline.Length - 3];
tmpLoopSpline[tmpLoopSpline.Length - 1] = tmpLoopSpline[2];
vector3s =
new
Vector3[tmpLoopSpline.Length];
System.Array.Copy(tmpLoopSpline, vector3s, tmpLoopSpline.Length);
}
return
(vector3s);
}
//andeeee from the Unity forum's steller Catmull-Rom class ( http://forum.unity3d.com/viewtopic.php?p=218400#218400 ):
private
static
Vector3 Interp(Vector3[] pts,
float
t)
{
int
numSections = pts.Length - 3;
int
currPt = Mathf.Min(Mathf.FloorToInt(t * (
float
)numSections), numSections - 1);
float
u = t * (
float
)numSections - (
float
)currPt;
Vector3 a = pts[currPt];
Vector3 b = pts[currPt + 1];
Vector3 c = pts[currPt + 2];
Vector3 d = pts[currPt + 3];
return
.5f * (
(-a + 3f * b - 3f * c + d) * (u * u * u)
+ (2f * a - 5f * b + 4f * c - d) * (u * u)
+ (-a + c) * u
+ 2f * b
);
}</vector3></vector3></vector3></see></see></see></see>
总结
程序员都懒总想找现成的,这次我提供个现成的给你哦。如果真对你有用别忘记给我投一票。
2016年度游戏蛮牛最受欢迎专栏作家评选,为他们投票! 别忘记我是恶魔猎手哦(wind2006)
- [伊利丹·怒风] Unity3D 绘制矩形(DrawRect)及可视化调试
- drawRect绘制图片、箭头、矩形(Demo)
- drawRect 绘制矩形 drawCircle 绘制圆形 drawOval 绘制椭圆 drawPath 绘制任意多边形 * drawLine 绘制直线 drawPoin 绘制点
- C++(11):OpenGL坐标系及绘制多个矩形
- 绘制 矩形区域(做调试信息等)
- drawrect 绘制总结
- ios drawRect绘制图形
- ios drawRect绘制图形
- drawRect的绘制的使用(绘制文本字符、绘制图片、绘制图形)
- 最小包围矩形及绘制出来
- Drawing Rectangles(绘制矩形)
- 绘制矩形
- Android开发:SurfaceView上新建线程绘制旋转图片 及 刷新特定区域(脏矩形)
- 绘制圆角矩形(方法 )
- IOS开发(82)之绘制矩形
- Core Graphics之(四):绘制矩形
- OpenGL编程(二)绘制矩形
- Canvas学习(二):绘制特殊矩形
- Linux kernel的中断子系统之(一):综述
- Maven依赖
- openresty用AES/ECB/NoPadding 128位解密
- JTree添加节点
- Java的前置++和后置++效率对比
- [伊利丹·怒风] Unity3D 绘制矩形(DrawRect)及可视化调试
- c++ vector的简单介绍和使用
- 上次发版我就改了一行代码!
- rhel7.2磁盘添加及开机自动挂载
- 02-JS特效-匀速动画
- JTree添加选中事件
- Swing JTextArea避免自动缩放的做法
- 《Redis官方文档》用Redis构建分布式锁
- 欧拉计划 36