void Start() { gameObject.Play(ResizeAction.Create(end, isRelative, duration, Ease.FromType(easeType), direction)); // Self-destroy Destroy(this); }
public RuntimeResize() { TopBar = new RuntimeSquare(); LeftBar = new RuntimeSquare(); BottomBar = new RuntimeSquare(); RightBar = new RuntimeSquare(); Action = ResizeAction.Resize; DifEvent = new ResizeDif(DifProc); Q1 = new RuntimeCapture(); Q1.Cursor = Cursors.SizeNWSE; Q2 = new RuntimeCapture(); Q2.Cursor = Cursors.SizeNESW; Q3 = new RuntimeCapture(); Q3.Cursor = Cursors.SizeNWSE; Q4 = new RuntimeCapture(); Q4.Cursor = Cursors.SizeNESW; Q1.OnDif = DifEvent; Q2.OnDif = DifEvent; Q3.OnDif = DifEvent; Q4.OnDif = DifEvent; GridWidth = 100; GridHeight = 100; GridEnabled = false; GridScale = 1; }
/// <summary> /// Recreate all the resizable resources. /// It reexecute all the resize handlers registered through SetupResize to recreate necessary resources. /// </summary> public void EndResize() { // Reexecute the resize handler (in the order they were added) foreach (var resizeAction in resizeActions) { currentAction = resizeAction; resizeAction.Action(this); } currentAction = null; }
private void StartResizeElement(Point mousePoint) { if ((_resizeAction != null) && ((Document.Action == DesignerAction.Select) || ((Document.Action == DesignerAction.Connect) && _resizeAction.IsResizingLink))) { ResizeAction.OnElementResizingDelegate onElementResizingDelegate = OnElementResizing; _resizeAction.Start(mousePoint, onElementResizingDelegate); if (!_resizeAction.IsResizing) { _resizeAction = null; } } }
private void StartEditLabel() { _isEditLabel = true; // Disable resize if (_resizeAction != null) { _resizeAction = null; } _editLabelAction = new EditLabelAction(); _editLabelAction.StartEdit(_selectedElement, _labelTextBox); }
/// <summary> /// Execute the resize action and register it for later reexecution. /// </summary> /// <param name="action">The action.</param> public void SetupResize(Action <GraphicsResizeContext> action) { // TODO: Unregister SetupResize callbacks // Setup this action and its associated registered resources. resizeActions.Add(new ResizeAction { Action = action, ParameterLocations = currentParameterLocations }); currentAction = resizeActions.Last(); currentParameterLocations = new List <ParameterLocation>(); // Execute the action action(this); currentAction = null; }
private void StartSelectElements(BaseElement selectedElement, Point mousePoint) { // Vefiry if element is in selection if (!Document.SelectedElements.Contains(selectedElement)) { //Clear selection and add new element to selection Document.ClearSelection(); Document.SelectElement(selectedElement); } _changed = false; _moveAction = new MoveAction(); MoveAction.OnElementMovingDelegate onElementMovingDelegate = OnElementMoving; _moveAction.Start(mousePoint, Document, onElementMovingDelegate); // Get Controllers _controllers = new IController[Document.SelectedElements.Count]; for (var i = Document.SelectedElements.Count - 1; i >= 0; i--) { if (Document.SelectedElements[i] is IControllable) { // Get General Controller _controllers[i] = ((IControllable)Document.SelectedElements[i]).GetController(); } else { _controllers[i] = null; } } _resizeAction = new ResizeAction(); _resizeAction.Select(Document); }
/// <summary> /// Add a new action for this step to perform. These actions can be to modify /// or add instance groups. This step supports multiple actions, but requires /// at least one be specified. /// </summary> public void AddResizeAction(ResizeAction resizeAction) { this.args.AddRange(resizeAction.Args); }
/// <summary> /// Add a new action for this step to perform. These actions can be to modify /// or add instance groups. This step supports multiple actions, but requires /// at least one be specified. /// </summary> /// <param name="resizeAction">An instance of ResizeAction defining the change.</param> /// <returns>A reference to this updated object so that method calls can be chained /// together.</returns> public ResizeJobFlowStep WithResizeAction(ResizeAction resizeAction) { this.args.AddRange(resizeAction.Args); return(this); }
/// <summary> /// Add a new action for this step to perform. These actions can be to modify /// or add instance groups. This step supports multiple actions, but requires /// at least one be specified. /// </summary> /// <param name="resizeAction">An instance of ResizeAction defining the change.</param> /// <returns>A reference to this updated object so that method calls can be chained /// together.</returns> public ResizeJobFlowStep WithResizeAction(ResizeAction resizeAction) { this.args.AddRange(resizeAction.Args); return this; }