예제 #1
0
 public Collidable(LoadedTexture t, Color c, Vector2 o, float d)
 {
     loadedTexture = t;
     color         = c;
     origin        = o;
     depth         = d;
 }
 public Collidable(LoadedTexture t, Color c, Vector2 o, float d)
 {
     loadedTexture = t;
     color = c;
     origin = o;
     depth = d;
 }
        public static void LoadTexture(String textureName)
        {
            Texture2D texture;
            try
            {
                texture = content.Load<Texture2D>(textureName);
            }
            catch (Exception)
            {
                throw new Exception("There was a problem loading the texture.");
            }

            // Have CollisionTexture initialize and pre-calcuate and add the texture to the dictionary.
            LoadedTexture collisionTexture = new LoadedTexture(texture);
            textures[textureName] = collisionTexture;
        }
예제 #4
0
        public static void LoadTexture(String textureName)
        {
            Texture2D texture;

            try
            {
                texture = content.Load <Texture2D>(textureName);
            }
            catch (Exception)
            {
                throw new Exception("There was a problem loading the texture.");
            }

            // Have CollisionTexture initialize and pre-calcuate and add the texture to the dictionary.
            LoadedTexture collisionTexture = new LoadedTexture(texture);

            textures[textureName] = collisionTexture;
        }