public void SetCursor(object locker, Texture2D texture, Vector2 hotspot, CursorMode mode) { if (m_locker != null && m_locker != locker) { return; } if (texture != null) { hotspot = new Vector2(texture.width * hotspot.x, texture.height * hotspot.y); } else { texture = DefaultCursorTexture; if (texture != null) { hotspot = new Vector2(texture.width * DefaultCursorHotspot.x, texture.height * DefaultCursorHotspot.y); } } m_locker = locker; if (m_texture != texture) { Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); Cursor.SetCursor(texture, hotspot, mode); m_texture = texture; } }
public Cursor(Color drawcol) : base(Player.Position, Vector2.Zero, UILayer.MouseTex) { normalColor = drawcol; mode = CursorMode.Free; scale = 1.5f; }
public void Update() { if (!CustomCursor.Get()) { return; } bool visible = Cursor.visible; CursorMode cursorMode = (Inventory3DManager.Get() && Inventory3DManager.Get().gameObject.activeSelf&& Inventory3DManager.Get().m_CarriedItem) ? CursorMode.ForceSoftware : CursorMode.Auto; if (cursorMode != this.m_Mode) { this.m_Mode = cursorMode; if (this.m_Mode == CursorMode.ForceSoftware) { CustomCursor.Get().Show(true); this.m_SystemCursorActive = false; } else { CustomCursor.Get().Show(false); this.m_SystemCursorActive = true; } if (CustomCursor.Get()) { CustomCursor.Get().m_Texture = this.m_TexturesMap[this.m_Type]; } Cursor.SetCursor(this.m_TexturesMap[this.m_Type], Vector2.zero, this.m_Mode); } }
public void ChangeCursorTextureUsingSprite(Sprite cursorSprite, Vector2 hotSpot, CursorMode cursorMode) { //this method will use the sprite to change the cursor texture 2D into the cursor img Texture2D cursorTexture = cursorSprite.texture; Cursor.SetCursor(cursorTexture, hotSpot, cursorMode); }
// Use this for initialization void Start() { cursorTexture2 = cursorTexture; cursorMode2 = cursorMode; Cursor.SetCursor(cursorTexture, hotSpot, cursorMode); DontDestroyOnLoad(this); }
public override bool Equals(object obj) { // Potentially use hashcode to avoid garbage made from unboxing? CursorMode other = (CursorMode)obj; return(Visible == other.Visible && LockMode == other.LockMode); }
// do state checking inside method public void UpdateCursorTexture() { Texture2D cursorType = null; CursorMode cursorMode = CursorMode.Auto; switch (mouseInputStatus) { case MouseInputState.Attack: cursorType = PrefabManager.instance.crosshairCursorType; Cursor.SetCursor(cursorType, new Vector2(cursorType.width / 2, cursorType.height / 2), cursorMode); break; case MouseInputState.AddTower: cursorType = PrefabManager.instance.addTowerCursorType; cursorMode = CursorMode.ForceSoftware; Cursor.SetCursor(cursorType, new Vector2(cursorType.width / 2, cursorType.height / 2), cursorMode); break; case MouseInputState.UpgradeTower: cursorType = PrefabManager.instance.upgradeTowerCursorType; cursorMode = CursorMode.ForceSoftware; Cursor.SetCursor(cursorType, new Vector2(cursorType.width / 2, cursorType.height / 2), cursorMode); break; case MouseInputState.InteractUI: default: cursorType = PrefabManager.instance.pickerCursorType; Cursor.SetCursor(cursorType, new Vector2(cursorType.width / 3, 0), cursorMode); break; } }
/// <summary> /// Handles losing the focus. /// </summary> /// <param name="e">An EventArgs that contains the event data.</param> protected override void OnLostFocus(EventArgs e) { base.OnLostFocus(e); this.hoverBottomBorder = this.hoverLeftBorder = this.hoverRightBorder = this.hoverTopBorder = false; this.hitBottomBorder = this.hitLeftBorder = this.hitRightBorder = this.hitTopBorder = false; this.cursorMode = CursorMode.Main; }
//public static bool IsCursorOpperationValidOnCube(CursorMode mode, Cube cube) //{ // if (cube == null) // return false; // if (mode == CursorMode.None) // return true; // if (mode == CursorMode.Mine && // (cube.ElementType == MapElementType.Rock) // ) // { // return true; // } // return false; //} public static bool IsCursorOpperationValidOnMapElement(CursorMode mode, MapElement element) { if (element == null) return false; if (mode == CursorMode.Mine && ( element.ElementType == MapElementType.Rock || element.ElementType == MapElementType.IronOreCube ) && element.Position.Z == WorldMap.Instance.GetSurfacePoint() ) return true; else if ((mode == CursorMode.CropArea || mode == CursorMode.Pasture) && element.Position.Z == WorldMap.Instance.GetSurfacePoint() + 1 && element.ElementState == MapElementState.Free) { if (WorldMap.Instance.GetMapElement(element.Position.X, element.Position.Y, element.Position.Z - 1) != null) return false; return true; } else if (mode == CursorMode.PlacingBuilding && element.ElementEffect == MapElementEffect.Moveable) return true; else if (mode == CursorMode.PlacingWorldObject && element.ElementEffect == MapElementEffect.Moveable) { return true; } //if (mode == CursorMode.Chopping && element.ElementType == MapElementType.Tree) //{ // return true; //} return false; }
/// <summary> /// Method calls Extinguish() method of all the grass under mouse cursor(selection circle). /// </summary> /// <param name="cursorMode"></param> /// <param name="selectionSize"></param> public override void OnMouseClick(CursorMode cursorMode, float selectionSize) { RaycastHit hit; switch (cursorMode) { case CursorMode.point: Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit)) { Debug.Log(hit.transform.tag); if (hit.transform.CompareTag("Grass")) { hit.transform.GetComponent <Grass>().Extinguish(); } } break; case CursorMode.circle: Ray cRay = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit[] grass = Physics.SphereCastAll(cRay, selectionSize / 2); foreach (RaycastHit r in grass) { if (r.transform.tag == "Grass") { r.transform.GetComponent <Grass>().Extinguish(); } } break; default: break; } }
void SetCursor(Texture2D texture, Vector2 hotspot, CursorMode cursorMode) { if (Input.mousePresent) { Cursor.SetCursor(texture, hotspot, cursorMode); } }
// Use this for initialization void Start() { CursorMode cursorMode = CursorMode.Auto; Vector2 hotSpot = new Vector2(cursorTexture.width * 0.5f, cursorTexture.height * 0.5f); Cursor.SetCursor(cursorTexture, hotSpot, cursorMode); }
public void Complete(Vector2 startingPoint, Vector2 point, bool isOutNodeDistance) { CursorMode cursorMode = this.CursorMode; this.CursorMode = CursorMode.None; switch (cursorMode) { case CursorMode.Transformer: ToolBase.TransformerTool.Complete(startingPoint, point); //TransformerTool break; case CursorMode.Move: ToolBase.MoveTool.Complete(startingPoint, point); //MoveTool break; case CursorMode.BoxChoose: { if (isOutNodeDistance) { //BoxChoose Layerage layerage = this.SelectionViewModel.GetFirstSelectedLayerage(); IList <Layerage> parentsChildren = this.ViewModel.LayerageCollection.GetParentsChildren(layerage); this.BoxChoose(parentsChildren); this.SelectionViewModel.SetMode(this.ViewModel.LayerageCollection); //Selection LayerageCollection.ArrangeLayersBackground(this.ViewModel.LayerageCollection); this.ViewModel.Invalidate(InvalidateMode.HD); //Invalidate } } break; } }
void Start() { // ustawienie własnego kursora cursorMode = CursorMode.Auto; hotSpot = Vector2.zero; Cursor.SetCursor(cursorTexture, hotSpot, cursorMode); }
public void SetAttackCursor() { Texture2D cursorTexture = cursors[0]; CursorMode cursorMode = CursorMode.ForceSoftware; Cursor.SetCursor(cursorTexture, Vector2.zero, cursorMode); }
//change current curose type based on player action mode void ChangeCursor() { if (currentMode != pa.playerMode) { if (pa.playerMode == Mode.attack) { Vector2 hotspot = Vector2.zero; CursorMode cursorMode = CursorMode.Auto; Cursor.SetCursor(cursorBattle, hotspot, cursorMode); } else if (pa.playerMode == Mode.chat) { Vector2 hotspot = Vector2.zero; CursorMode cursorMode = CursorMode.Auto; Cursor.SetCursor(cursorChat, hotspot, cursorMode); } else if (pa.playerMode == Mode.farm) { Vector2 hotspot = Vector2.zero; CursorMode cursorMode = CursorMode.Auto; Cursor.SetCursor(cursorFarm1, hotspot, cursorMode); } currentMode = pa.playerMode; } }
public void Cursor(CursorMode mode) { var cursorMode = ""; switch (mode) { case CursorMode.Arrow: cursorMode = "default"; break; case CursorMode.Cross: cursorMode = "crosshair"; break; case CursorMode.Hand: cursorMode = "pointer"; break; case CursorMode.Move: cursorMode = "move"; break; case CursorMode.Text: cursorMode = "text"; break; case CursorMode.Wait: cursorMode = "wait"; break; default: throw new Exception("Invalid CursorMode"); } Cursor(cursorMode); }
public void Started(Vector2 startingPoint, Vector2 point) { this.CursorMode = CursorMode.None; if (ToolBase.TransformerTool.Started(startingPoint, point))//TransformerTool { this.CursorMode = CursorMode.Transformer; return; } if (ToolBase.MoveTool.Started(startingPoint, point))//MoveTool { this.CursorMode = CursorMode.Move; return; } //Box this.CursorMode = CursorMode.BoxChoose; Matrix3x2 inverseMatrix = this.ViewModel.CanvasTransformer.GetInverseMatrix(); Vector2 canavsStartingPoint = Vector2.Transform(startingPoint, inverseMatrix); Vector2 canvasPoint = Vector2.Transform(point, inverseMatrix); this.BoxRect = new TransformerRect(canavsStartingPoint, canvasPoint); this.ViewModel.Invalidate(InvalidateMode.Thumbnail);//Invalidate }
public void Update(GameTime gameTime) { if (Height < 0) { Height = 0; } if (Height > 31) { Height = 25; } if (destructable < 0) { destructable = 0; } if (destructable > 2) { destructable = 2; } if ((int)Mode > 4) { Mode = 0; } }
public void setMouseWhite() { CursorMode cursorMode = CursorMode.Auto; Vector2 hotSpot = Vector2.zero; Cursor.SetCursor(CursorImage, hotSpot, cursorMode); }
void Awake() { _cursorMode = CursorMode.Auto; _hotSpot = Vector2.zero; Cursor.SetCursor(cursorTexture, _hotSpot, _cursorMode); }
protected override Boolean IsValid(CSSValue value) { if (value.Is("auto")) { _mode = _auto; } else if (value is CSSValueList) { return(Evaluate((CSSValueList)value)); } else if (value == CSSValue.Inherit) { return(true); } else { var mode = Evaluate(value); if (mode == null) { return(false); } _mode = mode; } return(true); }
private void SetCursor(bool refresh = false) { int cursorWidth = 32; int cursorHeight = 32; if (TextureReplacement.TryImportTexture("Cursor", true, out Texture2D tex)) { CursorMode cursorMode = CursorMode.Auto; cursorWidth = tex.width; cursorHeight = tex.height; // Cases when true cursor size cannot be achieved using hardware accelerated cursor if (SystemInfo.operatingSystemFamily == OperatingSystemFamily.Windows && (cursorWidth > 32 || cursorHeight > 32)) { cursorMode = CursorMode.ForceSoftware; } Cursor.SetCursor(tex, Vector2.zero, cursorMode); Debug.Log("Cursor texture overridden by mods."); } else { Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto); } DaggerfallUnity.Settings.CursorWidth = cursorWidth; DaggerfallUnity.Settings.CursorHeight = cursorHeight; if (!refresh) { StateManager.OnStateChange += StateManager_OnStateChange; } }
// Use this for initialization void Start() { cursorTexture2 = cursorTexture; cursorMode2 = cursorMode; Cursor.SetCursor(cursorTexture, hotSpot, cursorMode); DontDestroyOnLoad (this); }
private void SetCursor(Texture2D texture, Vector3 hotspot, CursorMode mode) { if (VR.GUI.SoftCursor) { VR.GUI.SoftCursor.SetCursor(texture ?? this.Cursor00); } }
void SpawnParticleOnClick() { //if (Input.GetKey(KeyCode.Mouse0)) switch (_CursorMode) { case CursorMode.NORMAL: { if ((_Paint) ? Input.GetMouseButton(0) : Input.GetMouseButtonDown(0)) { //Debug.Log("SPAWNed IT!!!!"); //instantiate and add in the list Vector3 positionToSpawn = ParticleSpawner.transform.position; GameObject ParticleObject; ParticleObject = Instantiate(ParticlePrefab, new Vector3(positionToSpawn.x, positionToSpawn.y, positionToSpawn.z), Quaternion.identity) as GameObject; //Debug.Log("ParticleObject.transform.position: " + ParticleObject.transform.position); _Particles.Add(ParticleObject); RootOcTree.Insert(ParticleObject); } if (Input.GetMouseButtonUp(1)) { //TODO: fix right click at appropriate time //ClearQuadtree(); //_QuadTree.ParticleUnderCursor(hit.point); // Debug.Log("CHANGEDS!!!!"); _CursorMode = CursorMode.SPAWN_MULTIPLE; } break; } case CursorMode.SPAWN_MULTIPLE: { if ((_Paint) ? Input.GetMouseButton(0) : Input.GetMouseButtonDown(0)) { //Debug.Log("SPAWNed IT!!!!"); //instantiate and add in the list Vector3 positionToSpawn = ParticleSpawner.transform.position; GameObject ParticleObject; float tempWidth = CubeWidth.x; for (int i = -10; i < 10; ++i) { ParticleObject = Instantiate(ParticlePrefab, new Vector3(UnityEngine.Random.Range(-tempWidth, tempWidth), UnityEngine.Random.Range(-tempWidth, tempWidth), UnityEngine.Random.Range(-tempWidth, tempWidth)), Quaternion.identity) as GameObject; _Particles.Add(ParticleObject); RootOcTree.Insert(ParticleObject); } } if (Input.GetMouseButtonUp(1)) { // _CursorMode = CursorMode.NORMAL; } break; } } //switch end }
// Use this for initialization void Start() { CursorMode cursorMode = CursorMode.Auto; // this.player_script = gameObject.GetComponent<mainPlayer> (); //this.mouse_cursor = Resources.Load ("Sprites/hud/cursor") as Texture2D; Cursor.SetCursor(this.mouse_cursor, Vector2.zero, cursorMode); }
// Use this for initialization void Start() { _playerHealth = Player.GetComponentInChildren <Health> (); CursorMode cursorMode = CursorMode.Auto; Vector2 hotSpot = Vector2.zero; Cursor.SetCursor(CursorImage, hotSpot, cursorMode); }
private void SetPointsRadioButton_Checked(object sender, RoutedEventArgs e) { m_cursorMode = CursorMode.SettingPoints; if (MovePointsRadioButton != null) { MovePointsRadioButton.IsChecked = false; } }
private void SetCursor(Texture2D texture, Vector2 hotspot, CursorMode cursorMode) { if (!Input.get_mousePresent()) { return; } Cursor.SetCursor(texture, hotspot, cursorMode); }
protected void SetCursor(Texture2D new_cursor, Vector2 offset, CursorMode mode) { if ((UnityEngine.Object)new_cursor != (UnityEngine.Object)activeCursor) { activeCursor = new_cursor; Cursor.SetCursor(new_cursor, offset, mode); } }
// Use this for initialization void Start() { pCtrl = FindObjectOfType <SideScrollController>(); grappleCtrl = FindObjectOfType <GrappleController>(); paused = gm.frozen; cursorMode = CursorMode.Auto; Cursor.SetCursor(reticle, new Vector2(reticle.width / 2f, reticle.height / 2f), CursorMode.Auto); }
void OnMouseEnter() { cursorMode = CursorDefecto.getDefaultCursorMode(); if (VariablesGenerales.Instance.getOnConversation()) { Cursor.SetCursor(cursorTexture, hotSpot, cursorMode); } }
//public static bool IsCursorOpperationValidOnCube(CursorMode mode, Cube cube) //{ // if (cube == null) // return false; // if (mode == CursorMode.None) // return true; // if (mode == CursorMode.Mine && // (cube.ElementType == MapElementType.Rock) // ) // { // return true; // } // return false; //} public static bool IsCursorOpperationValidOnMapElement(CursorMode mode, MapElement element) { if (element == null) return false; if (mode == CursorMode.Mine && ( element.ElementType == MapElementType.Rock || element.ElementType == MapElementType.IronOreCube ) && element.Position.Z == WorldMap.Instance.GetSurfacePoint() ) return true; else if ((mode == CursorMode.CropArea || mode == CursorMode.Pasture || mode == CursorMode.IndoorCropArea || mode == CursorMode.Wall) && element.Position.Z == WorldMap.Instance.GetSurfacePoint() + 1 && element.ElementState == MapElementState.Free) { bool valid = true; // Check if there is a rock in the way if (WorldMap.Instance.GetMapElement(element.Position.X, element.Position.Y, element.Position.Z - 1) != null) valid = false; // Check if outside if (mode == CursorMode.IndoorCropArea) { if (WorldMap.Instance.IsOutside(element.Position.X, element.Position.Y) == true) valid = false; } if (mode == CursorMode.CropArea) { if (WorldMap.Instance.IsOutside(element.Position.X, element.Position.Y) == false) valid = false; } return valid; } else if (mode == CursorMode.PlacingBuilding && element.ElementEffect == MapElementEffect.Moveable) return true; else if (mode == CursorMode.PlacingWorldObject && element.ElementEffect == MapElementEffect.Moveable) { return true; } //if (mode == CursorMode.Chopping && element.ElementType == MapElementType.Tree) //{ // return true; //} return false; }
//public static bool IsCursorOpperationValidOnCube(CursorMode mode, Cube cube) //{ // if (cube == null) // return false; // if (mode == CursorMode.None) // return true; // if (mode == CursorMode.Mine && // (cube.ElementType == MapElementType.Rock) // ) // { // return true; // } // return false; //} public static bool IsCursorOpperationValidOnMapElement(CursorMode mode, MapElement element) { if (element == null) return false; if (mode == CursorMode.Mine && element.ElementType == MapElementType.Rock && element.Position.Z == 0 ) { return true; } if (mode == CursorMode.Chopping && element.ElementType == MapElementType.Tree) { return true; } return false; }
public void SetCursorMode(CursorMode mode) { switch (mode) { case CursorMode.Finger: this.cursorMode = new FingerCursorMode(); break; case CursorMode.CenterOfHand: this.cursorMode = new CenterOfHandCursorMode(); break; case CursorMode.CenterOfCluster: this.cursorMode = new CenterOfClusterCursorMode(); break; case CursorMode.HandTracking: this.cursorMode = new HandTrackingCursorMode(this.trackingClusterDataSource); break; } }
public void ApplyMode() { switch (lockMode) { case CurState.None: _newMode = CursorLockMode.None; break; case CurState.LockedToCenter: _newMode = CursorLockMode.Locked; break; case CurState.ConfinedToGameWindow: _newMode = CursorLockMode.Confined; break; } switch (renderMode) { case RenderMode.Auto: _renderAs = CursorMode.Auto; break; case RenderMode.ForceSoftware: _renderAs = CursorMode.ForceSoftware; break; } Cursor.visible = !hideCursor.Value; Texture2D newTexture = cursorTexture.Value as Texture2D; Cursor.SetCursor(newTexture, (hotSpot.IsNone) ? Vector2.zero : hotSpot.Value, _renderAs); Cursor.lockState = _newMode; }
public void SetCursorMode(CursorMode mode) { _cursorMode = mode; _cursorState = CursorState.Free; _markedCubes.Clear(); }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void graphCursorModeButton_Checked(object sender, RoutedEventArgs e) { currentCursorMode = CursorMode.graphBuildMode; }
private static void SetCursor(Texture2D texture, CursorMode cursorMode) { Cursor.SetCursor(texture, Vector2.zero, cursorMode); }
public ModeCombination(CursorMode cursorMode, ClickMode clickMode) { this.CursorMode = cursorMode; this.ClickMode = clickMode; }
private void Input() { // Decides cursormode if (KeyboardInput.IsKeyClicked(Keys.M)) { _cursorMode = CursorMode.Mine; _markingCursor.SetCursorMode(_cursorMode); _buildingSelectionCursor.CursorChange(); } if (KeyboardInput.IsKeyClicked(Keys.C)) { _cursorMode = CursorMode.Free; } else if (KeyboardInput.IsKeyClicked(Keys.B)) { _cursorMode = CursorMode.PlacingBuilding; _buildingSelectionCursor.CursorChange(); } else if (KeyboardInput.IsKeyClicked(Keys.N)) { _cursorMode = CursorMode.PlacingWorldObject; _buildingSelectionCursor.CursorChange(); } else if (KeyboardInput.IsKeyClicked(Keys.V)) { _cursorMode = CursorMode.CropArea; _markingCursor.SetCursorMode(_cursorMode); _buildingSelectionCursor.CursorChange(); } else if (KeyboardInput.IsKeyClicked(Keys.X)) { _cursorMode = CursorMode.Pasture; _markingCursor.SetCursorMode(_cursorMode); _buildingSelectionCursor.CursorChange(); } else if (MouseInput.IsRightMouseClicked()) { _cursorMode = CursorMode.Free; _buildingSelectionCursor.CursorChange(); } }
public static void SetInputMode(GlfwWindowPtr window, InputMode mode, CursorMode value) { GLFWDelegates.glfwSetInputMode(window, mode, value); }
public InventoryCursorIcon(Texture2D texture, Vector2 hotspot, CursorMode cursorMode = CursorMode.Auto) { this.texture = texture; this.hotspot = hotspot; this.cursorMode = cursorMode; }
private static void SetCursor(Texture2D texture, CursorMode cursorMode){}
internal static extern void glfwSetInputMode(GlfwWindowPtr window, InputMode mode, CursorMode value);
void OnMouseEnter() { cursorMode = CursorDefecto.getDefaultCursorMode (); if (VariablesGenerales.Instance.getOnConversation()) Cursor.SetCursor(cursorTexture, hotSpot, cursorMode); }
private void Input() { if (KeyboardInput.IsKeyClicked(Keys.M)) { _cursorMode = CursorMode.Mine; } else if (KeyboardInput.IsKeyClicked(Keys.N)) { _cursorMode = CursorMode.Chopping; } else if (MouseInput.IsLeftMouseClicked() && IsHighlightValid() && _cursorState == CursorState.Free && (_cursorMode == CursorMode.Mine || _cursorMode == CursorMode.Chopping)) { StartMarking(); } else if (MouseInput.IsRightMouseClicked() && _cursorState == CursorState.Marking) { StopMarking(); } else if (MouseInput.IsLeftMouseClicked() && _cursorState == CursorState.Marking) { ExecuteMarking(); } }
public static void SetInputMode(WindowPtr window, InputMode mode, CursorMode value) { glfwSetInputMode(window, mode, value); }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void RadioButton_Checked(object sender, RoutedEventArgs e) { currentCursorMode = CursorMode.doubleGraph; }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void RadioButton_Checked_1(object sender, RoutedEventArgs e) { currentCursorMode = CursorMode.tableBuildMode; }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Вычитание опорной плоскости ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void choosePointsClicked(object sender, RoutedEventArgs e) { currentCursorMode = CursorMode.defaultMode; if (mainImage.Source == null) { MessageBox.Show("Главное изображение пустое"); return; } if (zArrayDescriptor == null) { MessageBox.Show("Z-массив пуст"); return; } needPointsCapture = true; firstClick = null; secondClick = null; PointsChooseForm pointsChooseForm = new PointsChooseForm(); pointsChooseForm.cosinusChoosed+= PointsChooseFormOnCosinusChoosed; pointsChooseForm.Show(); }
/// <summary> /// Creates the window. /// </summary> protected void CreateWindow () { Glfw.WindowHint (WindowHint.OpenGLProfile, (int) OpenGLProfile.Core); Glfw.WindowHint (WindowHint.OpenGLForwardCompat, 1); #if LINUX_INTEL_COMPATIBLE Logger.Log.AddLogEntry (LogLevel.Warning, ClassName, Status.ItsNotABugItsAFeature, "You are using an unsupported graphics mode! Disable LINUX_INTEL_COMPATIBLE compile flag to fix it."); Glfw.WindowHint (WindowHint.ContextVersionMajor, 3); Glfw.WindowHint (WindowHint.ContextVersionMinor, 3); #else Glfw.WindowHint (WindowHint.ContextVersionMajor, 4); Glfw.WindowHint (WindowHint.ContextVersionMinor, 0); #endif #if DEBUG Glfw.WindowHint (WindowHint.OpenGLDebugContext, 1); #endif if (ConfigManager.Instance["freezing_archer"].GetBool ("general", "fullscreen")) Win = Glfw.CreateWindow (Resolution.X, Resolution.Y, Title, Glfw.GetMonitors ()[ ConfigManager.Instance["freezing_archer"].GetInteger ("general", "fullscreen_monitor")], GlfwWindowPtr.Null); else Win = Glfw.CreateWindow (Size.X, Size.Y, Title, GlfwMonitorPtr.Null, GlfwWindowPtr.Null); Glfw.MakeContextCurrent (Win); Glfw.SetCursorPosCallback (Win, MouseMove); Glfw.SetCursorEnterCallback (Win, MouseOver); Glfw.SetMouseButtonCallback (Win, MouseButton); Glfw.SetScrollCallback (Win, MouseScroll); Glfw.SetKeyCallback (Win, KeyAction); Glfw.SetWindowCloseCallback (Win, WindowClose); Glfw.SetWindowFocusCallback (Win, WindowFocus); Glfw.SetWindowIconifyCallback (Win, WindowMinimize); Glfw.SetWindowPosCallback (Win, WindowMove); Glfw.SetWindowSizeCallback (Win, WindowResize); Glfw.SetErrorCallback (WindowError); CursorMode = 0; }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Методы из пункта "Информация" ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void defaultCursorModeButton_Checked(object sender, RoutedEventArgs e) { currentCursorMode = CursorMode.defaultMode; }
/// <summary> /// <para>Specify a custom cursor that you wish to use as a cursor.</para> /// </summary> /// <param name="texture">The texture to use for the cursor or null to set the default cursor. Note that a texture needs to be imported with "Read/Write enabled" in the texture importer (or using the "Cursor" defaults), in order to be used as a cursor.</param> /// <param name="hotspot">The offset from the top left of the texture to use as the target point (must be within the bounds of the cursor).</param> /// <param name="cursorMode">Allow this cursor to render as a hardware cursor on supported platforms, or force software cursor.</param> public static void SetCursor(Texture2D texture, Vector2 hotspot, CursorMode cursorMode) { Cursor.INTERNAL_CALL_SetCursor(texture, ref hotspot, cursorMode); }
private static extern void INTERNAL_CALL_SetCursor(Texture2D texture, ref Vector2 hotspot, CursorMode cursorMode);
internal CSSCursorProperty() : base(PropertyNames.Cursor) { _mode = _auto; _inherited = true; }
/// <summary> /// Determines if the given value represents a valid state of this property. /// </summary> /// <param name="value">The state that should be used.</param> /// <returns>True if the state is valid, otherwise false.</returns> protected override Boolean IsValid(CSSValue value) { if (value.Is("auto")) _mode = _auto; else if (value is CSSValueList) return Evaluate((CSSValueList)value); else if (value == CSSValue.Inherit) return true; else { var mode = Evaluate(value); if (mode == null) return false; _mode = mode; } return true; }
public static void SetCursor(Texture2D texture, Vector2 hotspot, CursorMode cursorMode){}
void OnMouseExit() { cursorMode = CursorDefecto.getDefaultCursorMode (); cursorTexture2 = CursorDefecto.getDefaultCursor(); Cursor.SetCursor(cursorTexture2, Vector2.zero, cursorMode); }