/// <summary> /// The constructor for this selector. /// </summary> public ScreenTextureSelector(Engine engine, Screen screen) : base(screen) { // Adds the page forward and back buttons to the screen. int _buttonHeight = screen.GetTotalElementHeight(); ScreenButton _but = new ScreenButton(screen, "Back", "<", engine.FontMain); _but.Position.X = Screen.boarderSize; _but.Size.X = 32; _but.Position.Y = _buttonHeight; screen.ElementList.Add(_but); _but = new ScreenButton(screen, "Forward", ">", engine.FontMain); _but.Position.X = Screen.boarderSize + 32 + Screen.boarderSize; _but.Size.X = 32; _but.Position.Y = _buttonHeight; screen.ElementList.Add(_but); // Creates a new input field and adds it to the screen. this.InputField = new ScreenInput(screen, engine.FontMain); screen.AddElement(InputField); // Resizes and places the bread and butter of this element. this.Position.Y = screen.GetTotalElementHeight(); this.Size.Y = 128; // Determines the max rows and columns that will fit. this.PrevMaximumColumns = (int)Math.Floor(Size.X / TilePreviewSize); this.PrevMaximumRows = (int)Math.Floor(Size.Y / TilePreviewSize); // Creates new lists to display. FilterTiles(engine); }
public SaveLoadBlockset(Engine engine, BlockPlacer parentScreen) : base("Save or Load Prompt") { DemandPriority = true; text = new ScreenText(this, "Type in the name of this set below.", engine.FontMain); AddElement(text); input = new ScreenInput(this, engine.FontMain); input.InputString = engine.room.BlockSet.Name; AddElement(input); AddElement(new ScreenButton(this, "Save", engine.FontMain)); AddElement(new ScreenButton(this, "Load", engine.FontMain)); AddCloseButton(engine); this.parentScreen = parentScreen; }
public InputPrompt(Engine engine, Screen parentScreen, String title, String text, String startText, bool CloseButton) : base(title) { DemandPriority = true; AddText(text, engine.FontMain); input = new ScreenInput(this, engine.FontMain); input.InputString = startText; AddElement(input); AddElement(new ScreenButton(this, "OK", engine.FontMain)); this.parentScreen = parentScreen; if (CloseButton) AddCloseButton(engine); Center(engine); }
public LightSettings(Engine engine, LevelEditor ParentScreen) : base("Light Settings") { this.Size = new Vector2(256, 256); this.ParentScreen = ParentScreen; ParentScreen.RestrictZ = false; AddCloseButton(engine); ParentScreen.StackBlocks = false; ParentScreen.StackButton.Tex = engine.textureManager.Dic["stack_off_button"]; AddText("Click in 3D space to place sun.", engine.FontMain); LightIntensityBox = new ScreenInput(this, engine.FontMain, "IntensityInput"); AddElement(LightIntensityBox); AmbienceBox = new ScreenInput(this, engine.FontMain, "AmbienceInput"); AddElement(AmbienceBox); PictureTop = this.GetTotalElementHeight(); this.Size = new Vector2(256, PictureTop + 256); LightIntensityBox.InputString = engine.primManager.myEffect.LightIntensity.ToString(); AmbienceBox.InputString = engine.primManager.myEffect.Ambience.ToString(); }
/// <summary> /// The constructor for this selector. /// </summary> public ScreenTextureSelector(Engine engine, Screen screen) : base(screen) { // Adds the page forward and back buttons to the screen. int _buttonHeight = screen.GetTotalElementHeight(); ScreenButton _but = new ScreenButton(screen, "Back", "<", engine.FontMain); _but.Position.X = Screen.boarderSize; _but.Size.X = 32; _but.Position.Y = _buttonHeight; screen.ElementList.Add(_but); _but = new ScreenButton(screen, "Forward", ">", engine.FontMain); _but.Position.X = Screen.boarderSize + 32 + Screen.boarderSize; _but.Size.X = 32; _but.Position.Y = _buttonHeight; screen.ElementList.Add(_but); // Creates a new input field and adds it to the screen. this.InputField = new ScreenInput(screen, engine.FontMain); screen.AddElement(InputField); // Resizes and places the bread and butter of this element. this.Position.Y = screen.GetTotalElementHeight(); this.Size.Y = 128; // Determines the max rows and columns that will fit. this.PrevMaximumColumns = (int)Math.Floor(Size.X / TilePreviewSize); this.PrevMaximumRows = (int)Math.Floor(Size.Y / TilePreviewSize); // Creates new lists to display. FilterTiles(engine); }
/// <summary> /// Constructs a block selector window. /// </summary> public BlockPlacer(Engine engine, LevelEditor parentEditor) : base("Block Selector") { this.parentEditor = parentEditor; ScreenButton _but = new ScreenButton(this, "Back", "<", engine.FontMain); _but.Position.X = boarderSize; _but.Size.X = 32; ElementList.Add(_but); _but = new ScreenButton(this, "Forward", ">", engine.FontMain); _but.Position.X = boarderSize + 32 + boarderSize; _but.Size.X = 32; _but.Position.Y = headerSize + boarderSize; ElementList.Add(_but); _but = new ScreenButton(this, "New Block", "New", engine.FontMain); _but.Position.X = boarderSize + 32 + boarderSize + 32 + boarderSize; _but.Size.X = 48; _but.Position.Y = headerSize + boarderSize; ElementList.Add(_but); _but = new ScreenButton(this, "Edit Block", "Edit", engine.FontMain); _but.Position.X = boarderSize + 32 + boarderSize + 32 + boarderSize + 48 + boarderSize; _but.Size.X = 48; _but.Position.Y = headerSize + boarderSize; ElementList.Add(_but); _but = new ScreenButton(this, "Save/Load", "Sv/Ld", engine.FontMain); _but.Position.X = boarderSize + 32 + boarderSize + 32 + boarderSize + 48 + boarderSize + 48 + boarderSize; _but.Size.X = 48; _but.Position.Y = headerSize + boarderSize; ElementList.Add(_but); InputField = new ScreenInput(this, engine.FontMain); AddElement(InputField); PrevPosition = new Vector2((Size.X - PrevBoxWidth * PrevMaximumColumns) / 2, GetTotalElementHeight()); this.Size.Y = PrevPosition.Y + Screen.boarderSize + PrevMaximumRows * PrevBoxHeight; FilterBlocks(engine); this.Position = new Vector2(engine.windowSize.X - this.Size.X, 0); }