public LoadLevelMenuUIGrid( UIGridEvent onSelect, UIGridEvent onCancel, UIGridEvent onMoveLeft, UIGridEvent onMoveRight, string uiMode) : base(onSelect, onCancel, new Point(kWidth, 1), uiMode) { MovedLeft += onMoveLeft; MovedRight += onMoveRight; RenderEndsIn = true; // In order to get the shadows layering correctly. IgnoreFocusChanged = true; // No clicks on focus change. // Set up the blob for info common to all tiles. blob = new UIGridElement.ParamBlob(); blob.width = 2.0f; blob.height = 2.0f; blob.edgeSize = 0.2f; blob.selectedColor = Color.Black; blob.unselectedColor = Color.Black; blob.Font = UI2D.Shared.GetGameFont15_75; blob.textColor = Color.White; blob.dropShadowColor = Color.Transparent; blob.useDropShadow = true; blob.invertDropShadow = false; blob.normalMapName = null; baseOrients = new Orientation[kWidth] { new Orientation(new Vector3(-8 * ELEMENT_SPACING_X, 0.0f, 0.0f), 0.2f, 0.36f), new Orientation(new Vector3(-7 * ELEMENT_SPACING_X, 0.0f, 0.0f), 0.3f, 0.32f), new Orientation(new Vector3(-6 * ELEMENT_SPACING_X, 0.0f, 0.0f), 0.4f, 0.28f), new Orientation(new Vector3(-5 * ELEMENT_SPACING_X, 0.0f, 0.0f), 0.5f, 0.24f), new Orientation(new Vector3(-4 * ELEMENT_SPACING_X, 0.0f, 0.0f), 0.6f, 0.2f), new Orientation(new Vector3(-3 * ELEMENT_SPACING_X, 0.0f, 0.0f), 0.7f, 0.16f), new Orientation(new Vector3(-2 * ELEMENT_SPACING_X, -0.2f, 0.0f), 0.75f, 0.14f), new Orientation(new Vector3(-1 * ELEMENT_SPACING_X, -0.18f, 0.0f), 0.79f, 0.08f), new Orientation(new Vector3(0, 0.0f, 0.0f), 1.2f, 0.0f), new Orientation(new Vector3(1 * ELEMENT_SPACING_X, 0.1f, 0.0f), 0.79f, -0.1f), new Orientation(new Vector3(2 * ELEMENT_SPACING_X, 0.25f, 0.0f), 0.7f, -0.15f), new Orientation(new Vector3(3 * ELEMENT_SPACING_X, 0.4f, 0.0f), 0.63f, -0.19f), new Orientation(new Vector3(4 * ELEMENT_SPACING_X, 0.5f, 0.0f), 0.58f, -0.25f), new Orientation(new Vector3(5 * ELEMENT_SPACING_X, 0.47f, 0.0f), 0.52f, -0.3f), new Orientation(new Vector3(6 * ELEMENT_SPACING_X, 0.4f, 0.0f), 0.47f, -0.35f), new Orientation(new Vector3(7 * ELEMENT_SPACING_X, 0.4f, 0.0f), 0.42f, -0.4f), new Orientation(new Vector3(8 * ELEMENT_SPACING_X, 0.4f, 0.0f), 0.35f, -0.45f), new Orientation(new Vector3(9 * ELEMENT_SPACING_X, 0.4f, 0.0f), 0.3f, -0.5f), }; currentOrients = new Orientation[kWidth]; for (int i = 0; i < kWidth; i++) { currentOrients[i] = new Orientation(baseOrients[i]); } }
// c'tor /// <summary> /// Simple c'tor using a blob to hold the common data. /// </summary> /// <param name="blob"></param> /// <param name="label"></param> public ModularMenu(UIGridElement.ParamBlob blob, string title) { this.title = TextHelper.FilterInvalidCharacters(title); if (this.title == "") { this.title = null; } // blob this.width = blob.width; this.height = blob.height; this.edgeSize = blob.edgeSize; this.normalMapName = blob.normalMapName; this.justify = blob.justify; itemList = new List <MenuItem>(); }