【发布时间】:2011-10-14 09:44:51
【问题描述】:
我正在绘制一条渐变样式的线,但由于某种原因,当添加到显示列表时,该线的x 位置似乎约为 4 或 5 而不是 0。追踪线的x 位置返回0,但可以清楚地看到线不在该坐标处。
如果我移除渐变框,那么它的位置正确,但这不是解决方案,因为我会丢失渐变。
我的目标是使用 Flash Builder 的 FlashPlayer 11 / AIR 3。有什么想法吗?
//Constants
private static const LINE_COLOR:uint = 0xFFFFFF;
private static const LINE_WIDTH:uint = 10;
//Variables
private var volumeLineShape:Shape = new Shape();
private var volumeLineMatrix:Matrix = new Matrix();
// ~
volumeLineMatrix.createGradientBox(widthProperty, heightProperty);
volumeLineShape.graphics.clear();
volumeLineShape.graphics.lineStyle(LINE_WIDTH, 0, 1.0, false, LineScaleMode.NONE, CapsStyle.NONE);
volumeLineShape.graphics.lineGradientStyle(GradientType.LINEAR, [LINE_COLOR, LINE_COLOR, LINE_COLOR], [0.0, 1.0, 0.0], [0, 255 * toneProperty, 255], volumeLineMatrix);
volumeLineShape.graphics.moveTo(0, heightProperty - heightProperty * volumeProperty);
volumeLineShape.graphics.lineTo(widthProperty, heightProperty - heightProperty * volumeProperty);
【问题讨论】:
-
我很困惑,你希望你的渐变线是什么样子的?我认为问题可能出在“lineGradientStyle”参数上
标签: actionscript-3 matrix line gradient