public override void LoadContent() { base.LoadContent(); Sprite buttonSprite = Resources.GetSprite("button_idle"); Sprite[] buttonSpriteTab = new Sprite[] { buttonSprite, Resources.GetSprite("button_over"), Resources.GetSprite("button_pressed") }; font = Manager.Game.Content.Load<SpriteFont>("Fonts/Hud"); panel = new Panel(this, new Rectangle(0, 0, Manager.Width, Manager.Height), buttonSprite); submitButton = new Button(this, new Rectangle(0, 60, 100, 20), buttonSpriteTab) { Text = "Submit" }; panel.AddControl("submitButton", submitButton); addTileButton = new Button(this, new Rectangle(110, 60, 100, 20), buttonSpriteTab) { Text = "Add Tile" }; panel.AddControl("addSpriteButton", addTileButton); panel.AddControl("tileNameLabel", new TextBlock(this, new Vector2(0, 0), "Name :")); tileName = new TextBox(this, new Rectangle(100, 0, 140, 20), buttonSpriteTab); panel.AddControl("tileName", tileName); panel.AddControl("tileTypeLabel", new TextBlock(this, new Vector2(0, 25), "Type :")); tileType = new ListButton(this, new Rectangle(100, 25, 140, 20), buttonSprite, Tile.GetTileTypes().ToList()); panel.AddControl("tileType", tileType); panel.Pading = 10; Resize(Manager.Game.Viewport.Width, Manager.Game.Viewport.Height); }
public override void LoadContent() { base.LoadContent(); Sprite buttonSprite = Resources.GetSprite("button_idle"); Sprite[] buttonSpriteTab = new Sprite[] { buttonSprite, Resources.GetSprite("button_over"), Resources.GetSprite("button_pressed") }; font = Manager.Game.Content.Load<SpriteFont>("Fonts/Hud"); panel = new Panel(this, new Rectangle(0, 0, Manager.Width, Manager.Height), buttonSprite); string root = Manager.Game.Content.RootDirectory; tree = new FileTree(this, new Rectangle(0, 0, 100, 100), null, root, ".png") { Pading = 10 }; panel.AddControl("Tree", tree); int treeWidth = tree.PreferableWidth; int treeHeight = tree.PreferableHeight; tree.Bound = new Rectangle(0, 0, treeWidth, treeHeight); submitButton = new Button(this, new Rectangle(0, treeHeight + 30, 100, 20), buttonSpriteTab) { Text = "Submit" }; panel.AddControl("submitButton", submitButton); addSpriteButton = new Button(this, new Rectangle(treeWidth + 200, treeHeight + 30, 100, 20), buttonSpriteTab) { Text = "Add Sprite" }; panel.AddControl("addSpriteButton", addSpriteButton); addSpriteText = new TextBox(this, new Rectangle(treeWidth + 60, treeHeight + 30, 140, 20), buttonSpriteTab); panel.AddControl("addSpriteText", addSpriteText); textureDrawer = new TextureDrawer(this, new Rectangle(treeWidth, 10, 300, treeHeight - 10), null) { SelectionMode = true, SelectPointMode = true }; panel.AddControl("textureDrawer", textureDrawer); coordinate = new TextBlock(this, new Vector2(100, treeHeight + 30), ""); panel.AddControl("coordinate", coordinate); panel.Pading = 10; Resize(Manager.Game.Viewport.Width, Manager.Game.Viewport.Height); }
public SearchableList(Screen screen, Rectangle bound, Sprite background, Sprite[] searchSprite, SpriteFont font) : base(screen) { list = new List<TextBlock>(); searchBar = new TextBox(Screen, Rectangle.Empty, searchSprite) { Parent = this }; stack = new Stack(Screen) { Parent = this }; Bound = bound; SelectedItem = null; this.background = background; this.font = font; }
public override void LoadContent() { base.LoadContent(); Sprite buttonSprite = Resources.GetSprite("button_idle"); Sprite[] buttonSpriteTab = new Sprite[] { buttonSprite, Resources.GetSprite("button_over"), Resources.GetSprite("button_pressed") }; font = Manager.Game.Content.Load<SpriteFont>("Fonts/Hud"); panel = new Panel(this, new Rectangle(0, 0, Manager.Width, Manager.Height), buttonSprite); spriteLib = new SearchableList(this, new Rectangle(0, 0, 200, 400), buttonSprite, buttonSpriteTab, font) { Pading = 5 }; panel.AddControl("spriteLib", spriteLib); foreach (KeyValuePair<string, Sprite> pair in Resources.Sprites) spriteLib.AddToList(pair.Key); spriteSelected = new SearchableList(this, new Rectangle(400, 0, 200, 300), buttonSprite, buttonSpriteTab, font) { Pading = 5 }; panel.AddControl("spriteSelected", spriteSelected); textureDrawerLib = new TextureDrawer(this, new Rectangle(200, 0, 200, 200), null); panel.AddControl("textureDrawerLib", textureDrawerLib); textureDrawerSelected = new TextureDrawer(this, new Rectangle(600, 0, 200, 200), null); panel.AddControl("textureDrawerSelected", textureDrawerSelected); submitButton = new Button(this, new Rectangle(0, 410, 100, 20), buttonSpriteTab) { Text = "Submit" }; panel.AddControl("submitButton", submitButton); addAnimationButton = new Button(this, new Rectangle(350, 410, 100, 20), buttonSpriteTab) { Text = "Add Animation" }; panel.AddControl("addSpriteButton", addAnimationButton); toLeftButton = new Button(this, new Rectangle(285, 255, 30, 30), buttonSpriteTab) { Text = " <-" }; panel.AddControl("toLeftButton", toLeftButton); toRightButton = new Button(this, new Rectangle(285, 220, 30, 30), buttonSpriteTab) { Text = " ->" }; panel.AddControl("toRightButton", toRightButton); toUpButton = new Button(this, new Rectangle(340, 220, 30, 30), buttonSpriteTab) { Text = "Up" }; panel.AddControl("toUpButton", toUpButton); toDownButton = new Button(this, new Rectangle(340, 255, 30, 30), buttonSpriteTab) { Text = "Down" }; panel.AddControl("toDownButton", toDownButton); frameTimeLabel = new TextBlock(this, new Vector2(400, 305), "FrameTime :"); panel.AddControl("frameTimeLabel", frameTimeLabel); frameTimeTextBox = new TextBox(this, new Rectangle(520, 305, 80, 20), buttonSpriteTab); panel.AddControl("frameTimeText", frameTimeTextBox); panel.AddControl("effectButtonLabel", new TextBlock(this, new Vector2(400, 325), "Effect :")); effectButton = new ListButton(this, new Rectangle(470, 325, 130, 20), buttonSprite, new List<string>() { "None", "FlipVertically", "FlipHorizontally", "FlipBoth" }); panel.AddControl("effectButton", effectButton); addSpriteText = new TextBox(this, new Rectangle(210, 410, 140, 20), buttonSpriteTab); panel.AddControl("addSpriteText", addSpriteText); panel.Pading = 10; Resize(Manager.Game.Viewport.Width, Manager.Game.Viewport.Height); }