Exemplo n.º 1
0
        public Wand(Scene theScene, GraphicsDevice gDevice, Catalog cat, Room rm)
        {
            scene = theScene;
            graphicsDevice = gDevice;
            catalog = cat;
            room = rm;

            actionState = STATES.SELECTING;

            spriteBatch = new SpriteBatch(graphicsDevice);

            screenCenter = new Vector2(graphicsDevice.Viewport.Width / 2.0f, graphicsDevice.Viewport.Height / 2.0f);
            nearSource = new Vector3(screenCenter, 0);
            farSource = new Vector3(screenCenter, 1);

            // Add a mouse click callback function to perform ray picking when mouse is clicked
            MouseInput.Instance.MouseClickEvent += new HandleMouseClick(MouseClickHandler);
            MouseInput.Instance.MouseWheelMoveEvent += new HandleMouseWheelMove(MouseWheelHandler);

            // Add a keyboard press handler for user input
            KeyboardInput.Instance.KeyPressEvent += new HandleKeyPress(KeyPressHandler);
        }
Exemplo n.º 2
0
        private void CreateObjects()
        {
            catalog = new Catalog(scene);
            hud = new HUD(scene, Content);
            room = new Room(scene, 200, 200);
            room.Initialize();

            wand = new Wand(scene, graphics.GraphicsDevice, catalog, room);
            wand.setSelectCrosshair(Content.Load<Texture2D>("crosshairs/crosshairnormal"));
            wand.setPlaceCrosshair(Content.Load<Texture2D>("crosshairs/crosshairplace"));
            wand.setManipulateCrosshair(Content.Load<Texture2D>("crosshairs/crosshairmanip"));
            wand.setInvalidActionCrosshair(Content.Load<Texture2D>("crosshairs/actionDisabled"));
            wand.setDeleteConfirmationModal(Content.Load<Texture2D>("hud/deleteConfirmationModal"));
            wand.Hud = hud;
        }