Example #1
0
        public Signs(
            VisionContent vContent,
            Matrix world,
            Texture2D texture,
            List<VisionClass> vclasses,
            float width,
            float height)
            : base(vContent, world, texture, width, height, 0)
        {
            _signTextEffect = vContent.LoadEffect("effects/signtexteffect");
            _spriteBatch = new SpriteBatch(Effect.GraphicsDevice);
            _spriteFont = vContent.Load<SpriteFont>("fonts/BlackCastle");
            _vclasses = vclasses;

            foreach (var vc in vclasses)
            {
                vc.GroundBoundingSphere = new BoundingSphere(
                    vc.Position + world.TranslationVector,
                    vc.R);
                vc.SignClickBoundingSphere = new BoundingSphere(
                    vc.Position + world.TranslationVector + new Vector3(0, TextDistanceAboveGround - 2, 0),
                    2);
            }
            AddPositionsWithSameNormal(Vector3.Up, vclasses.Select(vc => vc.Position - world.TranslationVector).ToArray());
            CreateVertices(false);
        }
Example #2
0
 public LarvContent(GraphicsDevice graphicsDevice, ContentManager content, IEnumerable<string> sceneDescription)
     : base(graphicsDevice, content)
 {
     SpriteBatch = new SpriteBatch(graphicsDevice);
     Font = Load<SpriteFont>("fonts/BlackCastle");
     SignTextEffect = LoadEffect("effects/signtexteffect");
     TextureEffect = LoadEffect("effects/simpletextureeffect");
     BumpEffect = LoadEffect("effects/simplebumpeffect");
     Sphere = new SpherePrimitive<VertexPositionNormalTangentTexture>(GraphicsDevice,
         (p, n, t, tx) => new VertexPositionNormalTangentTexture(p, n, t, tx), 2, 10);
     Sky = new SkySphere(this, Load<TextureCube>(@"Textures\clouds"));
     Ground = new Ground(this);
     ShadowMap = new ShadowMap(this, 800, 800, 1, 50);
     ShadowMap.UpdateProjection(50, 30);
     HallOfFame = HofStorage.Load();
     PlayingFieldInfos = PlayingFieldsDecoder.Create(sceneDescription);
 }