浏览代码

Add h2d icon to prefab file references

trethaller 6 年之前
父节点
当前提交
805a574348
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 二进制
      bin/res/icons/fileRef.png
  2. 11 0
      hrt/prefab/Reference.hx

二进制
bin/res/icons/fileRef.png


+ 11 - 0
hrt/prefab/Reference.hx

@@ -80,6 +80,17 @@ class Reference extends Object3D {
 			ctx = super.makeInstance(ctx);
 			ctx.isRef = true;
 			p.make(ctx);
+
+			#if editor
+			var path = hide.Ide.inst.appPath + "/res/icons/fileRef.png";
+			var data = sys.io.File.getBytes(path);
+			var tile = hxd.res.Any.fromBytes(path, data).toTile().center();
+			var objFollow = new h2d.ObjectFollower(ctx.local3d, ctx.shared.root2d);
+			objFollow.followVisibility = true;
+			var bmp = new h2d.Bitmap(tile, objFollow);
+			ctx.local2d = objFollow;
+			#end
+
 		}
 		else {
 			ctx = ctx.clone(this);