public void ShowProximityInfo() { _proximityGiven = false; _proximityInfo.Text("Walk towards the stand to interact!", Input.mouseX - 250, Input.mouseY); _rectProximityInfo.Rect(Input.mouseX - 15, Input.mouseY - 30, 475, 50); foreach (AnimationSprite currentStand in LevelLoader.CollisionObjectList) { if (currentStand is MarketStand) { MarketStand stand = currentStand as MarketStand; if (stand.ProximityToStand) { _proximityGiven = true; } } } if (_proximityGiven && !_textOnceAdded) { AddChild(_rectProximityInfo); AddChild(_proximityInfo); _textOnceAdded = true; } else if (!_proximityGiven) { RemoveChild(_proximityInfo); RemoveChild(_rectProximityInfo); _textOnceAdded = false; } }
public HudSlider(int width, int height, float startValue = 1.0f, bool addCollider = true) : base(width, height, addCollider) { Clear(Color.DarkGray); _fore = new EasyDraw(width - 4, height - 4, false); _fore.SetOrigin(0, -_fore.height / 2f); _fore.Clear(Color.LightGray); AddChild(_fore); _fore.x = 2; _fore.y = -_fore.height * 0.5f + 2; _thumb = new EasyDraw(10, height, false); _thumb.Clear(Color.Aqua); _thumb.Fill(Color.White); _thumb.Stroke(Color.Black); _thumb.ShapeAlign(CenterMode.Min, CenterMode.Min); _thumb.Rect(0, 0, _thumb.width - 1, height - 1); AddChild(_thumb); _thumb.x = 0; _thumb.y = 0; _thumb.SetOrigin(_thumb.width * 0.5f, 0); }
private void CreateBlankScreen() { var blankScreen = new EasyDraw(Game.main.width, Game.main.height); blankScreen.NoStroke(); blankScreen.Fill(Color.Black); blankScreen.ShapeAlign(CenterMode.Min, CenterMode.Min); blankScreen.Rect(0, 0, blankScreen.width, blankScreen.height); AddChild(blankScreen); }
public Menu(string type, Color bgColor) { bg = new EasyDraw(game.width, game.height, false); bg.ShapeAlign(CenterMode.Min, CenterMode.Min); bg.Fill(bgColor); bg.Rect(0, 0, bg.width, bg.height); AddChild(bg); this.type = type; SetType(type); }