// constructor // @params: item icon, optional text public PieMenuSlice(Object menuItem, Texture2D iconTexture, UI2D.Shared.GetFont font, string displayText) { int textWidth = 80; Debug.Assert(iconTexture != null || font != null); this.menuItem = menuItem; this.texture = iconTexture; this.font = font; this.label = displayText; this.textBlob = new TextBlob(font, displayText, textWidth); this.sliceType = PieSelector.SliceType.single; }
public PieMenuSlice(PieRecipeItem recipe) { this.menuItem = recipe.menuItem; this.texture = recipe.texture; this.font = recipe.font; this.label = recipe.label; if (recipe.subList == null || recipe.subList.Count == 0) { this.sliceType = PieSelector.SliceType.single; } else { this.sliceType = PieSelector.SliceType.group; } }
public RenderPieSlice(float innerRadius, float outerRadius, float arcLength, PieSelector.SliceType sliceType) : base(innerRadius, outerRadius, arcLength, sliceType) { CreateGeometry(BokuGame.bokuGame.GraphicsDevice); }
private RenderPieSlice BuildPieSlice(PieSelector.SliceType type, float arcLen, float innnerRad, float outerRad) { RenderPieSlice pieSlice = new RenderPieSlice(innnerRad, outerRad, arcLen, type); return(pieSlice); }