Example #1
0
        public void addHotSpot(int coordX, int coordY, WALL wall, float scale, HotSpot.ClickEventHandler handler)
        {
            listaHotSpot.Add(new HotSpot());

            listaHotSpot[listaHotSpot.Count - 1].ClickEvent = handler;
            listaHotSpot[listaHotSpot.Count - 1].Scale = Matrix.CreateScale(scale);
            listaHotSpot[listaHotSpot.Count - 1].Position = new Vector3((float)coordX, (float)coordY, -4.99f);
            //calcular posicion y rotacion segun la pared donde este
            float rotation = 0.0f;
            switch(wall)
            {
                case WALL.EAST:
                    rotation = MathHelper.PiOver2;
                    break;
                case WALL.NORTH:
                    rotation = 0.0f;
                    break;
                case WALL.WEST:
                    rotation = -MathHelper.PiOver2;
                    break;
                case WALL.SOUTH:
                    rotation = MathHelper.Pi;
                    break;
            }

            listaHotSpot[listaHotSpot.Count - 1].Rotation = Matrix.CreateRotationY(rotation);
        }
Example #2
0
 private void addHotSpotToSpace(int index, int coordX, int coordY, HotSpace.WALL wall, HotSpot.ClickEventHandler handler)
 {
     listaHotSpace[index].addHotSpot(coordX, coordY, wall, 1.0f, handler);
 }