Beispiel #1
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     spriteFont = Content.Load<SpriteFont>("Arial16");
     image = Content.Load<Texture2D>("background");
     base.LoadContent();
 }
        protected override void LoadContent()
        {
            // Instantiate a SpriteBatch
            spriteBatch = ToDisposeContent(new SpriteBatch(GraphicsDevice));

            // Loads a sprite font
            // The [Arial16.xml] file is defined with the build action [ToolkitFont] in the project
            arial16Font = Content.Load<SpriteFont>("Arial16");

            // Creates a basic effect
            basicEffect = ToDisposeContent(new BasicEffect(GraphicsDevice));
            basicEffect.DiffuseColor = Color.OrangeRed.ToVector4();
            basicEffect.PreferPerPixelLighting = true;
            basicEffect.EnableDefaultLighting();

            // Creates torus primitive
            sphere = ToDisposeContent(GeometricPrimitive.Sphere.New(GraphicsDevice, 1.75f));

            pixelTexture = Texture2D.New(GraphicsDevice, 1, 1, GraphicsDevice.BackBuffer.Format);
            pixelTexture.SetData<Color>(new Color[] { Color.Green });

            occlusionQuery = new OcclusionQuery(GraphicsDevice);

            offscreenBuffer = RenderTarget2D.New(GraphicsDevice, 128, 128, GraphicsDevice.BackBuffer.Format);

            base.LoadContent();
        }
        public override void LoadContent()
        {
            base.LoadContent();

            Sprite buttonSprite = Resources.GetSprite("button_idle");
            Sprite[] buttonSpriteTab = new Sprite[] { buttonSprite, Resources.GetSprite("button_over"), Resources.GetSprite("button_pressed") };
            font = Manager.Game.Content.Load<SpriteFont>("Fonts/Hud");
            panel = new Panel(this, new Rectangle(0, 0, Manager.Width, Manager.Height), buttonSprite);

            string root = Manager.Game.Content.RootDirectory;
            tree = new FileTree(this, new Rectangle(0, 0, 100, 100), null, root, ".png") { Pading = 10 };
            panel.AddControl("Tree", tree);
            int treeWidth = tree.PreferableWidth;
            int treeHeight = tree.PreferableHeight;
            tree.Bound = new Rectangle(0, 0, treeWidth, treeHeight);

            submitButton = new Button(this, new Rectangle(0, treeHeight + 30, 100, 20), buttonSpriteTab) { Text = "Submit" };
            panel.AddControl("submitButton", submitButton);

            addSpriteButton = new Button(this, new Rectangle(treeWidth + 200, treeHeight + 30, 100, 20), buttonSpriteTab) { Text = "Add Sprite" };
            panel.AddControl("addSpriteButton", addSpriteButton);

            addSpriteText = new TextBox(this, new Rectangle(treeWidth + 60, treeHeight + 30, 140, 20), buttonSpriteTab);
            panel.AddControl("addSpriteText", addSpriteText);

            textureDrawer = new TextureDrawer(this, new Rectangle(treeWidth, 10, 300, treeHeight - 10), null) { SelectionMode = true, SelectPointMode = true };
            panel.AddControl("textureDrawer", textureDrawer);

            coordinate = new TextBlock(this, new Vector2(100, treeHeight + 30), "");
            panel.AddControl("coordinate", coordinate);

            panel.Pading = 10;
            Resize(Manager.Game.Viewport.Width, Manager.Game.Viewport.Height);
        }
Beispiel #4
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);
        }
 public FloatingTexts(VisionContent vcontent, SpriteBatch spriteBatch, SpriteFont font)
     : base(vcontent.LoadEffect("effects/signtexteffect"))
 {
     VContent = vcontent;
     SpriteBatch = spriteBatch;
     Font = font;
 }
Beispiel #6
0
 protected override void LoadContent()
 {
     tex = Content.Load<Texture2D>("Logo.jpg");
     mouse = Content.Load<Texture2D>("Mouse.png");
     BasicFont = this.Content.Load<SpriteFont>("wryh");
     base.LoadContent();
 }
Beispiel #7
0
        protected override void LoadContent()
        {
            base.LoadContent();

            font = Content.Load<SpriteFont>("consolas.ft");
            lineVertex = new PrimitiveBatch<VertexPositionColor>(GraphicsDevice);
        }
Beispiel #8
0
        public override void LoadContent()
        {
            base.LoadContent();

            Sprite buttonSprite = Resources.GetSprite("button_idle");
            Sprite[] buttonSpriteTab = new Sprite[] { buttonSprite, Resources.GetSprite("button_over"), Resources.GetSprite("button_pressed") };
            font = Manager.Game.Content.Load<SpriteFont>("Fonts/Hud");
            panel = new Panel(this, new Rectangle(0, 0, Manager.Width, Manager.Height), buttonSprite);

            submitButton = new Button(this, new Rectangle(0, 60, 100, 20), buttonSpriteTab) { Text = "Submit" };
            panel.AddControl("submitButton", submitButton);

            addTileButton = new Button(this, new Rectangle(110, 60, 100, 20), buttonSpriteTab) { Text = "Add Tile" };
            panel.AddControl("addSpriteButton", addTileButton);

            panel.AddControl("tileNameLabel", new TextBlock(this, new Vector2(0, 0), "Name :"));
            tileName = new TextBox(this, new Rectangle(100, 0, 140, 20), buttonSpriteTab);
            panel.AddControl("tileName", tileName);

            panel.AddControl("tileTypeLabel", new TextBlock(this, new Vector2(0, 25), "Type :"));
            tileType = new ListButton(this, new Rectangle(100, 25, 140, 20), buttonSprite, Tile.GetTileTypes().ToList());
            panel.AddControl("tileType", tileType);

            panel.Pading = 10;
            Resize(Manager.Game.Viewport.Width, Manager.Game.Viewport.Height);
        }
Beispiel #9
0
 public TextBlock(Screen screen, Vector2 position, string text)
     : base(screen)
 {
     Text = text;
     Color = Color.Black;
     font = screen.Manager.Game.Content.Load<SpriteFont>("Fonts/Hud");
     Bound = new Rectangle((int)position.X, (int)position.Y, (int)font.MeasureString(Text).X + 10, 20);
 }
Beispiel #10
0
 public SimpleText(GraphicsDevice device, string fontFilename)
 {
     this.device = device;
     this.graphicsDevice = device;
     this.spriteFont = SpriteFont.Load(graphicsDevice, fontFilename);
     var sfd = SpriteFontData.Load(fontFilename);
     this.spriteBatch = new SpriteBatch(graphicsDevice);
 }
Beispiel #11
0
        public ToggleButton(Screen screen, Rectangle bound, Sprite[] sprites)
            : base(screen)
        {
            Bound = bound;
            Sprites = sprites;
            Text = "";

            font = screen.Manager.Game.Content.Load<SpriteFont>("Fonts/Hud");
        }
Beispiel #12
0
    /// <summary>
    /// Constructor of this class
    /// </summary>
    /// <param id="textures">GUITexture of the style</param>
    /// <param id="font">Font of the style</param>
    /// <param id="fontColor">Color of the font of this style</param>
    /// <param id="shadeText">Sets whether the newText is shaded</param>
    /// <param id="centeredText">Sets whether the newText is centered</param>
    public GUISkin(GUITexture textures, SpriteFont font, Color fontColor, bool shadeText, bool centeredText)
    {
      this.Textures = textures;
      this.Font = font;
      this.CenteredText = centeredText;
      this.ShadedText = shadeText;

      this.FontColor = fontColor;
    }
        public override void LoadContent()
        {
            base.LoadContent();

            Sprite buttonSprite = Resources.GetSprite("button_idle");
            Sprite[] buttonSpriteTab = new Sprite[] { buttonSprite, Resources.GetSprite("button_over"), Resources.GetSprite("button_pressed") };
            font = Manager.Game.Content.Load<SpriteFont>("Fonts/Hud");
            panel = new Panel(this, new Rectangle(0, 0, Manager.Width, Manager.Height), buttonSprite);

            spriteLib = new SearchableList(this, new Rectangle(0, 0, 200, 400), buttonSprite, buttonSpriteTab, font) { Pading = 5 };
            panel.AddControl("spriteLib", spriteLib);
            foreach (KeyValuePair<string, Sprite> pair in Resources.Sprites)
                spriteLib.AddToList(pair.Key);

            spriteSelected = new SearchableList(this, new Rectangle(400, 0, 200, 300), buttonSprite, buttonSpriteTab, font) { Pading = 5 };
            panel.AddControl("spriteSelected", spriteSelected);

            textureDrawerLib = new TextureDrawer(this, new Rectangle(200, 0, 200, 200), null);
            panel.AddControl("textureDrawerLib", textureDrawerLib);

            textureDrawerSelected = new TextureDrawer(this, new Rectangle(600, 0, 200, 200), null);
            panel.AddControl("textureDrawerSelected", textureDrawerSelected);

            submitButton = new Button(this, new Rectangle(0, 410, 100, 20), buttonSpriteTab) { Text = "Submit" };
            panel.AddControl("submitButton", submitButton);

            addAnimationButton = new Button(this, new Rectangle(350, 410, 100, 20), buttonSpriteTab) { Text = "Add Animation" };
            panel.AddControl("addSpriteButton", addAnimationButton);

            toLeftButton = new Button(this, new Rectangle(285, 255, 30, 30), buttonSpriteTab) { Text = " <-" };
            panel.AddControl("toLeftButton", toLeftButton);

            toRightButton = new Button(this, new Rectangle(285, 220, 30, 30), buttonSpriteTab) { Text = " ->" };
            panel.AddControl("toRightButton", toRightButton);

            toUpButton = new Button(this, new Rectangle(340, 220, 30, 30), buttonSpriteTab) { Text = "Up" };
            panel.AddControl("toUpButton", toUpButton);

            toDownButton = new Button(this, new Rectangle(340, 255, 30, 30), buttonSpriteTab) { Text = "Down" };
            panel.AddControl("toDownButton", toDownButton);

            frameTimeLabel = new TextBlock(this, new Vector2(400, 305), "FrameTime :");
            panel.AddControl("frameTimeLabel", frameTimeLabel);

            frameTimeTextBox = new TextBox(this, new Rectangle(520, 305, 80, 20), buttonSpriteTab);
            panel.AddControl("frameTimeText", frameTimeTextBox);

            panel.AddControl("effectButtonLabel", new TextBlock(this, new Vector2(400, 325), "Effect :"));
            effectButton = new ListButton(this, new Rectangle(470, 325, 130, 20), buttonSprite, new List<string>() { "None", "FlipVertically", "FlipHorizontally", "FlipBoth" });
            panel.AddControl("effectButton", effectButton);

            addSpriteText = new TextBox(this, new Rectangle(210, 410, 140, 20), buttonSpriteTab);
            panel.AddControl("addSpriteText", addSpriteText);

            panel.Pading = 10;
            Resize(Manager.Game.Viewport.Width, Manager.Game.Viewport.Height);
        }
Beispiel #14
0
        public ListButton(Screen screen, Rectangle bound, Sprite sprite, List<string> list)
            : base(screen)
        {
            Bound = bound;
            Sprite = sprite;
            List = list;
            CurrentIndex = 0;

            font = screen.Manager.Game.Content.Load<SpriteFont>("Fonts/Hud");
        }
Beispiel #15
0
    /// <summary>
    /// Initializes the screen
    /// </summary>
    /// <param id="sm">ScreenManager that handles this screen</param>
    public virtual void Initialize(ScreenManager sm)
    {
      TitleFont = UI.Instance.GetFont(TITLE_FONT_NAME);
      ControlFont = UI.Instance.GetFont(CONTROL_FONT_NAME);

      ButtonSkin = new GUISkin(UI.Instance.GetGuiTex(BUTTON_SKIN_NAME), ControlFont, BUTTON_TEXT_COLOR, false, true);
      LabelSkin = new GUISkin(UI.Instance.GetGuiTex(BUTTON_SKIN_NAME), ControlFont, UI_TEXT_COLOR, false, true);
      TextBoxSkin = new GUISkin(UI.Instance.GetGuiTex(TEXTBOX_SKIN_NAME), ControlFont, TEXTBOX_TEXT_COLOR, false, false);

      this.sm = sm;
    }
Beispiel #16
0
 public SearchableList(Screen screen, Rectangle bound, Sprite background, Sprite[] searchSprite, SpriteFont font)
     : base(screen)
 {
     list = new List<TextBlock>();
     searchBar = new TextBox(Screen, Rectangle.Empty, searchSprite) { Parent = this };
     stack = new Stack(Screen) { Parent = this };
     Bound = bound;
     SelectedItem = null;
     this.background = background;
     this.font = font;
 }
Beispiel #17
0
        public FileTree(Screen screen, Rectangle bound, Sprite background, string root, string extensionFilter = "")
            : base(screen)
        {
            Bound = bound;
            Background = background;
            elements = new Dictionary<TextBlock, TreeElement>();
            font = screen.Manager.Game.Content.Load<SpriteFont>("Fonts/Hud");

            Root = new TreeElement() { Path = root, isDirectory = true };
            AddToTreeAllChilds(Root, extensionFilter);
        }
Beispiel #18
0
        protected override void LoadContent()
        {
            // SpriteFont supports the following font file format:
            // - DirectX Toolkit MakeSpriteFont or SharpDX Toolkit tkfont
            // - BMFont from Angelcode http://www.angelcode.com/products/bmfont/
            arial16BMFont = Content.Load<SpriteFont>("Arial16");

            // Instantiate a SpriteBatch
            spriteBatch = new SpriteBatch(GraphicsDevice);

            base.LoadContent();
        }
        protected override void LoadContent()
        {
            // Loads the balls texture (32 textures (32x32) stored vertically => 32 x 1024 ).
            ballsTexture = Content.Load<Texture2D>("balls.dds");

            // SpriteFont supports the following font file format:
            // - DirectX Toolkit MakeSpriteFont or SharpDX Toolkit tkfont
            // - BMFont from Angelcode http://www.angelcode.com/products/bmfont/
            arial16BMFont = Content.Load<SpriteFont>("Arial16.tkfnt");

            // Instantiate a SpriteBatch
            spriteBatch = new SpriteBatch(GraphicsDevice);
        }
Beispiel #20
0
        public override void LoadContent()
        {
            base.LoadContent();

            XmlDocument doc = new XmlDocument();
            doc.Load("save.xml");

            XmlElement worldElem = (XmlElement)doc.GetElementsByTagName("World").Item(0);
            World = new World(this, doc, worldElem);

            Sprite buttonSprite = World.Resources.GetSprite("button_idle");
            Sprite[] buttonSpriteTab = new Sprite[] { buttonSprite, World.Resources.GetSprite("button_over"), World.Resources.GetSprite("button_pressed") };
            font = Manager.Game.Content.Load<SpriteFont>("Fonts/Hud");

            tabPanel = new TabPanels(this, Rectangle.Empty, buttonSpriteTab);
            tilePanel = new Panel(this, Rectangle.Empty, buttonSprite) { Pading = 5 };
            tileList = new SearchableList(this, Rectangle.Empty, buttonSprite, buttonSpriteTab, font);
            tilePanel.AddControl("tileList", tileList);
            tileAddButton = new Button(this, Rectangle.Empty, buttonSpriteTab) { Text = "Add" };
            tilePanel.AddControl("tileAddButton", tileAddButton);
            tileRemoveButton = new Button(this, Rectangle.Empty, buttonSpriteTab) { Text = "Remove" };
            tilePanel.AddControl("tileRemoveButton", tileRemoveButton);
            tileDataPanel = new Panel(this, Rectangle.Empty, null);
            tilePanel.AddControl("tileDataPanel", tileDataPanel);
            tabPanel.AddPanel("Tile", tilePanel, 35);

            entityPanel = new Panel(this, Rectangle.Empty, buttonSprite) { Pading = 5 };
            TextBlock entityListButtonLabel = new TextBlock(this, Vector2.Zero, "Type");
            entityPanel.AddControl("entityListButtonLabel", entityListButtonLabel);
            entityListButton = new ListButton(this, new Rectangle(50, 0, 100, 25), buttonSprite, new List<string>(Entity.GetEntityTypes()));
            entityPanel.AddControl("entityListButton", entityListButton);
            entityAddButton = new Button(this, new Rectangle(5, 30, 40, 25), buttonSpriteTab) { Text = "Add" };
            entityPanel.AddControl("entityAddButton", entityAddButton);
            entityDataPanel = new Panel(this, Rectangle.Empty, null);
            entityPanel.AddControl("entityDataPanel", entityDataPanel);
            tabPanel.AddPanel("Entity", entityPanel, 52);

            locTilePanel = new Panel(this, Rectangle.Empty, buttonSprite) { Pading = 5 };
            TextBlock locTileListButtonLabel = new TextBlock(this, Vector2.Zero, "Type");
            locTilePanel.AddControl("locTileListButtonLabel", locTileListButtonLabel);
            locTileListButton = new ListButton(this, new Rectangle(50, 0, 100, 25), buttonSprite, new List<string>(Tile.GetLocTileTypes()));
            locTilePanel.AddControl("locTileListButton", locTileListButton);
            locTileAddButton = new Button(this, new Rectangle(5, 30, 40, 25), buttonSpriteTab) { Text = "Add" };
            locTilePanel.AddControl("locTileAddButton", locTileAddButton);
            locTileDataPanel = new Panel(this, Rectangle.Empty, null);
            locTilePanel.AddControl("locTileDataPanel", locTileDataPanel);
            tabPanel.AddPanel("LocTile", locTilePanel, 65);

            Resize(Manager.Game.Viewport.Width, Manager.Game.Viewport.Height);
            UpdateDatas();
        }
Beispiel #21
0
        public World(Screen screen, XmlDocument doc, XmlElement parent)
        {
            Tiles = new Tile[Width, Height];
            Entities = new Dictionary<int, Entity>();

            gDevice = PokeSiGame.Instance.GraphicsDevice;
            spriteBatch = new SpriteBatch(gDevice);
            renderDone = false;

            Load(doc, parent);

            view = new Rectangle(0, 0, Tile.Width * Width, Tile.Height * Height);

            font = PokeSiGame.Instance.Content.Load<SpriteFont>("Fonts/Hud");
        }
Beispiel #22
0
 public Button(LogicGraph game, string back, string text, Vector2 position, Size2 size, SpriteFont font, Color color)
     : base(game)
 {
     backName = back;
     Text = text;
     Position = position;
     Size = size;
     Font = font;
     Color = color;
     this.OnButtonDown += Button_OnButtonDown;
     this.OnButtonUp += Button_OnButtonUp;
     this.OnHover += Button_OnHover;
     this.OnLeave += Button_OnLeave;
     this.DrawOrder = 10;
 }
        public override void Initialize()
        {
            base.Initialize();
            Enabled = true;
            Visible = true;

            spriteBatch = new SpriteBatch( GraphicsDevice );
            format = new NumberFormatInfo();
            format.NumberDecimalSeparator = ".";
            font = Content.Load<SpriteFont>( "Fonts/Debug" );
            fpsString = string.Format( format, "{0}", frameRate );

            GraphicsDeviceManager graphicsDeviceManager = Content.ServiceProvider.GetService( typeof( IGraphicsDeviceManager ) ) as GraphicsDeviceManager;
            position = new Vector2( graphicsDeviceManager.PreferredBackBufferWidth - 40, 20 );
        }
        protected override void LoadContent()
        {
            // Load fonts
            arial13 = ToDisposeContent(Content.Load<SpriteFont>("Arial13"));
            msSansSerif10 = ToDisposeContent(Content.Load<SpriteFont>("MicrosoftSansSerif10"));
            arial16 = ToDisposeContent(Content.Load<SpriteFont>("Arial16"));
            arial16ClearType = ToDisposeContent(Content.Load<SpriteFont>("Arial16ClearType"));
            arial16Bold = ToDisposeContent(Content.Load<SpriteFont>("Arial16Bold"));
            calibri64 = ToDisposeContent(Content.Load<SpriteFont>("Calibri64"));
            courrierNew10 = ToDisposeContent(Content.Load<SpriteFont>("CourierNew10"));

            // Instantiate a SpriteBatch
            spriteBatch = ToDisposeContent(new SpriteBatch(GraphicsDevice));
            colorTexture = ToDisposeContent(Texture2D.New(GraphicsDevice, 1, 1, PixelFormat.R8G8B8A8.UNorm, new [] {Color.White}));

            base.LoadContent();
        }
Beispiel #25
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);
 }
Beispiel #26
0
        public BannerSign(VisionContent vContent, IEnumerable<CodeIsland> islands)
            : base(vContent.LoadEffect("effects/signtexteffect"))
        {
            _spriteBatch = new SpriteBatch(Effect.GraphicsDevice);
            _spriteFont = vContent.Load<SpriteFont>("fonts/BlackCastle");
            _tpds = islands.Select(_ =>
                new TextAndPosAndDistance
                {
                    Text = _.VAssembly.Name,
                    Pos = new Vector3(_.World.M41 + (float) _.GroundExtentX/2, HeightAboveOcean, _.World.M43 + (float) _.GroundExtentZ/2)
                }).ToList();

            foreach (var tpd in _tpds)
            {
                var sz = _spriteFont.MeasureString(tpd.Text)/4*TextSize;
                var extent = new Vector3(sz.X, sz.Y, sz.X);
                tpd.BoundingBox = new BoundingBox(tpd.Pos - extent, tpd.Pos + extent);
            }
        }
Beispiel #27
0
        protected override void LoadContent()
        {
            // Load the fonts
            arial16BMFont = Content.Load<SpriteFont>("Arial16");

            // Load the model (by default the model is loaded with a BasicEffect. Use ModelContentReaderOptions to change the behavior at loading time.
            models = new List<Model>();
            foreach (var modelName in new[] { "Dude", "Duck", "Car", "Happy", "Knot", "Skull", "Sphere", "Teapot" })
            {
                model = Content.Load<Model>(modelName);
                
                // Enable default lighting  on model.
                BasicEffect.EnableDefaultLighting(model, true);

                models.Add(model);
            }
            model = models[0];

            // Instantiate a SpriteBatch
            spriteBatch = ToDisposeContent(new SpriteBatch(GraphicsDevice));

            base.LoadContent();
        }
Beispiel #28
0
 /// <summary>
 /// Initializes this instance, loads textures and font
 /// </summary>
 public void Initialize()
 {
   activeCursorTexture = UI.Instance.GetTexture("cursor");
   newCursorTextureName = activeCursorTextureName = "cursor";
   textFont = UI.Instance.GetFont(CURSOR_FONT_NAME);
 }
        protected override void LoadContent()
        {
            _basicEffect = ToDisposeContent(new BasicEffect(GraphicsDevice)
            {
                VertexColorEnabled = true,
                View = Matrix.LookAtLH(new Vector3(0, 0, -5), new Vector3(0, 0, 0), Vector3.UnitY),
                Projection = Matrix.PerspectiveFovLH(MathUtil.PiOverFour, (float)GraphicsDevice.BackBuffer.Width / GraphicsDevice.BackBuffer.Height, 0.1f, 100.0f),
                World = Matrix.Identity
            });

            _vertices = ToDisposeContent(SharpDX.Toolkit.Graphics.Buffer.Vertex.New(
                GraphicsDevice,
                new[]
                    {
                        new VertexPositionColor(new Vector3(-1.0f, -1.0f, -1.0f), Color.Orange), // Front
                        new VertexPositionColor(new Vector3(-1.0f, 1.0f, -1.0f), Color.Orange),
                        new VertexPositionColor(new Vector3(1.0f, 1.0f, -1.0f), Color.Orange),
                        new VertexPositionColor(new Vector3(-1.0f, -1.0f, -1.0f), Color.Orange),
                        new VertexPositionColor(new Vector3(1.0f, 1.0f, -1.0f), Color.Orange),
                        new VertexPositionColor(new Vector3(1.0f, -1.0f, -1.0f), Color.Orange),
                        new VertexPositionColor(new Vector3(-1.0f, -1.0f, 1.0f), Color.Orange), // BACK
                        new VertexPositionColor(new Vector3(1.0f, 1.0f, 1.0f), Color.Orange),
                        new VertexPositionColor(new Vector3(-1.0f, 1.0f, 1.0f), Color.Orange),
                        new VertexPositionColor(new Vector3(-1.0f, -1.0f, 1.0f), Color.Orange),
                        new VertexPositionColor(new Vector3(1.0f, -1.0f, 1.0f), Color.Orange),
                        new VertexPositionColor(new Vector3(1.0f, 1.0f, 1.0f), Color.Orange),
                        new VertexPositionColor(new Vector3(-1.0f, 1.0f, -1.0f), Color.OrangeRed), // Top
                        new VertexPositionColor(new Vector3(-1.0f, 1.0f, 1.0f), Color.OrangeRed),
                        new VertexPositionColor(new Vector3(1.0f, 1.0f, 1.0f), Color.OrangeRed),
                        new VertexPositionColor(new Vector3(-1.0f, 1.0f, -1.0f), Color.OrangeRed),
                        new VertexPositionColor(new Vector3(1.0f, 1.0f, 1.0f), Color.OrangeRed),
                        new VertexPositionColor(new Vector3(1.0f, 1.0f, -1.0f), Color.OrangeRed),
                        new VertexPositionColor(new Vector3(-1.0f, -1.0f, -1.0f), Color.OrangeRed), // Bottom
                        new VertexPositionColor(new Vector3(1.0f, -1.0f, 1.0f), Color.OrangeRed),
                        new VertexPositionColor(new Vector3(-1.0f, -1.0f, 1.0f), Color.OrangeRed),
                        new VertexPositionColor(new Vector3(-1.0f, -1.0f, -1.0f), Color.OrangeRed),
                        new VertexPositionColor(new Vector3(1.0f, -1.0f, -1.0f), Color.OrangeRed),
                        new VertexPositionColor(new Vector3(1.0f, -1.0f, 1.0f), Color.OrangeRed),
                        new VertexPositionColor(new Vector3(-1.0f, -1.0f, -1.0f), Color.DarkOrange), // Left
                        new VertexPositionColor(new Vector3(-1.0f, -1.0f, 1.0f), Color.DarkOrange),
                        new VertexPositionColor(new Vector3(-1.0f, 1.0f, 1.0f), Color.DarkOrange),
                        new VertexPositionColor(new Vector3(-1.0f, -1.0f, -1.0f), Color.DarkOrange),
                        new VertexPositionColor(new Vector3(-1.0f, 1.0f, 1.0f), Color.DarkOrange),
                        new VertexPositionColor(new Vector3(-1.0f, 1.0f, -1.0f), Color.DarkOrange),
                        new VertexPositionColor(new Vector3(1.0f, -1.0f, -1.0f), Color.DarkOrange), // Right
                        new VertexPositionColor(new Vector3(1.0f, 1.0f, 1.0f), Color.DarkOrange),
                        new VertexPositionColor(new Vector3(1.0f, -1.0f, 1.0f), Color.DarkOrange),
                        new VertexPositionColor(new Vector3(1.0f, -1.0f, -1.0f), Color.DarkOrange),
                        new VertexPositionColor(new Vector3(1.0f, 1.0f, -1.0f), Color.DarkOrange),
                        new VertexPositionColor(new Vector3(1.0f, 1.0f, 1.0f), Color.DarkOrange)
                    }));
            ToDisposeContent(_vertices);

            _font = Content.Load<SpriteFont>("Font");
            _spriteBatch = ToDisposeContent(new SpriteBatch(GraphicsDevice));

            _inputLayout = VertexInputLayout.FromBuffer(0, _vertices);

            SetScaling(1f);

            base.LoadContent();
        }
Beispiel #30
0
 public override void LoadContent()
 {
     font = Content.Load<SpriteFont>( "fonts/Debug" );
     timer = new Timer( 2000 );
 }