public void SetCursorState(CursorState newState) { activeCursorState = newState; switch (newState) { case CursorState.Default: activeCursor = defaultCursor; break; case CursorState.Select: activeCursor = selectCursor; break; case CursorState.Attack: currentFrame = (int)Time.time % attackCursors.Length; activeCursor = attackCursors[currentFrame]; break; case CursorState.Move: currentFrame = (int)Time.time % moveCursors.Length; activeCursor = moveCursors[currentFrame]; break; case CursorState.Harvest: currentFrame = (int)Time.time % harvestCursors.Length; activeCursor = harvestCursors[currentFrame]; break; default: break; } }
public PitchBar() { cursorState = CursorState.Nothing; Height = Program.GRID_VERTICAL - 2; Visible = true; Lyric = ""; }
void RefreshCursorType() { lastCursorState = cursorState; // If setting actual Cursor texture, the second parameter should be half of the cursor's size so that is is centered switch (cursorState) { case CursorState.GAMEPLAY: break; case CursorState.MENU: mainCursorRend.sprite = cursorMenu; break; case CursorState.DEACTIVATED: mainCursorRend.sprite = cursorDeactivated; break; default: Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); Cursor.visible = true; break; } if (cursorState == CursorState.GAMEPLAY) { dashCursorRend.enabled = true; } else { dashCursorRend.enabled = false; } }
private void Init() { gameState = GameState.MainMenu; levelState = LevelState.SetUp; cursorState = CursorState.Release; HeldBubbleType = BubbleType.Null; UseableBubbleList = new List <GameObject>(); GetLevelInfo(); if (!LoadProgress()) { SaveProgress(); } if (!LoadConfig()) { SaveConfig(); } else { EventManager.instance.Fire(new UpdateConfig()); } if (SystemInfo.deviceType == DeviceType.Desktop) { int height = Screen.currentResolution.height * 4 / 5; int width = height * 9 / 16; Screen.SetResolution(width, height, false); } }
public GameInstance(GameState state, GameCamera camera, IRequestDispatcher requestDispatcher) { State = state; Camera = camera; RequestDispatcher = requestDispatcher; Cursor = new CursorState(this); // bad. }
protected void OnUpdateFrame(object sender, FrameEventArgs e) { // update the window mode if we have an update queued WindowMode?mode = pendingWindowMode; if (mode.HasValue) { pendingWindowMode = null; bool currentFullScreen = styleMask.HasFlag(NSWindowStyleMask.FullScreen); bool toggleFullScreen = mode.Value == Configuration.WindowMode.Borderless || mode.Value == Configuration.WindowMode.Fullscreen ? !currentFullScreen : currentFullScreen; if (toggleFullScreen) { Cocoa.SendVoid(WindowInfo.Handle, selToggleFullScreen, IntPtr.Zero); } else if (currentFullScreen) { NSApplication.PresentationOptions = fullscreen_presentation_options; } WindowMode.Value = mode.Value; } // If the cursor should be hidden, but something in the system has made it appear (such as a notification), // invalidate the cursor rects to hide it. OpenTK has a private function that does this. if (CursorState.HasFlag(CursorState.Hidden) && Cocoa.CGCursorIsVisible() && !menuBarVisible) { methodInvalidateCursorRects.Invoke(nativeWindow, new object[0]); } }
void ListenDestSelection() { ListenCursorMovement(); if (Input.GetKeyDown(KeyCode.Space)) { if (CheckMovable()) { ClearAllHighlightedSquares(); MoveUnitToCursor(); highlightedUnit = null; if (gameMap.playerUnits.HasAttackableEnemies(cursorX, cursorY)) { attackableEnemies = gameMap.playerUnits.GetAttackableEnemies(cursorX, cursorY); attackableTargetIndex = 0; HighlightAttackableTargetTile(true); currState = CursorState.SelectTarget; } else { CheckTurnFinished(); } } else { Debug.Log("You can't move to that square!"); } } }
private void SetMouseCursor(CursorState newCursorState) { switch (newCursorState) { case CursorState.DefaultCursor: newCursorTexture = defaultCursor; break; case CursorState.TransparentCursor: newCursorTexture = transparentCursor; break; case CursorState.AllyCursor: coroutine = CycleCursors(allyCursors, CursorState.AllyCursor); if (coroutine != null) { StartCoroutine(coroutine); } break; case CursorState.EnemyCursor: coroutine = CycleCursors(enemyCursors, CursorState.EnemyCursor); if (coroutine != null) { StartCoroutine(coroutine); } break; } Cursor.SetCursor(newCursorTexture, cursorPositionModifier, CursorMode.Auto); }
public bool MoveMany(long count) { // Note: If we decide to allow count == 0, then we need to special case // that MoveNext() has never been called. It's not entirely clear what the return // result would be in that case. Ch.CheckParam(count > 0, nameof(count)); if (State == CursorState.Done) { return(false); } Ch.Assert(State == CursorState.NotStarted || State == CursorState.Good); if (MoveManyCore(count)) { Ch.Assert(State == CursorState.NotStarted || State == CursorState.Good); _position += count; State = CursorState.Good; return(true); } Dispose(); return(false); }
void OnWindowPush(Window callingWindow) { mLastFrameCursorXRelativeToWindow = CursorXRelativeToWindow; mLastFrameCursorYRelativeToWindow = CursorYRelativeToWindow; if (mSideOver != Sides.None) { mCursorState = CursorState.DraggingSides; } else if (!mCursor.ResizingWindow && !IsCursorInSelectedArea && mCursor.mWindowGrabbed == null) { mSelectedArea.Visible = true; mLeftTU = mRightTU = XToU(CursorXRelativeToWindow); mTopTV = mBottomTV = YToV(CursorYRelativeToWindow); originalClickX = CursorXRelativeToWindow; originalClickY = CursorYRelativeToWindow; mLastFrameCursorXRelativeToWindow = originalClickX; mLastFrameCursorYRelativeToWindow = originalClickY; mSelectedArea.X = CursorXRelativeToWindow; mSelectedArea.ScaleX = 0; mSelectedArea.Y = CursorYRelativeToWindow; mSelectedArea.ScaleY = 0; mCursorState = CursorState.DraggingCorner; } else if (IsCursorInSelectedArea) { mCursorState = CursorState.MovingSelection; } }
public void SetCursorState(CursorState newState) { activeCursorState = newState; switch (newState) { case CursorState.Select: activeCursor = selectCursor; break; case CursorState.Attack: currentFrame = (int)Time.time % attackCursors.Length; activeCursor = attackCursors [currentFrame]; break; case CursorState.Harvest: currentFrame = (int)Time.time % harvestCursors.Length; activeCursor = harvestCursors [currentFrame]; break; case CursorState.Move: currentFrame = (int)Time.time % moveCursors.Length; activeCursor = moveCursors [currentFrame]; break; case CursorState.PanLeft: activeCursor = leftCursor; break; case CursorState.PanRight: activeCursor = rightCursor; break; case CursorState.PanUp: activeCursor = upCursor; break; case CursorState.PanDown: activeCursor = downCursor; break; default: break; } }
public static void SetState(CursorState state) { if (Instance == null) { Debug.LogWarning("No CursorController found in scene. Skipping settings state"); return; } var prevState = Instance._currentState; Instance._currentState = state; if (Instance._overUI && state != CursorState.Targeting) { Instance._overUIState = state; } else if (state < CursorState.MoveCameraUp && state > CursorState.DownOverUI) { Instance._normalState = state; } if (prevState != state) { stateChanged(state); } }
//概要 : カーソルの見た目を変更する //引数 : CursorState state カーソルの状態 //返値 : なし public void ChangeCursor(CursorState state) { Texture2D cursorTex = null; switch (state) { default: case CursorState.NormalCursor: if (NormalCursorTexture) { cursorTex = NormalCursorTexture; } break; case CursorState.LockOnCursor: if (LockOnCursorTexture) { cursorTex = LockOnCursorTexture; } break; } if (cursorTex == null) { //デフォルトのカーソルを使う Cursor.SetCursor(null, new Vector2(0, 0), CursorMode.Auto); return; } //カーソルに画像を使う Cursor.SetCursor(cursorTex, new Vector2(cursorTex.width / 2, cursorTex.height / 2), CursorMode.ForceSoftware); }
public void Initialize() { //UnityEngine.Cursor.visible = false; CursorDefault = GameObject.Find("CursorDefault"); CursorAim = GameObject.Find("CursorAim"); CursorHand = GameObject.Find("CursorHand"); CursorTalk = GameObject.Find("CursorTalk"); CursorPortal = GameObject.Find("CursorPortal"); NGUITools.SetActive(CursorDefault.gameObject, false); NGUITools.SetActive(CursorHand.gameObject, false); NGUITools.SetActive(CursorTalk.gameObject, false); NGUITools.SetActive(CursorPortal.gameObject, false); Default = Resources.Load("HWCursorDefault") as Texture2D; Hand = Resources.Load("HWCursorHand") as Texture2D; Talk = Resources.Load("HWCursorTalk") as Texture2D; Portal = Resources.Load("HWCursorPortal") as Texture2D; CurrentState = CursorState.Default; RefreshCursor(); ToolTip = GameObject.Find("ToolTip").GetComponent <UILabel>(); ToolTipDelay = 0.01f; NGUITools.SetActive(ToolTip.gameObject, false); UIEventHandler.OnCloseWindow += OnResetCursor; UIEventHandler.OnLootBody += OnResetCursor; UIEventHandler.OnLootChest += OnResetCursor; UIEventHandler.OnToggleInventory += OnResetCursor; }
public void SetCursorState(CursorState newState) { if (activeCursorState != newState) { previousCursorState = activeCursorState; } activeCursorState = newState; switch (newState) { case CursorState.Select: activeCursor = selectCursor; break; case CursorState.Attack: currentFrame = (int)Time.time % attackCursors.Length; activeCursor = attackCursors[currentFrame]; break; case CursorState.Harvest: currentFrame = (int)Time.time % harvestCursors.Length; activeCursor = harvestCursors[currentFrame]; break; case CursorState.Move: currentFrame = (int)Time.time % moveCursors.Length; activeCursor = moveCursors[currentFrame]; break; case CursorState.PanLeft: activeCursor = leftCursor; break; case CursorState.PanRight: activeCursor = rightCursor; break; case CursorState.PanUp: activeCursor = upCursor; break; case CursorState.PanDown: activeCursor = downCursor; break; case CursorState.RallyPoint: activeCursor = rallyPointCursor; break; case CursorState.Plus: activeCursor = leftCursor; break; case CursorState.Minus: activeCursor = rallyPointCursor; break; default: break; } }
public void SetCursorState(CursorState state) { if (CurrentState != state) { CurrentState = state; RefreshCursor(); } }
// For the General Cursor we want to simply override these states public override void OnStateChange(CursorState state) { if (cursorAnim != null) { cursorAnim.SetInteger("CursorState", (int)state); } base.OnStateChange(state); }
public Cursor(PckFile cursorFile) { state = CursorState.Select; this.cursorFile=cursorFile; foreach(PckImage pi in cursorFile) pi.Image.MakeTransparent(cursorFile.Pal.Transparent); }
public CursorType(TemporaryViewCursorColumn <TRepValue> view, Func <int, bool> needCol, IRowCursor otherValues) { _needCol = needCol; _view = view; _state = CursorState.NotStarted; _otherValues = otherValues; _ignoreOtherColumn = view._ignoreOtherColumn; }
public void SetDrawLock() { UpdateCursorTransformState(); _StateChangeDistance = 0.01f; _CursorState = CursorState.lockRad; locked = true; }
/// <summary> /// Creates an instance of the <see cref="RootCursorBase"/> class /// </summary> /// <param name="provider">Channel provider</param> protected RootCursorBase(IChannelProvider provider) { Contracts.CheckValue(provider, nameof(provider)); Ch = provider.Start("Cursor"); _position = -1; _state = CursorState.NotStarted; }
public void TriggerNormal() { isHovering = false; isPressing = true; cursorState = CursorState.Up; ValidateEvents(); }
public void Tick(int power, int seed, CursorState cursorState, bool visible) { isVisible = visible; _powerText.text = "Power: " + power.ToString(); _seed.text = "Level: " + seed.ToString(); DrawCursor(cursorState); }
public virtual void Dispose() { if (_state != CursorState.Done) { Ch.Dispose(); _state = CursorState.Done; } }
public void SaveCursor() { LogController("SaveCursor()"); SavedCursorState = CursorState.Clone(); LogController(" C=" + CursorState.CurrentColumn.ToString() + ",R=" + CursorState.CurrentRow.ToString()); }
public void Up() { _cursorState = CursorState.OnReturn; Player.SetDefaultPlayerState(); Player.PlayerBody.drag = 0.0f; }
public void Dispose() { // NB keep cursor state for reuse // dispose is called on the result of Initialize(), the cursor from // constructor could be uninitialized but contain some state, e.g. _value for this ArithmeticCursor _cursor.Dispose(); State = CursorState.None; }
public UIContext() { _style = new UIStyleReactiveProperty(); _activeComponent = new ReactiveProperty <IInteractableComponent>(); _defaultCursor = CursorNames.Default; _cursorState = CursorState.Vislbe; }
public static void CursorStateChange(CursorState state) { if (state != currentCursorState) { currentCursorState = state; SetCursor(); } }
private void RectangleProvider_MouseUp(object sender, MouseEventArgs e) { if (handler.Active) { handler.EndControllerAction(); state = CursorState.Hover; } }
private void init() { setTransitions(); _camera = this.gameObject.GetComponent <Camera>(); _currentState = CursorState.Default; SelectionPanel.GetComponent <RectTransform>().sizeDelta = Vector2.zero; }
void ListenEnemyMovement() { if (!gameMap.playerUnits.HasAllPlayerUnitsMoved()) { currState = CursorState.MovingCursor; cursor.GetComponent <SpriteRenderer>().color = Color.yellow; } }
private void StartManualOp() { Application.Current.Dispatcher.Invoke(() => { RunningManualOp = true; manualCursorState = new CursorState(Cursors.Wait); }); }
public StreamBlockRecordCursor(StreamBlockIndex blockIndex, StreamLogId slid) { _blockIndex = blockIndex; _slid = slid; _chunkCursorState = CursorState.Initialized; _cursorCurrentKey = default; _chunkCursorCurrent = default; }
public void SetCursorState(CursorState state) { if(CurrentState != state) { CurrentState = state; } RefreshCursor(); }
public PlayerCursor(int playernumber, CursorPosition pos, ControlSet contr, string tokenloc, string slotloc, Vector2 corner) { this.Position = pos; this.control = contr; Token = new Texture(tokenloc); Slot = new Texture(slotloc, false); this.Corner = corner; this.PlayerNumber = playernumber; State = CursorState.PokemonSelect; }
/// <summary> /// This class... /// </summary> public void Clear() { // Resets cursor state = CursorState.None; // Ghost Tower exists, it is destroyed. if(Griddy.Tower.ghost != null) { Destroy(Griddy.Tower.ghost.gameObject); } }
void Awake() { // Hide Screen Cursor Screen.showCursor = false; // Set initial Cursor state state = CursorState.None; // Set initial Cursor texture cursor = mouseUp; Debug.Log(dimensions.ToString()); }
public override void Draw(Microsoft.Xna.Framework.GameTime gameTime) { base.Draw(gameTime); if (MouseInput.BUTTONR()) { State = CursorState.CameraRotation; } else { State = CursorState.Normal; } Vector2 pos = MouseInput.GetMousePosition(); spriteBatch.Begin(); spriteBatch.Draw(texture, State == CursorState.Normal ? MouseInput.GetMousePosition() : MouseInput.GetCachedPosition(), Color.White); spriteBatch.End(); }
public uint[] OverflowIDs; // Cache of overflow page locations #endif #region Methods // was:sqlite3BtreeCursorZero public void Zero() { Next = null; Prev = null; KeyInfo = null; RootID = 0; _cachedRowID = 0; Info = new MemPage.CellInfo(); Writeable = false; AtLast = false; ValidNKey = false; State = 0; Key = null; NKey = 0; SkipNext = 0; #if !SQLITE_OMIT_INCRBLOB IsIncrblob = false; OverflowIDs = null; #endif PageID = 0; }
public void Initialize() { UnityEngine.Cursor.visible = false; CursorDefault = GameObject.Find("CursorDefault"); CursorAim = GameObject.Find("CursorAim"); CursorHand = GameObject.Find("CursorHand"); CursorTalk = GameObject.Find("CursorTalk"); CurrentState = CursorState.Default; RefreshCursor(); ToolTip = GameObject.Find("ToolTip").GetComponent<UILabel>(); ToolTipDelay = 0.5f; NGUITools.SetActive(ToolTip.gameObject, false); UIEventHandler.OnCloseWindow += OnResetCursor; UIEventHandler.OnLootBody += OnResetCursor; UIEventHandler.OnLootChest += OnResetCursor; UIEventHandler.OnToggleInventory += OnResetCursor; }
protected void OnMouseUp(MouseEventArgs mevent) { if (isClick && Click != null) { cursorState = CursorState.Nothing; Click(this); } else { if (cursorState == CursorState.IsResizingLeft) { int realEX = Left - tempLeft + mevent.X; Left = tempLeft + realEX - resizeFirstClickX; Width = tempWidth + tempLeft - Left; StartTime = tempStartTime + ((Left - tempLeft) / Program.PixelPerSecond); PitchBar.ResizeToNeighbour(Program.PitchBars, this); if (Length < Program.MinimumLength) // check collision { StartTime = tempStartTime; EndTime = tempEndTime; Width = tempWidth; } if (Resizing != null) Resizing(this); } else if (cursorState == CursorState.IsResizingRight) { Width = tempWidth + mevent.X - resizeFirstClickX; EndTime = StartTime + (Width / Program.PixelPerSecond); PitchBar.ResizeToNeighbour(Program.PitchBars, this); if (Length < Program.MinimumLength) // check collision { StartTime = tempStartTime; EndTime = tempEndTime; Width = tempWidth; } if (Resizing != null) Resizing(this); } else if (cursorState == CursorState.IsMovingVertically) { int deltaIndex = 0; if (mevent.Y < 0) deltaIndex = (mevent.Y - Program.GRID_VERTICAL) / Program.GRID_VERTICAL; else deltaIndex = mevent.Y / Program.GRID_VERTICAL; NoteIndex -= deltaIndex; NoteIndex = (NoteIndex < Program.PANEL_PIANO_START_NOTE_INDEX) ? Program.PANEL_PIANO_START_NOTE_INDEX : ((NoteIndex >= Program.RegisteredNotes.Count) ? Program.RegisteredNotes.Count - 1 : NoteIndex); Top += deltaIndex * Program.GRID_VERTICAL; if (Resizing != null) Resizing(this); } cursorState = CursorState.Nothing; } }
public void SetCursorMode(CursorMode mode) { _cursorMode = mode; _cursorState = CursorState.Free; _markedCubes.Clear(); }
protected void OnMouseDown(MouseEventArgs mevent) { if (cursorState == CursorState.WaitingResizeLeft || cursorState == CursorState.WaitingResizeRight) { if (cursorState == CursorState.WaitingResizeLeft) cursorState = CursorState.IsResizingLeft; else cursorState = CursorState.IsResizingRight; resizeFirstClickX = mevent.X; tempStartTime = StartTime; tempEndTime = EndTime; tempWidth = Width; tempLeft = Left; } else if (cursorState == CursorState.WaitingMoveVertically) { cursorState = CursorState.IsMovingVertically; } isClick = true; }
protected void OnMouseMove(MouseEventArgs mevent) { if (cursorState == CursorState.Nothing || cursorState == CursorState.WaitingMoveVertically || cursorState == CursorState.WaitingResizeLeft || cursorState == CursorState.WaitingResizeRight) { int widthHover = Width / 4; if (widthHover > 20) widthHover = 20; if (mevent.X <= widthHover) { Cursor.Current = Cursors.SizeWE; cursorState = CursorState.WaitingResizeLeft; } else if (mevent.X >= (Width - widthHover)) { Cursor.Current = Cursors.SizeWE; cursorState = CursorState.WaitingResizeRight; } else { Cursor.Current = Cursors.SizeNS; cursorState = CursorState.WaitingMoveVertically; } } else if (cursorState == CursorState.IsMovingVertically) { int deltaIndex = 0; if (mevent.Y < 0) deltaIndex = (mevent.Y - Program.GRID_VERTICAL) / Program.GRID_VERTICAL; else deltaIndex = mevent.Y / Program.GRID_VERTICAL; NoteIndex -= deltaIndex; NoteIndex = (NoteIndex < Program.PANEL_PIANO_START_NOTE_INDEX) ? Program.PANEL_PIANO_START_NOTE_INDEX : ((NoteIndex >= Program.RegisteredNotes.Count) ? Program.RegisteredNotes.Count - 1 : NoteIndex); Top += deltaIndex * Program.GRID_VERTICAL; if (Resizing != null) Resizing(this); } else // is resizing { isClick = false; if (cursorState == CursorState.IsResizingLeft) { int realEX = Left - tempLeft + mevent.X; Left = tempLeft + realEX - resizeFirstClickX; Width = tempWidth + tempLeft - Left; StartTime = tempStartTime + ((Left - tempLeft) / Program.PixelPerSecond); } else if (cursorState == CursorState.IsResizingRight) { Width = tempWidth + mevent.X - resizeFirstClickX; } if (Resizing != null) Resizing(this); } }
private Node SetState(CursorState state, string word) { Node node = null; if (state != currentState) { if (state == CursorState.FieldName) { node = new FieldNode(word); } if (state == CursorState.Condition) { node = new ConditionNode(word); } if (state == CursorState.Parameter) { node = new ParameterNode(word); } if (state == CursorState.Constant) { node = new ConstantNode(word); } if (state == CursorState.ArrayOfValues) { node = new ArrayOfValues(word); } if (state == CursorState.OpenBracket) { node = new OpenBracketNode(); } if (state == CursorState.CloseBracket) { node = new CloseBracketNode(); } if (state == CursorState.Operator) { node = new OperatorNode(word); } if (node != null) nodes.Add(node); currentState = state; } return node; }
private void AnimTimer_Tick(object sender, EventArgs e) { if (!_animating && _animQueue.Count > 0) { CursorState nextState = CursorState.ClosedHand, tryState; while (_animQueue.TryDequeue(out tryState)) { nextState = tryState; } if (nextState != _cursorState) { _animating = true; if (_cursorState == CursorState.OpenHand) { _openToCloseHandAnimation.Begin(); } else { _closeToOpenHandAnimation.Begin(); } _cursorState = nextState; } } }
private void EnterCursorState(CursorState state) { if (this.mouseState != CursorState.Normal) this.LeaveCursorState(); this.mouseState = state; this.createPolyIndex = 0; this.selectedBody.BeginUpdateBodyShape(); this.MouseActionAllowed = false; this.UpdateToolbar(); this.UpdateCursorImage(); this.Invalidate(); if (Sandbox.State == SandboxState.Playing) Sandbox.Pause(); DualityEditorApp.Deselect(this, ObjectSelection.Category.Other); }
public void SetCursor(CursorState cursorState) { this.cursorState = cursorState; }
private void StartMarking() { _cursorState = CursorState.Marking; _clickedMapElement = _highlighted; }
private void StopMarking() { _cursorState = CursorState.Free; }
private void ExecuteMarking() { _cursorState = CursorState.Free; if (_cursorMode == CursorMode.Mine) { foreach (Vector3Int cube in _markedCubes) { _worldMap.GetMapElement(cube.X, cube.Y, cube.Z).Mark(MapElementState.MiningScheduled); } } else if (_cursorMode == CursorMode.Chopping) { foreach (Vector3Int cube in _markedCubes) { _worldMap.GetMapElement(cube.X, cube.Y, cube.Z).Mark(MapElementState.ChobbingScheduled); } } }
public void SetCursorState(CursorState aState) { _animQueue.Enqueue(aState); }
public void PlacedRallyPoint() { SetCursorState(CursorState.Select); previousCursorState = activeCursorState; }
public void SetCursorState(CursorState state) { if (activeCursorState != state) { PreviousCursorState = activeCursorState; } activeCursorState = state; UpdateCursorAnimation(); }
public CursorEvent(CursorState state) { currentcursorstate = state; }
private void StopMarking() { _cursorState = CursorState.Free; _markedCubes.Clear(); _invalidCubes.Clear(); }
internal static void ListenForMouseoverUnit() { mInPlayObjectList.Reset(); for (int i = 0; i < mInPlayObjectList.GetCount(); i++) { if (mInPlayObjectList.GetCurrent().gameObject.Hostility == Hostility.ENEMY && mInPlayObjectList.GetCurrent().gameObject.Sprite.SpriteFrame.Contains(mouseRectangle)) { cursorState = CursorState.ATTACK; break; } else { cursorState = CursorState.GAUNTLET; } mInPlayObjectList.NextNode(); } }
private void LeaveCursorState() { if (this.mouseState == CursorState.Normal) return; this.mouseState = CursorState.Normal; this.MouseActionAllowed = true; this.selectedBody.EndUpdateBodyShape(); this.UpdateToolbar(); this.Invalidate(); }
void OnWindowPush(Window callingWindow) { mLastFrameCursorXRelativeToWindow = CursorXRelativeToWindow; mLastFrameCursorYRelativeToWindow = CursorYRelativeToWindow; if (mSideOver != Sides.None) { mCursorState = CursorState.DraggingSides; } else if (!mCursor.ResizingWindow && !IsCursorInSelectedArea && mCursor.mWindowGrabbed == null) { mSelectedArea.Visible = true; mLeftTU = mRightTU = XToU(CursorXRelativeToWindow); mTopTV = mBottomTV = YToV(CursorYRelativeToWindow); originalClickX = CursorXRelativeToWindow; originalClickY = CursorYRelativeToWindow; mLastFrameCursorXRelativeToWindow = originalClickX; mLastFrameCursorYRelativeToWindow = originalClickY; mSelectedArea.X = CursorXRelativeToWindow; mSelectedArea.ScaleX = 0; mSelectedArea.Y = CursorYRelativeToWindow; mSelectedArea.ScaleY = 0; mCursorState = CursorState.DraggingCorner; } else if (IsCursorInSelectedArea) { mCursorState = CursorState.MovingSelection; } }