Ver Fonte

Add h2d icon to prefab file references

trethaller há 6 anos atrás
pai
commit
805a574348
2 ficheiros alterados com 11 adições e 0 exclusões
  1. BIN
      bin/res/icons/fileRef.png
  2. 11 0
      hrt/prefab/Reference.hx

BIN
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);