public override void draw(GameTime gameTime, AbstractGameState gameState, SpriteBatch spriteBatch) { foreach (int entityId in entityIds[0]) { Entity entity = entityManager.getEntity(entityId); StatusDrawComponent statusDrawComponent = entity.getComponent<StatusDrawComponent>(); LocationComponent locationComponent = entity.getComponent<LocationComponent>(); for (int i = 0; i < statusDrawComponent.getCount(); i++) { Tuple<string, Color, long, long> entry = statusDrawComponent.getEntry(i); DrawStringHelper.drawStringGame(spriteBatch, entry.Item1, "mentone", 10, entry.Item2 * MathHelper.SmoothStep(0, 1.5f, (float)statusDrawComponent.getMillisLeft()[i] / statusDrawComponent.millisToDisplays[i]), locationComponent.getCurrentLocation() + GeometryHelper.rotateVec( new Vector2(15, 15 + MathHelper.SmoothStep(35, 0, (float)statusDrawComponent.getMillisLeft()[i]/statusDrawComponent.millisToDisplays[i])), gameState.getCamera().getRotation()), gameState.getCamera().getRotation() + (float) Math.PI); } } }
public override void draw(GameTime gameTime, AbstractGameState gameState, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch) { if (entityIds[0].count() != 0) { TrackingComponent tracking = entityManager.getEntity(entityIds[0].getLast()) .getComponent<TrackingComponent>(); MouseState mouseState = Mouse.GetState(); SpriteBatchWrapper.DrawGame(EditorContent.blank, new Rectangle(100, 75, 5, 5), Color.Red); DrawStringHelper.drawStringUI(spriteBatch, gameState.getCamera().translateToUI(new Vector2(100,75)).ToString(), "mentone", 12, Color.White, new Vector2(300, 10)); DrawStringHelper.drawStringUI(spriteBatch, tracking.getTrackingLocation().ToString(), "mentone", 12, Color.White, new Vector2(300, 40)); } }
public override void update(GameTime gameTime, AbstractGameState gameState) { if (entityIds[0].count() != 0) { gameState.getCamera().setDesiredZoom(1f); TrackingComponent tracking = entityManager.getEntity(entityIds[0].getLast()) .getComponent<TrackingComponent>(); gameState.getCamera().setDesiredWorldPosition(tracking.getTrackingLocation()); gameState.getCamera().setDesiredTrackingRotation(tracking.getTrackingRotation()); } else { gameState.getCamera().setDesiredZoom(0.75f); gameState.getCamera().setDesiredRotation(0); gameState.getCamera().setDesiredWorldPosition(Vector2.Zero); } }