public void LoadContent(ContentManager content) { var atlas = content.Load <TextureAtlas>("Textures/Atoms"); _atomRegions = new TextureAtlasRegion[5]; for (int i = 0; i < _atomRegions.Length; i++) { _atomRegions[i] = atlas.GetRegion("Atom" + i); } _hConnection = atlas.GetRegion("HConnection"); _vConnection = atlas.GetRegion("VConnection"); _defaultFont = content.Load <BitmapFont>("Fonts/ArialRounded18pt"); // spacing _defaultFont.Spacing = new Point(0, _defaultFont.Spacing.Y); // whitespace with var wsIndex = Array.BinarySearch(_defaultFont.Data.Characters, ' '); if (wsIndex != -1) { _defaultFont.Data.CharacterInformations[wsIndex].XAdvance = 10; } }
public MonoGameSprite(TextureAtlasRegion region, int x, int y, int width, int height) : base(region, x, y, width, height) { if (region.getRotatedPackedHeight() != region.getRegionHeight()) { rotate90(false); } }
public TextureAtlasRegion findRegion(string str) { for (int i = 0; i < _atlasImages.size; i++) { TextureAtlasRegion textureAtlasRegion = _atlasImages.get(i) as TextureAtlasRegion; if (textureAtlasRegion.getName().Equals(str)) { return(textureAtlasRegion); } } return(null); }
public Array findRegions(string str) { Array result = new Array(); for (int i = 0; i < _atlasImages.size; i++) { TextureAtlasRegion textureAtlasRegion = _atlasImages.get(i) as TextureAtlasRegion; if (textureAtlasRegion.getName().Equals(str)) { result.add(textureAtlasRegion); } } return(result); }
public TextureAtlasRegion findRegion(string str, int index) { for (int i = 0; i < _atlasImages.size; i++) { TextureAtlasRegion textureAtlasRegion = _atlasImages.get(i) as TextureAtlasRegion; if (!textureAtlasRegion.getName().Equals(str)) { continue; } if (textureAtlasRegion.getIndex() != index) { continue; } return(textureAtlasRegion); } return(null); }
public MonoGameSprite(TextureAtlasRegion region, int width, int height) : this(region, 0, 0, width, height) { }
public MonoGameSprite(TextureAtlasRegion region) : this(region, region.getRegionWidth(), region.getRegionHeight()) { }