Пример #1
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);
            ArtManager.Load(Content);

            EntityManager.Add(PlayerMecha.Instance);
        }
Пример #2
0
        public LoadMap(  )
        {
            // Start constructor.

            content = Game1.Instance.Content;
            artManager = Game1.Instance.ArtManager;
        }
Пример #3
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Пример #4
0
    /// <summary>
    /// Configures the art style.
    /// </summary>
    private void configureArtStyle()
    {
        leftWall.GetComponent <SpriteRenderer>().material  = ArtManager.getArtSetResource <Material>("wallMat", (int)artType);
        rightWall.GetComponent <SpriteRenderer>().material = ArtManager.getArtSetResource <Material>("wallMat", (int)artType);

        shard.transform.GetChild(0).gameObject.SetActive(ArtManager.getArtSetShardLight((int)artType));
    }
Пример #5
0
 public void EnterUICard(int index)
 {
     if (GameInfo.Instance.controller.Phase == Controller.PhaseState.Player)
     {
         Unit.TypeEnum type = StorageInfo.CardTypeList[index];
         GameInfo.Instance.characterImage.Show(ArtManager.GetCardName(type, m_turn));
     }
 }
Пример #6
0
        // ============================================================================
        // ================================= Methods ==================================
        // ============================================================================

        // Constructor
        public World(int players)
        {
            // Initialize the managers
            sm = new SoundManager(0, 0);
            om = new OptionsManager();
            am = new ArtManager();
            gm = new GameManager();

            InitializePlayers(players);
        }
Пример #7
0
        // GET: /Art/Search?query=seu
        public ActionResult Search(string query)
        {
            //IRepository repo = new EFRepository();
            var pm    = new ArtManager();
            var model = pm.GetByName(query);

            if (model == null)
            {
                return(HttpNotFound("Not Found..."));
            }
            return(View("Display", model));
        }
Пример #8
0
    private void Awake()
    {
        s_art_manager = this;
        m_art         = new DefaultArtStyle();

        foreach (var art_config in ArtConfigurations)
        {
            var data = new Dropdown.OptionData(art_config.ArtConfigurationName);
            ArtStyleDropdown.options.Add(data);
        }

        ArtStyleDropdown.value = 0;
    }
Пример #9
0
 // Start is called before the first frame update
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
     DontDestroyOnLoad(gameObject);
     ArtId = 0;
 }
Пример #10
0
    private void Awake()
    {
        s_art_manager = this;
        m_art         = new DefaultArtStyle();
        m_art_configs = new List <ArtConfiguration>();

        foreach (var art_config in ArtConfigContainer.GetComponentsInChildren <ArtConfiguration>())
        {
            m_art_configs.Add(art_config);
            var data = new Dropdown.OptionData(art_config.ArtConfigurationName);
            ArtStyleDropdown.options.Add(data);
        }

        ArtStyleDropdown.value = 0;
    }
Пример #11
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            m_spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load and save all game content
            ArtManager.LoadContent(Content);
            AudioManager.LoadContent(Content);
            World.LoadContent();
            m_mainMenu.LoadContent();
            m_howToMenu.LoadContent();
            m_optionsMenu.LoadContent();
            m_pauseMenu.LoadContent();
            m_levelUpMenu.LoadContent();
            m_gameOverMenu.LoadContent();

            AudioManager.PlayMainMusic();
        }
Пример #12
0
		internal Art(ArtManager owner)
		{
			Owner = owner;
		}
Пример #13
0
 public string GetCardName()
 {
     return(ArtManager.GetCardName(type, owner));
 }
Пример #14
0
 void Awake()
 {
     instance = this;
 }
Пример #15
0
 public ArtManager()
 {
     _instance = this;
 }
Пример #16
0
    private void SliceSprite(Texture2D texture, string path)
    {
        string localTexturePath = path.Substring(path.LastIndexOf("Tanks-PVP/") + 10);

        TextureImporter importer = AssetImporter.GetAtPath(localTexturePath) as TextureImporter;

        importer.spriteImportMode = SpriteImportMode.Multiple;
        importer.filterMode       = FilterMode.Point;

        List <SpriteMetaData> spritesMetaData = new List <SpriteMetaData>(importer.spritesheet);

        for (int i = spritesMetaData.Count - 1; i >= 0; i--)
        {
            if (spritesMetaData[i].name.Contains("Tank"))
            {
                spritesMetaData.RemoveAt(i);
            }
        }

        ArtManager           artManager      = (ArtManager)AssetDatabase.LoadAssetAtPath("Assets/Data/ArtManager.asset", typeof(ArtManager));
        List <TankAnimation> tanksAnimations = new List <TankAnimation>();

        if (importer != null && texture != null)
        {
            int offsetX = 3, offsetY = 1;
            int tW = texture.width, tH = texture.height;

            Debug.Log("123");

            for (int tankNumber = 0; tankNumber < 7; tankNumber++)
            {
                string tankName = "Tank_" + tankNumber;

                for (int tankLevel = 0; tankLevel < 4; tankLevel++)
                {
                    int groupX = offsetX + tankNumber * 128;
                    int groupY = tH - offsetY - tankLevel * 64;

                    for (int tankAnimFrame = 0; tankAnimFrame < 2; tankAnimFrame++)
                    {
                        for (int faceDirection = 0; faceDirection < 4; faceDirection++)
                        {
                            int localX, localY;
                            localX = (faceDirection % 2 == 0 ? 0 : -2) + 32 * faceDirection;
                            localY = (faceDirection % 2 == 0 ? 2 : 4) - (tankAnimFrame + 1) * 32;

                            int sizeX, sizeY;
                            if (faceDirection % 2 == 0)
                            {
                                sizeX = 26; sizeY = 30;
                            }
                            else
                            {
                                sizeX = 30; sizeY = 26;
                            }

                            SpriteMetaData metaData = new SpriteMetaData();
                            metaData.pivot = new Vector2(0.5f, 0.5f);
                            metaData.name  = tankName + "_LVL" + tankLevel + "_ANIM" + tankAnimFrame + "_F" + faceDirection;
                            metaData.rect  = new Rect(groupX + localX, groupY + localY, sizeX, sizeY);

                            spritesMetaData.Add(metaData);
                        }
                    }
                }
            }

            importer.spritesheet = spritesMetaData.ToArray();
            AssetDatabase.SaveAssets();

            Object[] spritesObjects = AssetDatabase.LoadAllAssetsAtPath(localTexturePath);
            Sprite[] sprites        = spritesObjects.Where(x => x is Sprite).Cast <Sprite>().ToArray();

            for (int tankNumber = 0; tankNumber < 7; tankNumber++)
            {
                string        tankName      = "Tank_" + tankNumber;
                TankAnimation tankAnimation = new TankAnimation();
                tankAnimation.tankType = tankNumber;
                tankAnimation.sprites  = new Sprite[4 * 2 * 4];

                for (int tankLevel = 0; tankLevel < 4; tankLevel++)
                {
                    int groupX = offsetX + tankNumber * 128;
                    int groupY = tH - offsetY - tankLevel * 64;

                    for (int tankAnimFrame = 0; tankAnimFrame < 2; tankAnimFrame++)
                    {
                        for (int faceDirection = 0; faceDirection < 4; faceDirection++)
                        {
                            string spriteName = tankName + "_LVL" + tankLevel + "_ANIM" + tankAnimFrame + "_F" + faceDirection;

                            tankAnimation.sprites[tankLevel * 8 + tankAnimFrame * 4 + faceDirection] = sprites.First((x) => x.name == spriteName);
                        }
                    }
                }

                tanksAnimations.Add(tankAnimation);
            }

            artManager.tankAnimations = tanksAnimations;
            EditorUtility.SetDirty(artManager);

            AssetDatabase.SaveAssets();
        }
    }
Пример #17
0
        // Loading map with two player references:
        public void loadNewMap( ref AssistManager assistManager, ref AnimationManager animationManager, ref ArtManager artManager, ref DoorManager doorManager, ref Map currentMap, ref World world, ref Camera camera, ref Collision collision, ref TimerManager timerManager, ref NPCManager npcManager, ref Player player1, ref Player player2 )
        {
            // Start loadNewMap.

            // Getting the nextRoom/Map data then wiping it:
            string mapToLoad = world.nextMap;
            Vector2 nextRoomSize = world.nextRoomSize;
            Vector2 nextRoomStart = world.nextRoomStart;
            Vector2 exitPosition = world.nextExitPosition;
            bool localMultiplayer = Game1.Instance.LocalMultiplayer;
            world.resetNextMapData();

            // Resetting major classes:
            camera = new Camera();
            currentMap = new Map( );
            camera.resetSingletonData();
            collision = new Collision();

            player1.spriteAnimation.resetSingletonReferences(); // Reseting the draw variables (IE camera) for the player.
            if ( localMultiplayer )
            {
                player2.spriteAnimation.resetSingletonReferences();
            }

            animationManager = new AnimationManager( );
            artManager.tilesetList = new TilesetList();
            doorManager = new DoorManager();

            // Checking if we should initalize the asset manager with more than one player.
            if ( localMultiplayer )
            {
                assistManager = new AssistManager( ref player1, ref player2 );
            }
            else
            {
                assistManager = new AssistManager( ref player1 );
            }

            assistManager.initalizeSingletonData();
            npcManager = new NPCManager();

            // Reloading data:
            tmxLoading( ref mapToLoad, ref nextRoomSize, ref nextRoomStart, ref currentMap, ref camera, ref collision, ref assistManager, ref animationManager, ref doorManager, ref timerManager, ref npcManager, ref player1, ref player2 );
            artManager.tilesetList.loadAll( );

            // Reseting the starting position if need be:
            if ( exitPosition != Vector2.Zero )
            { // Start Exit Position if.

                // Adding the screenoffset to the position since it was not calculated when the exit position was read in.
                //player1.spriteAnimation.position = exitPosition + camera.screenOffset;
                player1.spriteAnimation.position = exitPosition;

                if ( localMultiplayer )
                {
                    //player2.spriteAnimation.position = exitPosition + camera.screenOffset;
                    player2.spriteAnimation.position = exitPosition;
                }

            } // Start Exit Position if.
            else
            { // Start exitPosition is zero else.

                player1.spriteAnimation.position = currentMap.playerOneStart;

                if ( localMultiplayer )
                {
                    player2.spriteAnimation.position = currentMap.playerTwoStart;
                }

            } // End exitPosition is zero else.
        }
Пример #18
0
 public Art(ArtManager owner)
 {
     Owner = owner;
 }
Пример #19
0
 internal Art(ArtManager owner)
 {
     Owner = owner;
 }
Пример #20
0
        static unsafe void Main(string[] args)
        {
            BizHawk.Bizware.BizwareGL.IGL igl = new BizHawk.Bizware.BizwareGL.Drivers.OpenTK.IGL_TK();

            List <Art> testArts = new List <Art>();
            ArtManager am       = new ArtManager(igl);

            foreach (var name in typeof(Program).Assembly.GetManifestResourceNames())
            {
                if (name.Contains("flame"))
                {
                    testArts.Add(am.LoadArt(typeof(Program).Assembly.GetManifestResourceStream(name)));
                }
            }
            var smile = am.LoadArt(typeof(Program).Assembly.GetManifestResourceStream("BizHawk.Bizware.Test.TestImages.smile.png"));

            am.Close(true);
            StringRenderer sr;

            using (var xml = typeof(Program).Assembly.GetManifestResourceStream("BizHawk.Bizware.Test.TestImages.courier16px.fnt"))
                using (var tex = typeof(Program).Assembly.GetManifestResourceStream("BizHawk.Bizware.Test.TestImages.courier16px_0.png"))
                    sr = new StringRenderer(igl, xml, tex);

            GuiRenderer gr = new GuiRenderer(igl);

            TestForm tf = new TestForm();
            RetainedGraphicsControl c = new RetainedGraphicsControl(igl);

            tf.Controls.Add(c);
            c.Dock          = System.Windows.Forms.DockStyle.Fill;
            tf.FormClosing += (object sender, System.Windows.Forms.FormClosingEventArgs e) =>
            {
                tf.Controls.Remove(c);
                c.Dispose();
                c = null;
            };
            tf.Show();

            //tf.Paint += (object sender, PaintEventArgs e) => c.Refresh();

            c.SetVsync(false);

            //create a render target
            RenderTarget rt = igl.CreateRenderTarget(60, 60);

            rt.Bind();
            igl.SetClearColor(Color.Blue);
            igl.Clear(ClearBufferMask.ColorBufferBit);
            gr.Begin(60, 60, true);
            gr.Draw(smile);
            gr.End();
            rt.Unbind();

            Texture2d rttex2d = igl.LoadTexture(rt.Texture2d.Resolve());

            //test retroarch shader
            RenderTarget rt2 = igl.CreateRenderTarget(240, 240);

            rt2.Bind();
            igl.SetClearColor(Color.CornflowerBlue);
            igl.Clear(ClearBufferMask.ColorBufferBit);
            RetroShader shader;

            using (var stream = typeof(Program).Assembly.GetManifestResourceStream("BizHawk.Bizware.Test.TestImages.4xSoft.glsl"))
                shader = new RetroShader(igl, new System.IO.StreamReader(stream).ReadToEnd());
            igl.SetBlendState(igl.BlendNone);
            shader.Run(rttex2d, new Size(60, 60), new Size(240, 240), true);


            bool running = true;

            c.MouseClick += (object sender, MouseEventArgs e) =>
            {
                if (e.Button == MouseButtons.Left)
                {
                    running ^= true;
                }
                if (e.Button == MouseButtons.Right)
                {
                    c.Retain ^= true;
                }
            };

            DateTime start  = DateTime.Now;
            int      wobble = 0;

            for (; ;)
            {
                if (c == null)
                {
                    break;
                }

                if (running)
                {
                    c.Begin();

                    igl.SetClearColor(Color.Red);
                    igl.Clear(ClearBufferMask.ColorBufferBit);

                    int frame = (int)((DateTime.Now - start).TotalSeconds) % testArts.Count;

                    gr.Begin(c.ClientSize.Width, c.ClientSize.Height);

                    gr.SetModulateColor(Color.Green);
                    gr.RectFill(250, 0, 16, 16);

                    gr.SetBlendState(igl.BlendNone);
                    gr.Draw(rttex2d, 0, 20);
                    gr.SetBlendState(igl.BlendNormal);

                    sr.RenderString(gr, 0, 0, "?? fps");
                    gr.SetModulateColor(Color.FromArgb(255, 255, 255, 255));
                    gr.SetCornerColor(0, OpenTK.Graphics.Color4.Red);
                    gr.Draw(rt2.Texture2d, 0, 0);
                    gr.SetCornerColor(0, OpenTK.Graphics.Color4.White);
                    gr.SetModulateColorWhite();
                    gr.Modelview.Translate((float)Math.Sin(wobble / 360.0f) * 50, 0);
                    gr.Modelview.Translate(100, 100);
                    gr.Modelview.Push();
                    gr.Modelview.Translate(testArts[frame].Width, 0);
                    gr.Modelview.Scale(-1, 1);
                    wobble++;
                    gr.SetModulateColor(Color.Yellow);
                    gr.DrawFlipped(testArts[frame], true, false);
                    gr.SetModulateColorWhite();
                    gr.Modelview.Pop();
                    gr.SetBlendState(igl.BlendNormal);
                    gr.Draw(smile);

                    gr.End();


                    c.SwapBuffers();
                    c.End();
                }

                System.Windows.Forms.Application.DoEvents();
                System.Threading.Thread.Sleep(0);
            }
        }
Пример #21
0
 public void Initialize()
 {
     inst = this;
 }
Пример #22
0
 void Awake()
 {
     s_art_manager = this;
     m_art         = new DefaultArtStyle();
 }