private static void RenderEntities(GameEngine engine, GraphicsRenderer renderer, GameTime gameTime, List <CoreAbstractEntity> entities, ClientMapTile onTile, float tileDrawX, float tileDrawY) { foreach (CoreAbstractEntity entity in entities) { EntityRenderer entityRenderer = EntityRenderers.Get(entity); entityRenderer.Render(engine, renderer, gameTime, entity, onTile, tileDrawX, tileDrawY); } }
//Use this to receive the message from the Server on the Client's side public void ReceiveMessage(NetworkMessage networkMessage) { //Read the message that comes in UpdateHostMessage hostMessage = networkMessage.ReadMessage <UpdateHostMessage>(); ClientMapTile tile = GameObject.Find(hostMessage.identifier).GetComponent <ClientMapTile>(); if (tile != null) { tile.NetworkUpdate(hostMessage.list); tile.SetTex(hostMessage.texture); } ((ClientMapBuilder)mapBuilder).AddTile(tile); }
internal static void Render(GameEngine engine, GraphicsRenderer renderer, GameTime gameTime, ClientMapTile tile, float x, float y) { SpriteAnimation tileAnimation = MapTileTextures.GetById(tile.Id); renderer.Render(tileAnimation, x, y, offsetY: tile.HeightOffset); }
internal static void Update(GameEngine engine, GameTime gameTime, ClientMapTile tile) { }
public override void Render(GameEngine engine, GraphicsRenderer renderer, GameTime gameTime, CoreAbstractEntity entity, ClientMapTile onTile, float drawX, float drawY) { // TODO: Temporary testing ClientPlayerUnit unit = (ClientPlayerUnit)entity; SpriteAnimation animation = unit.Textures.GetAnimation(PlayerUnitAnimationType.Idle); Vector2 position = unit.ScreenPosition; Color factionColor = unit.Player.FactionColor; float height = ClientMapTile.TILE_HEIGHT / 4 + unit.SpriteSize.Height - onTile.HeightOffset; renderer.Render(animation, position.X, position.Y, offsetY: -height, mask: factionColor); }
public abstract void Render(GameEngine engine, GraphicsRenderer renderer, GameTime gameTime, CoreAbstractEntity entity, ClientMapTile onTile, float drawX, float drawY);