示例#1
0
 public static void AssertTextureExists(string name, string source)
 {
     if (!GeneralTextureManager.ContainsTexture(name))
     {
         ThrowExistanceException(name, source, "is not loaded");
     }
 }
示例#2
0
        public GeneralTexture(string texture, Vector2D position)
        {
            this.position = position;

            this.texture         = GeneralTextureManager.GetTexture(texture);
            this.sprite          = new SFML.Graphics.Sprite(this.texture);
            this.sprite.Position = this.position.InternalVector;
        }
示例#3
0
        public Background(string texture, Vector2D position, Vector2D push)
        {
            this.push     = push;
            this.pushRate = 0.15f;

            this.position = position;

            this.texture = GeneralTextureManager.GetTexture(texture);
            this.sprite  = new Sprite(this.texture);
        }
示例#4
0
        public static Tile GetRightTile(string textureName, Vector2D position,
                                        bool isHollow)
        {
            if (GeneralTextureManager.ContainsTexture(textureName))
            {
                return(new Tile(isHollow, textureName, position));
            }
            else if (CollectionHelper.DictionaryContains <AnimationGroup>(AnimationGroupManager.AnimationGroups, textureName))
            {
                return(new AnimatedTile(isHollow, textureName, new Vector2D(position.X, position.Y)));
            }

            throw new KeyNotFoundException("Symbol '" + textureName + "' is neither " +
                                           "a texture or an animation. source:RightTileCreator.GetRightTile()");
        }
示例#5
0
        public AnimationGroup(int interval, int framesOnX, int framesOnY,
                              string frameset, Vector2D frameSize, int[] references)
        {
            this.interval         = interval;
            this.frameSize        = frameSize;
            this.frameCount       = (width = framesOnX) * (height = framesOnY);
            this.currentAnimation = string.Empty;

            base.Texture = GeneralTextureManager.GetTexture(frameset);

            if (references.Length == frameCount)
            {
                CreateFrames(references);
            }
            else
            {
                throw new ArgumentException("Invalid references array. source:AnimationGroup cntr");
            }
        }
示例#6
0
 private static void InitializeTextures()
 {
     GeneralTextureManager.LoadTextures("textures.txt");
 }