Here's how you could custom-draw extra text -
var Alignment = MindFusion.Diagramming.Alignment;
var Text = MindFusion.Drawing.Text;
ShapeNode.prototype.onUpdateVisuals = function ()
{
var content = this.graphicsContainer.content;
var extraText = new Text(
"User B", // replace with this.yourFieldName
this.getBounds().clone());
extraText.textAlignment = Alignment.Center;
extraText.lineAlignment = Alignment.Far;
extraText.fitInBounds = true;
extraText.font = this.getEffectiveFont();
content.push(extraText);
};
If the icon includes some empty padding space, you could assign it to standard Image property and set ImageAlign to BottomLeft. Alternatively you can adjust image position from same onUpdateVisuals function as shown here -
http://mindfusion.eu/Forum/YaBB.pl?num=1439580359/1#1If you need to add more images to same node -
var imageObj = new Image();
imageObj.src = "icon1.png";
// in onUpdateVisuals
var image2 = new MindFusion.Drawing.Image(
new MindFusion.Drawing.Rect(this.bounds.x + 2, this.bounds.bottom() - 7, 5, 5));
image2.image = imageObj;
image2.loaded = imageObj.complete;
content.push(image2);
Instead of custom drawing, you could add extra images and texts by showing them in Transparent ShapeNodes attached to main node using attachTo method. That will let your users adjust their positions if desired, or you could set node.Locked to prevent that.
Regards,
Slavcho
Mindfusion