public DamageStarVFX(int damageDisplayed, Vector2 position) { DamageDisplayed = UtilityGlobals.Clamp(damageDisplayed, BattleGlobals.MinDamage, BattleGlobals.MaxDamage); Position = position; if (DamageDisplayed <= 0) { MaxScale = new Vector2(.3f, .3f); } StarHalfLeft = new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Battle/BattleGFX.png"), new Rectangle(305, 809, 31, 58)); StarHalfRight = StarHalfLeft.Copy(); }
private void SetUpGrid() { //Create the grid PowerLiftGrid = new UIGrid(ActionCmd.NumColumns, ActionCmd.NumRows, ActionCmd.LiftGridCellSize); //Populate the grid based on how many columns and rows it has int totalSize = PowerLiftGrid.MaxElementsInGrid; for (int i = 0; i < totalSize; i++) { //Small cursors are on the grid PowerLiftGrid.AddGridElement(new UIFourPiecedTex(SmallCursor.Copy(), SmallCursor.WidthHeightToVector2(), .5f, Color.White)); } //Although the grid is drawn on the UI layer, we center it using the sprite layer's (0, 0) position for ease PowerLiftGrid.Position = Camera.Instance.SpriteToUIPos(Vector2.Zero); PowerLiftGrid.ChangeGridPivot(UIGrid.GridPivots.Center); Vector2 paddingSize = ActionCmd.LiftGridCellSize / 2; PowerLiftGrid.ChangeGridPadding(0, (int)paddingSize.X, 0, (int)paddingSize.Y); PowerLiftGrid.Spacing = ActionCmd.LiftGridSpacing; }