本文整理匯總了C#中WinterLeaf.Engine.Classes.View.Creators.ObjectCreator.assignFieldsFrom方法的典型用法代碼示例。如果您正苦於以下問題:C# ObjectCreator.assignFieldsFrom方法的具體用法?C# ObjectCreator.assignFieldsFrom怎麽用?C# ObjectCreator.assignFieldsFrom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WinterLeaf.Engine.Classes.View.Creators.ObjectCreator
的用法示例。
在下文中一共展示了ObjectCreator.assignFieldsFrom方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: onMouseDragged
public override void onMouseDragged()
{
GuiCanvas Canvas = "Canvas";
GuiSwatchButtonCtrl payload = new ObjectCreator("GuiSwatchButtonCtrl").Create();
payload.assignFieldsFrom(this);
payload.position = "0 0 ".AsPoint2I();
payload["dragSourceControl"] = this;
int xOffset = payload.extent.x/2;
int yOffset = payload.extent.y/2;
Point2I cursorpos = Canvas.getCursorPos();
int xPos = cursorpos.x - xOffset;
int yPos = cursorpos.y - yOffset;
// Create the drag control.
ObjectCreator oc = new ObjectCreator("GuiDragAndDropControl");
oc["canSaveDynamicFields"] = "0";
oc["Profile"] = "ToolsGuiSolidDefaultProfile";
oc["HorizSizing"] = "right";
oc["VertSizing"] = "bottom";
oc["Position"] = xPos + ' ' + yPos;
oc["extent"] = payload.extent;
oc["MinExtent"] = "4 4";
oc["canSave"] = "1";
oc["Visible"] = "1";
oc["hovertime"] = "1000";
oc["deleteOnMouseUp"] = true;
oc["class"] = "GuiDragAndDropControlType_ColorSwatch";
GuiDragAndDropControl ctrl = oc.Create();
ctrl.add(payload);
// Start drag.
((SimSet) Canvas.getContent()).add(ctrl);
ctrl.startDragging(xOffset, yOffset);
}