public Vertex[] GetMapVertices(TextureAtlas atlas) { var vertices = new List<Vertex>(); for (var i = 0; i < Tiles.Length; i++) { //vertices.AddRange(Tiles[i].GetVertices(atlas)); } return vertices.ToArray(); }
public void Begin(TextureAtlas atlas, Camera camera) { if (_beginCalled) throw new Exception("Begin called twice without a call to end."); _atlas = atlas; _camera = camera; _blendState = BlendState.AlphaBlend; _sortMode = SpriteSortMode.None; _beginCalled = true; }
public void Initialize() { ActorFactory.AddComponent<TransformComponent>(); ActorFactory.AddComponent<SpriteComponent>(); ActorFactory.AddComponent<SpinnerComponent>(); var xml = File.ReadAllText(Data.Actors.AnimatedSquare); var doc = XDocument.Parse(xml); // create a bunch of Animated Squares for (int i = 0; i < 75; i++) { for (int j = 0; j < 75; j++) { var actor = ActorFactory.Create(doc); actor.TransformComponent.Move(i * 400, j * 400); Repository.Add(actor); } } SpriteBatch = new SpriteBatch(6000, new DefaultShader()); var tex = new Texture(); tex.Load(Data.Images.TerrainDebug); _atlas = new TextureAtlas(4, 4, tex, 64); }