浏览代码

bind window

/main
gewentao 6 年前
当前提交
a2145d24
共有 3 个文件被更改,包括 34 次插入15 次删除
  1. 2
      Assets/UIWidgets/Tests/CanvasAndLayers.cs
  2. 8
      Assets/UIWidgets/painting/binding.cs
  3. 39
      Assets/UIWidgets/ui/painting/canvas_impl.cs

2
Assets/UIWidgets/Tests/CanvasAndLayers.cs


}
private void OnEnable() {
this.paintingBinding = new PaintingBinding();
this.paintingBinding = new PaintingBinding(null);
paintingBinding.initInstances();
}

8
Assets/UIWidgets/painting/binding.cs


using UIWidgets.ui;
public PaintingBinding(Window window) {
this._window = window;
}
public readonly Window _window;
public static PaintingBinding instance {
get { return _instance; }

39
Assets/UIWidgets/ui/painting/canvas_impl.cs


if (drawCmd is DrawPloygon4) {
var drawPloygon4 = (DrawPloygon4) drawCmd;
this.drawPloygon4(drawPloygon4.points, drawPloygon4.paint);
} else if (drawCmd is DrawRect) {
}
else if (drawCmd is DrawRect) {
} else if (drawCmd is DrawRectShadow) {
}
else if (drawCmd is DrawRectShadow) {
} else if (drawCmd is DrawPicture) {
}
else if (drawCmd is DrawPicture) {
} else if (drawCmd is DrawConcat) {
}
else if (drawCmd is DrawConcat) {
} else if (drawCmd is DrawSave) {
}
else if (drawCmd is DrawSave) {
} else if (drawCmd is DrawSaveLayer) {
}
else if (drawCmd is DrawSaveLayer) {
} else if (drawCmd is DrawRestore) {
}
else if (drawCmd is DrawRestore) {
saveCount--;
if (saveCount < 0) {
throw new Exception("unmatched save/restore in picture");

} else if (drawCmd is DrawClipRect) {
}
else if (drawCmd is DrawClipRect) {
} else if (drawCmd is DrawClipRRect) {
}
else if (drawCmd is DrawClipRRect) {
} else {
}
else {
throw new Exception("unknown drawCmd: " + drawCmd);
}
}

}
public void drawImageRect(Rect src, Rect dst, Paint paint, Image image) {
if (image != null)
{
if (image != null) {
Texture2D _texture = new Texture2D(0, 0);
_texture.LoadImage(image.rawData);
Graphics.DrawTexture(dst.toRect(), _texture);

(float) rect.width,
(float) rect.height));
mat.SetVector("UIWidgets_GUIClipRectRadius", new Vector4(0, 0, 0, 0));
} else {
}
else {
var rrect = this._clipRec.rrect;
var rect = rrect.outerRect;
mat.SetVector("UIWidgets_GUIClipRect", new Vector4(

(float) rrect.brRadius,
(float) rrect.blRadius));
}
} else {
}
else {
mat.SetMatrix("UIWidgets_GUIClipMatrix", Matrix4x4.identity);
var rect = Rect.largest;
mat.SetVector("UIWidgets_GUIClipRect", new Vector4(

正在加载...
取消
保存