public override void Load(Container container, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd)
		{
			base.Load(container, gd);
			AddParticlesTrail(100, TimeSpan.FromSeconds(1.5), Color.White, (p) => {
				p.ParticleVelocityRandomizer = 0.4f;
			});
		}
Пример #2
0
		/// <summary>
		/// Initializes a new instance of the <see cref="GREATClient.BaseClass.Parallax"/> class.
		/// Be careful : If you put an image the same size as the world, the image won't move.
		/// </summary>
		/// <param name="worldSize">World size.</param>
		/// <param name="actions">Actions.</param>
		public Parallax()
        {
			Land = new Container();
			LandLength = 0;
			Fog = new Container();
			FogLength = 0;
			Cloud = new Container();
			CloudLength = 0;
			AddChild(Land,2);
			AddChild(Cloud,1);
			AddChild(Fog,3);
			//actions.OfType<Drawable>().ToList().ForEach((Drawable item) => AddChild(item));
        }
Пример #3
0
        public GameplayScreen(ContentManager content, Game game, Client client)
			: base(content, game)
        {
			Client = client;
			ChampionsInfo = new ChampionsInfo();

			GameTime = null;
			TimeSinceLastInputSent = 0.0;

			Match = new GameMatch(Path.Combine("Content", MapLoader.MAIN_MAP_PATH));
			LastStateUpdateData = new List<StateUpdateData>();
			RemarkableEvents = new List<RemarkableEventData>();
			Spells = new Dictionary<ulong, DrawableSpell>();
			TimeOfLastStateUpdate = 0.0;
			Champions = new List<ClientChampion>();

			GameWorld = new Container();
			Structures = new List<DrawableStructure>();

			Camera = new CameraService();
			Services.AddService(typeof(CameraService), Camera);

			((SoundService)Services.GetService(typeof(SoundService))).CameraService = Camera;

			Parallax = new Parallax();

			KillDisplay = new KillDisplay(ChampionsInfo);

			GameScore = new GameScore();

			Sound = (SoundService)Services.GetService(typeof(SoundService));
        }
Пример #4
0
        public ESCMenu()
        {
			State = MenuState.AllClosed;
			PlacementLayer = new Container();			
			MainBackgroundLayer = new Container();
			VideoBackgroundLayer = new Container();
			AudioBackgroundLayer = new Container();

			// Main
			MenuItem main1 = new MenuItem(new DrawableLabel() {Text = "Video settings", RelativeOrigin = new Vector2(0.5f,0.0f) }, 
				new DrawableLabel() {Text = "Video settings", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate},
				new DrawableLabel() {Text = "Video settings", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine}) 
			{ ClickAction = () => OpenVideo() };

			MenuItem main2 = new MenuItem(new DrawableLabel() {Text = "Audio settings" , RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Gray},
				new DrawableLabel() {Text = "Audio settings", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate},
				new DrawableLabel() {Text = "Audio settings", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine}) 
			{ /*ClickAction = () => OpenAudio()*/ };

			MenuItem main3 = new MenuItem(new DrawableLabel() {Text = "Return to Game", RelativeOrigin = new Vector2(0.5f,0.0f)},
				new DrawableLabel() {Text = "Return to Game", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate},
				new DrawableLabel() {Text = "Return to Game", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine}) 
			{ ClickAction = () => OpenOrCloseMainMenu(null,null) };

			MenuItem main4 = new MenuItem(new DrawableLabel() {Text = "Exit Game" , RelativeOrigin = new Vector2(0.5f,0.0f)},
				new DrawableLabel() {Text = "Exit Game", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate},
				new DrawableLabel() {Text = "Exit Game", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine}) 
			{ ClickAction = () => OpenExit() };

			MainMenu = new Menu(main1, main2, main3, main4);
			MainMenu.AlignItemsVertically(30f);
			MainMenu.AllowKeyboard = true;

			// Audio
			MenuItem audio1 = new MenuItem(new DrawableLabel() {Text = "Less boomboom", RelativeOrigin = new Vector2(0.5f,0.0f)},
				new DrawableLabel() {Text = "Less boomboom", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate},
				new DrawableLabel() {Text = "Less boomboom", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine});

			MenuItem audio2 = new MenuItem(new DrawableLabel() {Text = "More boomboom", RelativeOrigin = new Vector2(0.5f,0.0f) },
				new DrawableLabel() {Text = "More boomboom", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate},
				new DrawableLabel() {Text = "More boomboom", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine});

			MenuItem audio3 = new MenuItem(new DrawableLabel() { Text = "Return to Main Menu", RelativeOrigin = new Vector2(0.5f,0.0f) },
				new DrawableLabel() {Text = "Return to Main Menu", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate},
				new DrawableLabel() {Text = "Return to Main Menu", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine}) 
			{ ClickAction = () => OpenOrCloseMainMenu(null,null) };

			AudioMenu = new Menu(audio1,audio2,audio3);
			AudioMenu.AlignItemsVertically(30f);
			AudioMenu.AllowKeyboard = true;

			// Video
			MenuItem video1 = new MenuItem(new DrawableLabel() { Text = "Big Texture", RelativeOrigin = new Vector2(0.5f,0.0f) },
				new DrawableLabel() { Text = "Big Texture", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate },
				new DrawableLabel() { Text = "Big Texture", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine })
			{ ClickAction = () => screenService.GameWindowSize = screenService.ScreenSize };

			MenuItem video2 = new MenuItem(new DrawableLabel() { Text = "Small Texture", RelativeOrigin = new Vector2(0.5f,0.0f) },
				new DrawableLabel() { Text = "Small Texture", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate },
				new DrawableLabel() { Text = "Small Texture", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine })
			{ ClickAction = () => screenService.GameWindowSize = new Vector2(900,700) };

			MenuItem video25 = new MenuItem(new DrawableLabel() { Text = "Fullscreen", RelativeOrigin = new Vector2(0.5f,0.0f) },
				new DrawableLabel() { Text = "Fullscreen", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate },
				new DrawableLabel() { Text = "Fullscreen", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine })
			{ ClickAction = () => screenService.SwitchFullscreen() };

			MenuItem video3 = new MenuItem(new DrawableLabel() { Text = "Return to Main Menu", RelativeOrigin = new Vector2(0.5f,0.0f) },
				new DrawableLabel() { Text = "Return to Main Menu", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Chocolate },
				new DrawableLabel() { Text = "Return to Main Menu", RelativeOrigin = new Vector2(0.5f,0.0f), Tint = Color.Aquamarine }) 
			{ ClickAction = () => OpenOrCloseMainMenu(null,null) };

			VideoMenu = new Menu(video1,video2,video25,video3);
			VideoMenu.AlignItemsVertically(30f);
			VideoMenu.AllowKeyboard = true;

			// Exit
			MenuItem exit1 = new MenuItem(new DrawableLabel() { Text = "No" },
			                              new DrawableLabel() { Text = "Nice", Tint = Color.Chocolate },
			                              new DrawableLabel() { Text = "Nice", Tint = Color.Aquamarine }) 
			{ ClickAction = () => OpenOrCloseMainMenu(null,null) };

			MenuItem exit2 = new MenuItem(new DrawableLabel() { Text = "Yes" },
			                              new DrawableLabel() { Text = "Why", Tint = Color.Chocolate },
			                              new DrawableLabel() { Text = "Why", Tint = Color.Aquamarine }) {	
				ClickAction = () => {
					Screen s = GetScreen();
					if (s != null) {
						s.Exit = true;
					} else {
						Debug.Fail("It should has a screen");
					}
				}
			};


			//Exit
			ExitMenu = new Menu(exit1, exit2);
			ExitMenu.AlignItemsHorizontally(80);
			ExitMenu.AllowKeyboard = true;
			ExitMenu.Position = new Vector2(160,95);
			ExitLayer = new Container();
			ExitBackground = new DrawableImage("UIObjects/menuExit");
			ExitLayer.Visible = false;
			// Exit gear
			GearExit = new DrawableImage("UIObjects/menuGear");
			GearExit.Scale = new Vector2(0.9f, 0.9f);
			GearExit.RelativeOrigin = new Vector2(0.5f,0.5f);
			GearExit.Position = new Vector2(25,130);
			GearExit.PerformAction(new ActionSequence(-1,new ActionRotateBy(new TimeSpan(0,0,0,0,350),2,false), new ActionRotateBy(new TimeSpan(0,0,0,0,200),18,false), new ActionDelay(new TimeSpan(0,0,0,0,450))));
			GearExit2 = new DrawableImage("UIObjects/menuGear");
			GearExit2.Scale = new Vector2(0.8f, 0.8f);
			GearExit2.RelativeOrigin = new Vector2(0.5f,0.5f);
			GearExit2.Position = new Vector2(200,130);
			GearExit2.PerformAction(new ActionSequence(-1,new ActionRotateBy(new TimeSpan(0,0,0,0,350),2,false), new ActionRotateBy(new TimeSpan(0,0,0,0,200),18,false), new ActionDelay(new TimeSpan(0,0,0,0,450))));
			GearExitMini = new DrawableImage("UIObjects/menuGear");
			GearExitMini.Scale = new Vector2(0.6f, 0.6f);
			GearExitMini.RelativeOrigin = new Vector2(0.5f,0.5f);
			GearExitMini.Position = new Vector2(115,130);
			GearExitMini.PerformAction(new ActionSequence(-1,new ActionRotateBy(new TimeSpan(0,0,0,0,350),-2,false), new ActionRotateBy(new TimeSpan(0,0,0,0,200),-18,false), new ActionDelay(new TimeSpan(0,0,0,0,450))));

			//Main
			MainBackground = new DrawableImage("UIObjects/menu");
			MainBackgroundLayer.Visible = false;
			MainMenu.Position = new Vector2(100,25);
			// Main gear
			GearMain = new DrawableImage("UIObjects/menuGear");
			GearMain.RelativeOrigin = new Vector2(0.5f,0.5f);
			GearMain.Position = new Vector2(25,35);
			GearMain.PerformAction(new ActionSequence(-1,new ActionRotateBy(new TimeSpan(0,0,0,0,350),2,false), new ActionRotateBy(new TimeSpan(0,0,0,0,200),18,false), new ActionDelay(new TimeSpan(0,0,0,0,450))));
			GearMiniMain = new DrawableImage("UIObjects/menuGear");
			GearMiniMain.Scale = new Vector2(0.5f, 0.5f);
			GearMiniMain.RelativeOrigin = new Vector2(0.5f,0.5f);
			GearMiniMain.Position = new Vector2(13,115);
			GearMiniMain.PerformAction(new ActionSequence(-1,new ActionRotateBy(new TimeSpan(0,0,0,0,350),-2,false), new ActionRotateBy(new TimeSpan(0,0,0,0,200),-18,false), new ActionDelay(new TimeSpan(0,0,0,0,450))));

			//Audio
			AudioBackground = new DrawableImage("UIObjects/menuAudio");
			AudioBackgroundLayer.Visible = false;
			AudioMenu.Position = new Vector2(130,27);
			// Audio gear
			GearAudio = new DrawableImage("UIObjects/menuGear");
			GearAudio.RelativeOrigin = new Vector2(0.5f,0.5f);
			GearAudio.Position = new Vector2(130,35);
			GearAudio.PerformAction(new ActionSequence(-1,new ActionRotateBy(new TimeSpan(0,0,0,0,350),2,false), new ActionRotateBy(new TimeSpan(0,0,0,0,200),18,false), new ActionDelay(new TimeSpan(0,0,0,0,450))));

			//Video
			VideoBackground = new DrawableImage("UIObjects/menuVideo");
			VideoBackgroundLayer.Visible = false;
			VideoMenu.Position = new Vector2(150,25);
			//Gear
			GearVideo = new DrawableImage("UIObjects/menuGear");
			GearVideo.Scale = new Vector2(0.6f, 0.6f);
			GearVideo.RelativeOrigin = new Vector2(0.5f,0.5f);
			GearVideo.Position = new Vector2(290,130);
			GearVideo.PerformAction(new ActionSequence(-1,new ActionRotateBy(new TimeSpan(0,0,0,0,350),2,false), new ActionRotateBy(new TimeSpan(0,0,0,0,200),18,false), new ActionDelay(new TimeSpan(0,0,0,0,450))));
			// Gear2
			GearVideo2 = new DrawableImage("UIObjects/menuGear");
			GearVideo2.Scale = new Vector2(0.6f, 0.6f);
			GearVideo2.RelativeOrigin = new Vector2(0.5f,0.5f);
			GearVideo2.Position = new Vector2(250,170);
			GearVideo2.PerformAction(new ActionSequence(-1,new ActionRotateBy(new TimeSpan(0,0,0,0,350),-2,false), new ActionRotateBy(new TimeSpan(0,0,0,0,200),-18,false), new ActionDelay(new TimeSpan(0,0,0,0,450))));
		}
Пример #5
0
		public override void Load(Container container, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd)
		{
			base.Load(container, gd);
			AddParticlesTrail(120, TimeSpan.FromSeconds(0.8), Tint);
		}
Пример #6
0
		public override void Load(Container container, GraphicsDevice gd)
		{
			Parent = container;
			Content = Parent.Content;
			foreach (IDraw item in Children) {
				if (!item.Loaded) {
					item.Load(this,GetGraphics());
				}
			}
			OnLoad(Parent.Content, gd);
			Loaded = true;
		}
Пример #7
0
		public KillDisplay(ChampionsInfo championsInfo) {
			AddChild(Panel = new Container());
			Kills = new List<Kill>();
			KillsToBeAdded = new List<Kill>();
			KillsToRemove = new List<Kill>();
			ChampionsInfo = championsInfo;
        }
Пример #8
0
		/// <summary>
		/// Load the drawable object.
		/// </summary>
		/// <param name="container">Its container.</param>
		/// <param name="content">The content manager, used to draw.</param>
		public virtual void Load(Container container, GraphicsDevice gd)
		{
			Parent = container;
			OnLoad(Parent.Content, gd);

			if (PositionMode == PositionType.ScreenRelativeInPercent) {
				SetPositionInScreenPercent(XPercentOfTheScreen,YPercentOfTheScreen);
			} else if (PositionMode == PositionType.ScreenRelative) {
				SetPositionRelativeToScreen(Bound,ScreenBoundOffset);
			}

			Loaded = true;
		}