コード例 #1
0
        public InventoryStockableInterface(Texture2D back, TypeSacoche sacoche1, TypeSacoche sacoche2,Rectangle position , InventoryInterface invoc )
        {
            parent = invoc;
            this.position = positionongl = position;
            sac1 = sacoche1;
            sac2 = sacoche2;
            this.back = back;
            int ongX = positionongl.X+10;
            Onglet o = Onglet.Armes;
            onglet.Add(new ClickableArea(o.ToString(), Tools.Quick.dicoFont[Tools.TypeFont.Texte], new Vector2(ongX, positionongl.Y), () => changeOnglet(Onglet.Armes)));
            ongX += (int)Tools.Quick.dicoFont[Tools.TypeFont.Texte].MeasureString(o.ToString()).X + 10;

             o = Onglet.Armures;
             onglet.Add(new ClickableArea(o.ToString(), Tools.Quick.dicoFont[Tools.TypeFont.Texte], new Vector2(ongX, positionongl.Y), () => changeOnglet(Onglet.Armures)));
            ongX += (int)Tools.Quick.dicoFont[Tools.TypeFont.Texte].MeasureString(o.ToString()).X + 10;

            o = Onglet.Potions;
            onglet.Add(new ClickableArea(o.ToString(), Tools.Quick.dicoFont[Tools.TypeFont.Texte], new Vector2(ongX, positionongl.Y), () => changeOnglet( Onglet.Potions)));
            ongX += (int)Tools.Quick.dicoFont[Tools.TypeFont.Texte].MeasureString(o.ToString()).X + 10;

            o = Onglet.Crochets;
            onglet.Add(new ClickableArea(o.ToString(), Tools.Quick.dicoFont[Tools.TypeFont.Texte], new Vector2(ongX, positionongl.Y), () => changeOnglet(Onglet.Crochets)));
            ongX += (int)Tools.Quick.dicoFont[Tools.TypeFont.Texte].MeasureString(o.ToString()).X + 10;

            o = Onglet.Parchemins;
            onglet.Add(new ClickableArea(o.ToString(), Tools.Quick.dicoFont[Tools.TypeFont.Texte], new Vector2(ongX, positionongl.Y), () => changeOnglet(Onglet.Parchemins)));
            ongX += (int)Tools.Quick.dicoFont[Tools.TypeFont.Texte].MeasureString(o.ToString()).X + 10;

            o = Onglet.Carquois;
            onglet.Add(new ClickableArea(o.ToString(), Tools.Quick.dicoFont[Tools.TypeFont.Texte], new Vector2(ongX, positionongl.Y), () => changeOnglet(Onglet.Carquois)));
            ongX += (int)Tools.Quick.dicoFont[Tools.TypeFont.Texte].MeasureString(o.ToString()).X + 10;

            foreach (ClickableArea ca in onglet)
            {
                ca.Visible = false;
                ca.Visible = false ;
            }
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: Jupotter/Nameless-Tales
        protected override void LoadContent()
        {
            Console.WriteLine("Game: LoadContent");
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //  graphics.ToggleFullScreen();
            Tools.Quick.content = Content;
            Tools.Quick.device = graphics.GraphicsDevice;
            Tools.Quick.graphics = graphics;
            Tools.Quick.init();
            Tools.Quick.spriteBatch = spriteBatch;

            actualGround.makebigbuffer();
            actualGround.initDraw();
            //MapGen.MapConverter.Init();

            //MapGen.MapVoronoi v = new MapGen.MapVoronoi(245);
            //v.Generate();
            //v.Convert();

            effect = new BasicEffect(graphics.GraphicsDevice);

            texture = Tools.Quick.groundTexture[BiomeType.SubtropicalDesert];
            testgivre = Content.Load<Texture2D>("givre");

            //element a supprimer cause de test
            myModel = Content.Load<Model>("Models\\sapin");
            // myModel = Content.Load<Model>("Models\\untitled");
            display.init();
            camera.modiposition(actualGround.tiles[1].v2, true);
            phgest = new PhysicsGest(actualGround, new List<Object>());
            camera.modiposition(actualGround.tiles[0].v1, true);
            // TODO: use this.Content to load your game content here
            //ps = new ParticleSimple(Content, this, Components);
            //psinit();
            //psLoadContent(Content);

            arial = Content.Load<SpriteFont>("Arial");
            // menu = new Menu(arial, TypeMenu.Principal);

            Tools.Quick.player = new Personnage("Test", true, 0, new Inventory(), myModel);
            //d = new Dungeon();
            inf = new InventoryInterface(Content.Load<Texture2D>("InterfaceComponent\\Cadre"), Content.Load<Texture2D>("InterfaceComponent\\cadre bois"), Content.Load<Texture2D>("Test\\Mannequin"), Content.Load<Texture2D>("InterfaceComponent\\fond bois"), this);

            Oom = new ObjectOnMap();
            world.Add(Oom);

            water.SetCamera(camera);
            d.SetCamera(camera);
            actualGround.SetCamera(camera);
            base.LoadContent();
        }