public HistoricImageHud(string historyFileName) : base("data/White Texture.png", true, false) { var bg = new EasyDraw(game.width, game.height, false); bg.Clear(Color.FromArgb(0, Color.Black)); AddChild(bg); _mainImage = new Sprite(historyFileName, true, false); AddChild(_mainImage); //_mainImage.scale = 0.5f; _mainImage.SetOriginToCenter(); _mainImage.SetXY(MyGame.HALF_SCREEN_WIDTH, MyGame.HALF_SCREEN_HEIGHT); DrawableTweener.TweenSpriteAlpha(_mainImage, 0, 1, 400, Easing.Equation.CubicEaseOut); var textBg = new EasyDraw(game.width, 30, false); textBg.Clear(Color.Black); AddChild(textBg); textBg.SetXY(0, game.height - 30); var pressToContinueText = new DebugTextBox("Press Esc to continue", game.width, 30, 0xffffff, 0x00010101, CenterMode.Center, CenterMode.Center); AddChild(pressToContinueText); pressToContinueText.SetXY(0, game.height - 30); DrawableTweener.Blink(pressToContinueText, 1, 0, 400); }
public ClickablePiece(string fileName, Vec2 position, int ID) : base(fileName, position, 9, 1) { _id = ID; _selection = new EasyDraw(width + _selectionStrokeWidth * 2, height + _selectionStrokeWidth * 2); AddChild(_selection); _selection.SetOrigin(width / 2, height / 2); _selection.SetXY(-_selectionStrokeWidth / 2, -_selectionStrokeWidth / 2); }
private void selection() { _selection.Clear(Color.Transparent); _selection.NoFill(); _selection.Stroke(_rainbow); _selection.StrokeWeight(5); _selection.ShapeAlign(CenterMode.Min, CenterMode.Min); _selection.Rect(0, 0, width + _selectionStrokeWidth / 2, height + _selectionStrokeWidth / 2); if (_hover) { float scaleDelta = _sizeOnHover - 1; float newScale = 1 - scaleDelta; _selection.scale = newScale; _selection.SetXY(-_selectionStrokeWidth, -_selectionStrokeWidth); } else { _selection.scale = 1.0f; _selection.SetXY(-_selectionStrokeWidth / 2, -_selectionStrokeWidth / 2); } }