예제 #1
0
파일: Block.cs 프로젝트: ArtSin/Mine2D-Old
 public Block(TextureAtlas textureAtlas, Vector2 texPos, string name)
 {
     this.texPos = texPos;
     this.textureFromAtlas = textureAtlas.getTexture(texPos);
     this.textureFromAtlas.GetData<Color>(this.textureColorData);
     this.name = name;
     this.destroyTimesWithTools.Add("Null", 40);
 }
예제 #2
0
파일: Item.cs 프로젝트: ArtSin/Mine2D-Old
 public Item(TextureAtlas textureAtlas, Vector2 texPos, string name)
 {
     this.texPos = texPos;
     if (textureAtlas != null)
     {
         this.textureFromAtlas = textureAtlas.getTexture(texPos);
         this.textureFromAtlas.GetData<Color>(this.textureColorData);
     }
     this.name = name;
 }
예제 #3
0
파일: Block.cs 프로젝트: ArtSin/Mine2D-Old
 public Block(TextureAtlas textureAtlas, Vector2 texPos, string name, int destroyingTime)
 {
     this.texPos = texPos;
     this.textureFromAtlas = textureAtlas.getTexture(texPos);
     this.textureFromAtlas.GetData<Color>(this.textureColorData);
     this.name = name;
     if (destroyingTime > 0)
         this.destroyTimesWithTools.Add("Null", destroyingTime);
     else
         this.canDestroy = false;
 }
예제 #4
0
파일: Item.cs 프로젝트: ArtSin/Mine2D-Old
 public void FinishLoadAfterDeserialization(TextureAtlas textureAtlas)
 {
     this.textureColorData = new Color[TextureAtlas.TEXTURE_SIZE * TextureAtlas.TEXTURE_SIZE];
     this.textureFromAtlas = textureAtlas.getTexture(texPos);
     this.textureFromAtlas.GetData<Color>(this.textureColorData);
 }
예제 #5
0
파일: Mine2D.cs 프로젝트: ArtSin/Mine2D-Old
        /// <summary>
        /// LoadContent будет вызываться в игре один раз; здесь загружается
        /// весь контент.
        /// </summary>
        protected override void LoadContent()
        {
            // Создайте новый SpriteBatch, который можно использовать для отрисовки текстур.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Texture2D blocksAtlasTex = Content.Load<Texture2D>("Textures/blocks");
            blocksAtlas = new TextureAtlas(GraphicsDevice, blocksAtlasTex);
            Texture2D itemsAtlasTex = Content.Load<Texture2D>("Textures/items");
            itemsAtlas = new TextureAtlas(GraphicsDevice, itemsAtlasTex);
            for (int i = 0; i < 10; i++)
            {
                destroyTextures[i] = blocksAtlas.getTexture(new Vector2(i, 15));
            }

            font = Content.Load<SpriteFont>("font");

            button = Content.Load<Texture2D>("Textures/Button");
            buttonActive = Content.Load<Texture2D>("Textures/ButtonActive");
            logo = Content.Load<Texture2D>("Textures/Logo");
            textbox = Content.Load<Texture2D>("Textures/Textbox");
            smallInventoryTex = Content.Load<Texture2D>("Textures/SmallInventory");
            normalInventoryTex = Content.Load<Texture2D>("Textures/NormalInventory");
            workbenchInventoryTex = Content.Load<Texture2D>("Textures/WorkbenchInventory");
            furnaceInventoryTex = Content.Load<Texture2D>("Textures/FurnaceInventory");
            durabilityBarEmpty = Content.Load<Texture2D>("Textures/DurabilityBarEmpty");
            durabilityBarFull = Content.Load<Texture2D>("Textures/DurabilityBarFull");

            SoundManager.Initialize(Content);

            player = new Player(ref camera, Content);
        }