MouseComponent is the location for the MouseSystem to store its results; to be used / viewed by other Systems
| 52 | // MouseComponent is the location for the MouseSystem to store its results; |
| 53 | // to be used / viewed by other Systems |
| 54 | type MouseComponent struct { |
| 55 | // Clicked is true whenever the Mouse was clicked over |
| 56 | // the entity space in this frame |
| 57 | Clicked bool |
| 58 | // Released is true whenever the left mouse button is released over the |
| 59 | // entity space in this frame |
| 60 | Released bool |
| 61 | // Hovered is true whenever the Mouse is hovering |
| 62 | // the entity space in this frame. This does not necessarily imply that |
| 63 | // the mouse button was pressed down in your entity space. |
| 64 | Hovered bool |
| 65 | // Dragged is true whenever the entity space was left-clicked, |
| 66 | // and then the mouse started moving (while holding) |
| 67 | Dragged bool |
| 68 | // RightClicked is true whenever the entity space was right-clicked |
| 69 | // in this frame |
| 70 | RightClicked bool |
| 71 | // RightDragged is true whenever the entity space was right-clicked, |
| 72 | // and then the mouse started moving (while holding) |
| 73 | RightDragged bool |
| 74 | // RightReleased is true whenever the right mouse button is released over |
| 75 | // the entity space in this frame. This does not necessarily imply that |
| 76 | // the mouse button was pressed down in your entity space. |
| 77 | RightReleased bool |
| 78 | // Enter is true whenever the Mouse entered the entity space in that frame, |
| 79 | // but wasn't in that space during the previous frame |
| 80 | Enter bool |
| 81 | // Leave is true whenever the Mouse was in the space on the previous frame, |
| 82 | // but now isn't |
| 83 | Leave bool |
| 84 | // Position of the mouse at any moment this is generally used |
| 85 | // in conjunction with Track = true |
| 86 | MouseX float32 |
| 87 | MouseY float32 |
| 88 | // Set manually this to true and your mouse component will track the mouse |
| 89 | // and your entity will always be able to receive an updated mouse |
| 90 | // component even if its space is not under the mouse cursor |
| 91 | // WARNING: you MUST know why you want to use this because it will |
| 92 | // have serious performance impacts if you have many entities with |
| 93 | // a MouseComponent in tracking mode. |
| 94 | // This is ideally used for a really small number of entities |
| 95 | // that must really be aware of the mouse details event when the |
| 96 | // mouse is not hovering them |
| 97 | Track bool |
| 98 | // Modifier is used to store the eventual modifiers that were pressed during |
| 99 | // the same time the different click events occurred |
| 100 | Modifier engo.Modifier |
| 101 | |
| 102 | // startedDragging is used internally to see if *this* is the object that is being dragged |
| 103 | startedDragging bool |
| 104 | // startedMoving is used internally to see whether the mouse was 1) pressed |
| 105 | // (it has startedDragging) and 2) has seen a move action. This is to make |
| 106 | // sure the Dragging flag is set correctly. |
| 107 | startedMoving bool |
| 108 | // startedRightDragging is used internally to see if *this* is the object that is being right-dragged |
| 109 | rightStartedDragging bool |
| 110 | // rightStartedMoving see startedMoving, but for the right mouse button |
| 111 | rightStartedMoving bool |
nothing calls this directly
no outgoing calls
no test coverage detected