private void UpdateDragState(Session.Session playerSession, DragState dragState, int ownerId) { playerSession.SetGlobalData(new Dictionary <string, dynamic> { ["Character.DragState"] = dragState.ToString(), ["Drag.CurrentDragOwner"] = ownerId }); if (dragState == DragState.None || ownerId == -1) { playerSession.TriggerEvent("Drag.EndDrag"); } else if (dragState == DragState.Dragged) { playerSession.TriggerEvent("Drag.DoDrag", ownerId); } }
public void UpdateDragState(DragState newState, int ownerId = -1) { dragState = newState; SetGlobalData(new Dictionary <string, dynamic> { ["Character.DragState"] = dragState.ToString(), ["Drag.CurrentDragOwner"] = ownerId }); if (dragState == DragState.None || ownerId == -1) { TriggerEvent("Drag.EndDrag"); } else if (dragState == DragState.Dragged) { TriggerEvent("Drag.DoDrag", ownerId); } }
private void PanelPreView_MouseMove(object sender, MouseEventArgs e) { float zoom = HScrollBar_ZoomLevel.Value / mParZOOM; //e.X,Yからステージ上の座標にする float stPosX = (e.X - (panel_PreView.Width / 2)) / zoom; float stPosY = (e.Y - (panel_PreView.Height / 2)) / zoom; if (mNowSelectIndex != null) { ELEMENTS nowEle = TimeLine.EditFrame.GetElement((int)mNowSelectIndex); //移動処理 if (mMouseLDown) { if (nowEle != null) { //+CTRL マウスでの回転 左周りにしかなってない if (mKeysSP == Keys.Control) { float w = nowEle.Atr.Radius.X + mMouseDownShift.X; if (w > 360) { nowEle.Atr.Radius.X = w % 360; } else if (w < 0) { nowEle.Atr.Radius.X = 360 - (w % 360); } else { nowEle.Atr.Radius.X += mMouseDownShift.X; } //w = nowEle.Atr.Radius.Y + mMouseDownShift.Y; //nowEle.Atr.Radius.Y = (w > 360) ? w - 360 : 360 - w; //シフトキーも押されていればZ回転 等(将来) } //if( mKeysSP==Keys.Alt) //将来用 else { //差分加算 mDragState = DragState.Move; nowEle.Atr.Position.X = stPosX + mMouseDownShift.X; nowEle.Atr.Position.Y = stPosY + mMouseDownShift.Y; mFormAttribute.SetAllParam(nowEle.Atr); } } else { //アイテム選択が無い場合のLドラッグはステージのXYスクロール mDragState = DragState.Scroll; mScreenScroll.X = (e.X - (panel_PreView.Width / 2)) - mMouseDownPoint.X; mScreenScroll.Y = (e.Y - (panel_PreView.Height / 2)) - mMouseDownPoint.Y; } panel_PreView.Refresh(); } } StatusLabel.Text = $"[X:{stPosX:####}/Y:{stPosY:####}] [Px:{mMouseDownPoint.X:####}/Py:{mMouseDownPoint.Y:####}]"; StatusLabel2.Text = $" [Select:{mNowSelectIndex}][ScX{mScreenScroll.X:###}/ScY{mScreenScroll.Y:###}] [Zoom:{zoom}]{mDragState.ToString()}:{mWheelDelta}"; }
void OnGUI() { GUILayout.Label(dragState.ToString()); }