public static Vector3 getPlayerAimingAtPointAtDistance(float distance, MouseState mouseState) { Vector3 far = new Vector3(mouseState.X, mouseState.Y, distance); far = Compositer.device.Viewport.Unproject(far, Compositer.getPerspectiveMatrix(2000), Compositer.viewMatrix, Matrix.Identity); return(far); }
public void Draw(SpriteBatch spriteBatch) { Compositer.UpdateViewMatrix(player.getCameraLoc(), player.getCameraRotation()); Compositer.drawFinalImageFirst(player, false); Compositer.display(world, player, player.getControlledCharacter()); spriteBatch.Begin();//0, BlendState.Opaque, null, null, null, Compositer.effectToUse); IConsole.display(spriteBatch, Main.graphics.PreferredBackBufferWidth, Main.graphics.PreferredBackBufferHeight); player.display2D(spriteBatch); spriteBatch.End(); }
public void display3D() { if (isEmbodyingCharacter()) { if (selectedCharacter.isCarryingItem()) { ResourceBlock.ResourceType type = selectedCharacter.getLoad(); String blockChrPath = ResourceBlock.getPathForResourceType(type); Vector3 centerOfFloatingCube = getPlayerAimingAtPointAtDistance(.7f, currentMouseState); WorldMarkupHandler.addFlagPathWithPosition(blockChrPath, centerOfFloatingCube, 1f / 7f / 12f); } } if (selectedCharacter != null && !isEmbodyingCharacter()) { Compositer.addFlagForThisFrame(selectedCharacter.getLocation() + new Vector3(0, 1.1f, 0), "white"); } }
public ThirdPersonInputHandler() { selectedBlockType = 7; currentMenu = MenuScreen.getThirdPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight()); currentInterfaceState = InterfaceStates.playing; }
public void switchToColorPallete() { currentMenu = MenuScreen.getColorPalleteInterface(Compositer.getScreenWidth(), Compositer.getScreenHeight()); }
public void closeColorPallete() { currentMenu = MenuScreen.getThirdPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight()); }
public void openMainMenu() { currentMenu = MenuScreen.getMainMenuInterface(Compositer.getScreenWidth(), Compositer.getScreenHeight()); setInterfaceState(PlayerInputHandler.InterfaceStates.inMainMenu); }
void closeMainMenu() { currentMenu = MenuScreen.getThirdPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight()); setInterfaceState(PlayerInputHandler.InterfaceStates.playing); }
public void display2D(SpriteBatch spriteBatch) { if (inputHandler.getCurrentMenu() != null) { inputHandler.getCurrentMenu().display(spriteBatch, new Vector2(currentMouseState.X, currentMouseState.Y), Compositer.getScreenWidth(), Compositer.getScreenHeight()); } if (isEmbodyingCharacter()) { spriteBatch.Draw(ContentDistributor.crossReticle, new Rectangle(Compositer.device.Viewport.Width / 2 - ContentDistributor.crossReticle.Width / 2, Compositer.device.Viewport.Height / 2 - ContentDistributor.crossReticle.Height / 2, ContentDistributor.crossReticle.Width, ContentDistributor.crossReticle.Height), Color.White); } }
public FirstPersonInputHandler(Character nSelectedCharacter) { currentMenu = MenuScreen.getFirstPersonHud(Compositer.getScreenWidth(), Compositer.getScreenHeight()); embodiedCharacter = nSelectedCharacter; }
public void LoadContent(ContentManager content) { Compositer.LoadContent(content); player.loadContent(); SoundsManager.setPlayer(player); }