你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
谷主
赞同来自: 如梦令初醒
赞同来自:
xiezuobao
要回复问题请先登录或注册
4 个回复
谷主
赞同来自: 如梦令初醒
for (let j: number = 0; j < size; j++) {
posArr.push(radius + radius * Math.cos(vertexRadian * j));
posArr.push(radius + radius * Math.sin(vertexRadian * j));
}
谷主
赞同来自:
xiezuobao
赞同来自:
* @param size 正多边形变数
* @param radius 内切半径
* @param center 内切圆坐标
* */
private drawRadialBg(size: number, radius: number, center: Laya.Vector2, lineSize: number = 3,
lineColor: string = "#BDBDBD", fillColor: string = "#3B596B"): fgui.GGraph {
let graph: fgui.GGraph = new fgui.GGraph();
graph.setSize(radius * 2, radius * 2);
graph.setPivot(0.5, 0.5);
graph.setXY(center.x, center.y);
let posArr: number = ;
let vertexRadian = 2 * Math.PI / size;//顶角弧度
for (let j: number = 0; j < size; j++) {
posArr.push(center.x + radius * Math.cos(vertexRadian * j));
posArr.push(center.y + radius * Math.sin(vertexRadian * j));
}
graph.drawPolygon(lineSize, lineColor, fillColor, posArr);
return graph;
}
private drawRadial(radius: number, center: Laya.Vector2, valueArr: number, lineSize: number = 3,
lineColor: string = "#FF9900", fillColor: string = "#99FF33"): fgui.GGraph {
let graph: fgui.GGraph = new fgui.GGraph();
graph.setSize(radius * 2, radius * 2);
graph.setPivot(0.5, 0.5);
graph.setXY(center.x, center.y);
graph.drawRegularPolygon(lineSize, lineColor, fillColor, valueArr.length, 0, valueArr);
return graph;
}
//===================
let graph: fgui.GGraph = this.drawRadialBg(6, 150, new Laya.Vector2(200, 100));
obj.addChild(graph);
let graph6: fgui.GGraph = this.drawRadial(150, new Laya.Vector2(200, 100), [1, 1, 1, 1, 1, 1]);
obj.addChild(graph6);
谷主
赞同来自: