Exemplo n.º 1
0
 public Font(string textureName, string texturePath, int numColumns, int firstCharacterASCIIValue, int charWidth, int charHeight)
 {
     this.textureName = textureName;
     texture          = GraphicsManager.AddTexture(this.textureName, texturePath);
     firstVal         = firstCharacterASCIIValue;
     characterWidth   = charWidth;
     characterHeight  = charHeight;
     numCol           = numColumns;
 }
Exemplo n.º 2
0
        public override void Start()
        {
            LoadTexture();

            FontManager.Init();
            Font stdFont = FontManager.AddFont("stdFont", "Assets/Fonts/textSheet.png", 15, 32, 20, 20);

            fpsText = new TextObject(new Vector2(0, 0));

            TmxReader    reader = new TmxReader("Assets/Levels/map-8x8.tmx");
            TileSet      ts     = reader.TileSet;
            List <Layer> layers = reader.Layers;

            GraphicsManager.AddTexture(ts.ImgPath, ts.ImgPath);
            tileObjs = new List <TileObj>();

            foreach (Layer each in layers)
            {
                AddTilesFor(each, tileObjs);
            }

            base.Start();
        }