public static void AssertTextureExists(string name, string source) { if (!GeneralTextureManager.ContainsTexture(name)) { ThrowExistanceException(name, source, "is not loaded"); } }
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; }
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); }
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()"); }
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"); } }
private static void InitializeTextures() { GeneralTextureManager.LoadTextures("textures.txt"); }