本文整理汇总了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);
}