public Pause(ContentManager content, GraphicsDevice gd, Viewport view) { this.resume = new TextButton("Resume", content, 50, 110, 80, 50, gd); this.menu = new TextButton("Menu", content, 50, 170, 50, 50, gd); this.font = content.Load <SpriteFont>("Font"); this.color = Div.getTexture(gd, (int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, view.Width, view.Height); }
public MapSelection(ContentManager content, GraphicsDevice gd, Gui parent, string Path) : base(content, gd) { this.gui = parent; this.buttonSpace = 66; this.buttonSize = 64; this.holder = Directory.EnumerateFiles(Path); this.Maps = new Dictionary <TextButton, string>(); this.background = Div.getTexture(gd, (int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, gd.Viewport.Width, gd.Viewport.Height); this.GetGrid(); this.GetButtons(gd); }
public TileButton( int x, int y, int width, int height, TileType tileType, ContentManager content, GraphicsDevice gd) : base(x, y, 256, 256) { this.Instil(content, tileType); //GraphicsDevice gd = new GraphicsDevice(adapter, graphicsProfile, PresentationParameters) this.tipBox = Div.getTexture(gd, 80, 156, 180, 300, 100); this.tipBoxLocation = new Vector2((float)(gd.Viewport.Width / 2 - 150), 0.0f); this.font = content.Load <SpriteFont>("Font"); this.tipText = this.tile.TileType.ToString() + "\nCollison:" + this.tile.Collision.ToString() + "\nSpawn:" + this.tile.Spawn.HasValue.ToString() + "\nDamage:" + this.tile.Damage.HasValue.ToString(); }
public Particle( Vector2 particleLocation, int particleCount, float speed, float?lifespan, float lifeParticle, int size, float degreeRange, double sprayAngle, Color color) { //this.gd = new GraphicsDevice(); this.particleLocation = particleLocation; this.speed = speed; this.life = lifespan; this.partileLife = lifeParticle; this.size = size; this.degreeRange = degreeRange; this.sprayAngle = sprayAngle; this.startColor = color; this.endColor = new Color((int)this.startColor.R, (int)this.startColor.G, (int)this.startColor.B, 50); this.particle = Div.getTexture(this.gd, (int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, size, size); this.particles = new Part[particleCount]; }
private void GetEdge() { this.lineHorizontal = Div.getTexture(this.game.GraphicsDevice, 0, 0, 0, (this.TileX + 1) * 256 + 2, 20); this.lineVertical = Div.getTexture(this.game.GraphicsDevice, 0, 0, 0, 20, (this.TileY + 1) * 256 + 2); }
public void Instil(ContentManager content, GraphicsDevice gd, EditMap map, Game1 parent) { this.mode = EditorMode.Editor; this.mapSelection = new MapSelection(content, gd, this, "Content/Map"); this.map = map; this.content = content; this.currentPath = "TestMap.amf"; this.parentGame = parent; this.view = gd.Viewport; this.lights = false; this.buttons = new List <Button>(); this.tabOneButton = new TextButton("One", content, 2, 990, 64, 64, gd); this.tabOneButton.click += new Button.ClickHandler(this.TabOneClick); this.buttons.Add((Button)this.tabOneButton); this.tabTwoButton = new TextButton("One", content, 68, 990, 64, 64, gd); this.tabTwoButton.click += new Button.ClickHandler(this.TabTwoClick); this.buttons.Add((Button)this.tabTwoButton); this.tabTwoButton = new TextButton("Two", content, 68, 990, 64, 64, gd); this.tabTwoButton.click += new Button.ClickHandler(this.TabTwoClick); this.buttons.Add((Button)this.tabTwoButton); this.tabThreeButton = new TextButton("Three", content, 134, 990, 64, 64, gd); this.tabThreeButton.click += new Button.ClickHandler(this.TabThreeClick); this.buttons.Add((Button)this.tabThreeButton); this.SaveButton = new TextButton("Save", content, this.view.Width - 66, this.view.Height - 66, 64, 64, gd); this.SaveButton.click += new Button.ClickHandler(this.SaveClick); this.buttons.Add((Button)this.SaveButton); this.OpenButton = new TextButton("Open", content, this.view.Width - 66, this.view.Height - 132, 64, 64, gd); this.OpenButton.click += new Button.ClickHandler(this.OpenClick); this.buttons.Add((Button)this.OpenButton); this.SaveAsButton = new TextButton("Save \nAs", content, this.view.Width - 66, this.view.Height - 198, 64, 64, gd); this.SaveAsButton.click += new Button.ClickHandler(this.SaveAsClick); this.buttons.Add((Button)this.SaveAsButton); this.NewButton = new TextButton("New", content, this.view.Width - 66, this.view.Height - 264, 64, 64, gd); this.NewButton.click += new Button.ClickHandler(this.NewClick); this.buttons.Add((Button)this.NewButton); this.PlayButton = new TextButton("Play", content, this.view.Width - 66, this.view.Height - 330, 64, 64, gd); this.PlayButton.click += new Button.ClickHandler(this.PlayClick); this.buttons.Add((Button)this.PlayButton); this.LightButton = new TextButton("Light", content, this.view.Width - 66, this.view.Height - 396, 64, 64, gd); this.LightButton.click += new Button.ClickHandler(this.LightClick); this.buttons.Add((Button)this.LightButton); this.ShadeButton = new TextButton("Shade", content, this.view.Width - 66, this.view.Height - 462, 64, 64, gd); this.ShadeButton.click += new Button.ClickHandler(this.ShadeClick); this.buttons.Add((Button)this.ShadeButton); this.CleanButton = new TextButton("Clean", content, this.view.Width - 66, this.view.Height - 528, 64, 64, gd); this.CleanButton.click += (Button.ClickHandler)((sender, e) => map.CleanMap()); this.buttons.Add((Button)this.CleanButton); this.mapArea = new AreaButton(332, 0, this.view.Width - 400, this.view.Height); this.mapArea.click += new AreaButton.ClickHandler(this.AreaClick); this.mapArea.rightClick += new AreaButton.RightClickHandler(this.RightAreaClick); this.currentPlaceable = (Placeable)map.tileFactory.GetTile(TileType.Metal, 0.0f, 0.0f, false, false, false, false); this.currentTexture = this.currentPlaceable.GetTexture(); this.enumNames = Enum.GetNames(typeof(TileType)); this.tabOneButtons = new List <PlaceableButton>(); this.tabTwoButtons = new List <PlaceableButton>(); this.tabThreeButtons = new List <PlaceableButton>(); this.tabOneButtons = this.GetTab(0, this.enumNames.Length, gd); this.tabTwoButtons = this.GetPickUpTab(); this.tabThreeButtons = this.GetDecorationTab(); this.currentTab = new List <Button>(); foreach (Button tabOneButton in this.tabOneButtons) { this.currentTab.Add(tabOneButton); } this.buttonArea = Div.getTexture(gd, (int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue, 332, 992); }