//interpret mouse click public Action interpretClick(Globals G, HudManager HM) { Action A = null; Point P = new Point(G.mouseX, G.mouseY); Point size = new Point(1, 1); Rectangle mousePos = new Rectangle(P, size); int i = 0; //first and foremost, did we click on a hud element??? for (i = 0; i < HM.hudGraphicsCount(); i++) { if (HM.getGraphicAt(i).getClickBox().Intersects(mousePos)) { A = HM.getGraphicAt(i).getAction(); A.setIndex(i); } } return(A); }
public void gameInit() { populateTextureManager(); //defaultFont = Content.Load<SpriteFont>("Arial"); DT = new DateTime(); M = new map("no bias", TM.tileTextures); G = new Globals(); HM = new HudManager(TM); AM = new ActionManager(); A = null; newAction = false; elapsedSeconds = 0; G.graphicsWidth = 1280; G.graphicsHeight = 720; G.tileSize = 20; G.timeStamp = 0; G.movementCooldown = 100; G.mouseText = ""; G.mouseSubText = ""; }
public override void doAction(TextureManager TM, HudManager HM) { return; }
public virtual void doAction(TextureManager TM, HudManager HM) { return; }