public override void Update(GameTime gameTime) { if (!IsJoin) { joinButton.Update(gameTime); for (int i = 0; i < box.Count; i++) { if (MouseManager.IsInRectangle(box[i].Bound) && MouseManager.IsClicking()) { box[boxselect].IsSelect = false; boxselect = i; box[i].IsSelect = true; } } box[boxselect].Write(KeyboardManager.RecupClavier()); if (KeyboardManager.IsPressed(Keys.Back)) { box[boxselect].RemoveLast(); } } else { box[3].RemoveAll(); for (int i = 0; i < client.OtherPlayers.Count; i++) { box[3].WriteLine(client.OtherPlayers[i].name + ""); } } }
public virtual void Update(GameTime gameTime) { if (MouseManager.IsInRectangle(Bounds) && MouseManager.IsLeftClicked()) { OnMouseClick(new MouseClickEventArgs(0, MouseManager.Position)); } if (MouseManager.IsClicking() && MouseManager.Position.Y <= Bounds.Bottom && MouseManager.Position.Y >= Bounds.Y) { OnSlideAxeX(new MouseClickEventArgs(0, MouseManager.Position)); } }
public override void Update(GameTime gameTime) { if (MouseManager.IsInRectangle(Bounds) && MouseManager.IsClicking()) { isMoving = true; } if (!MouseManager.IsClicking()) { isMoving = false; } if (isMoving) { Position = MoveWindow(Position); } Bounds = new Rectangle((int)Position.X, (int)Position.Y, texture.Width, texture.Height); }
public override void Draw(GameTime gameTime, UberSpriteBatch spriteBatch) { if (texture == null) { spriteBatch.DrawUI(MouseManager.IsInRectangle(Bounds) && !MouseManager.IsClicking() ? TexturesManager.Zoom : TexturesManager.Menu, text, Position, MouseManager.IsInRectangle(Bounds) ? Color.Red : Color.White); } else if (SlideSize == 0) { spriteBatch.DrawUI(texture, Position, MouseManager.IsInRectangle(Bounds) ? Color.Gray : Color.White); } else { spriteBatch.DrawUI(TexturesManager.SlideBar, new Rectangle((int)BoundLeft, (int)Position.Y, SlideSize + TexturesManager.MovingCursor.Width - 1, TexturesManager.MovingCursor.Height)); spriteBatch.DrawUI(texture, Position, MouseManager.IsInRectangle(Bounds) ? Color.Gray : Color.White); } }
public override void Update(GameTime gameTime) { if (isCreate) { StartButton.Update(gameTime); box[2].RemoveAll(); for (int i = 0; i < localClient.OtherPlayers.Count; i++) { box[2].WriteLine(localClient.OtherPlayers[i].name + ""); } if (gameTime.TotalGameTime.TotalMilliseconds % 500 < 10) { serveur.SendToAll(); } //box[2].WriteLine(Convert.ToString(serveur.Clients.Count)); } else { createButton.Update(gameTime); for (int i = 0; i < box.Count; i++) { if (MouseManager.IsInRectangle(box[i].Bound) && MouseManager.IsClicking()) { box[boxselect].IsSelect = false; boxselect = i; box[i].IsSelect = true; } } box[boxselect].Write(KeyboardManager.RecupClavier()); if (KeyboardManager.IsPressed(Keys.Back)) { box[boxselect].RemoveLast(); } } }