public LoadingPrimitive(Game game) { Material = GetMaterial(game); var verticies = GetVerticies(game); VertexBuffer = new VertexBuffer(game.GraphicsDevice, typeof(VertexPositionTexture), verticies.Length, BufferUsage.WriteOnly); VertexBuffer.SetData(verticies); }
virtual protected VertexPositionTexture[] GetVerticies(Game game) { var dd = (float)Material.TextureWidth / 2; return(new[] { new VertexPositionTexture(new Vector3(-dd - 0.5f, +dd + 0.5f, -3), new Vector2(0, 0)), new VertexPositionTexture(new Vector3(+dd - 0.5f, +dd + 0.5f, -3), new Vector2(1, 0)), new VertexPositionTexture(new Vector3(-dd - 0.5f, -dd + 0.5f, -3), new Vector2(0, 1)), new VertexPositionTexture(new Vector3(+dd - 0.5f, -dd + 0.5f, -3), new Vector2(1, 1)), }); }
protected override VertexPositionTexture[] GetVerticies(Game game) { int w = game.RenderProcess.DisplaySize.X; int h = game.RenderProcess.DisplaySize.Y / 80; float x = -w / 2 - 0.5f; float y = game.RenderProcess.DisplaySize.Y / 2 - h - 0.5f; return(new[] { new VertexPositionTexture(new Vector3(x + 0, -y - 0, -1), new Vector2(0, 0)), new VertexPositionTexture(new Vector3(x + w, -y - 0, -1), new Vector2(1, 0)), new VertexPositionTexture(new Vector3(x + 0, -y - h, -1), new Vector2(0, 1)), new VertexPositionTexture(new Vector3(x + w, -y - h, -1), new Vector2(1, 1)), }); }
protected override VertexPositionTexture[] GetVerticies(Game game) { float w, h; w = Material.TextureWidth; h = Material.TextureHeight; if (w != 0 && h != 0) { var scaleX = (float)game.RenderProcess.DisplaySize.X / w; var scaleY = (float)game.RenderProcess.DisplaySize.Y / h; var scale = scaleX < scaleY ? scaleX : scaleY; w = w * scale / 2; h = h * scale / 2; } return(new[] { new VertexPositionTexture(new Vector3(-w - 0.5f, +h + 0.5f, -2), new Vector2(0, 0)), new VertexPositionTexture(new Vector3(+w - 0.5f, +h + 0.5f, -2), new Vector2(1, 0)), new VertexPositionTexture(new Vector3(-w - 0.5f, -h + 0.5f, -2), new Vector2(0, 1)), new VertexPositionTexture(new Vector3(+w - 0.5f, -h + 0.5f, -2), new Vector2(1, 1)), }); }
virtual protected LoadingMaterial GetMaterial(Game game) { return(new LoadingMaterial(game)); }
protected override LoadingMaterial GetMaterial(Game game) { return(new LoadingScreenMaterial(game)); }
public LoadingScreenPrimitive(Game game) : base(game) { }
public LoadingBarPrimitive(Game game) : base(game) { }
public static void Initialize(Game game) { inputSettings = game.Settings.Input; Raildriver = new UserInputRailDriver(game); }
protected virtual Texture2D GetTexture(Game game) { return(SharedTextureManager.Get(game.RenderProcess.GraphicsDevice, Path.Combine(game.ContentPath, "Loading.png"))); }
public LoadingMaterial(Game game) : base(game.GraphicsDevice) { shader = new LoadingShader(game.RenderProcess.GraphicsDevice); texture = GetTexture(game); }