public BmFont(Texturing texturingManager, string name) { System.Console.WriteLine("Loading BmFont \"" + name + "\""); texId = texturingManager.LoadTexture(fontDir + name + ".png"); string[] lines = System.IO.File.ReadAllLines(fontDir + name + ".fnt"); for (int i = 0; i < lines.Length; i++) { string line = lines[i].Trim(); //Comments if (line.StartsWith("#")) { continue; } string[] args = line.Split(' '); if (args[0].Equals("common")) { parseCommon(args); } else if (args[0].Equals("char")) { parseCharacter(args); } else if (args[0].Equals("kerning")) { parseKerning(args); } } }
void OnWorldInfoReceived(WorldStats worldStats) { this.worldStats = worldStats; WorldInfoRecieved = true; Texture2D texture2D = Texturing.TextureFromColourMap(worldStats.colourWorld, WorldGenerator.worldPartSize, WorldGenerator.worldPartSize); meshRenderer.material.mainTexture = texture2D; UpdateTerrainChunk(); }
private void glControl_Load(object sender, EventArgs e) { glControl.MakeCurrent(); GL.Enable(EnableCap.Texture2D); GL.ClearColor(Color.FromArgb(200, 200, 200)); renderer = new Renderer(); texturing = new Texturing(); camera = new Camera(new Vector2(0, 0), 1.0); for (int i = 0; i < 52; i++) { texIds.Add(texturing.LoadTexture("Resources/tiles/" + i + ".png")); } t = new System.Timers.Timer(1000.0 / 60.0); t.Elapsed += t_Elapsed; t.Start(); }
public void RendWorld() { WorldStats worldStats = GenerateWorld(Vector2.zero); WorldDisplay display = FindObjectOfType <WorldDisplay>(); if (drawMode == DrawMode.NoiseWorld) { display.DrawTexture(Texturing.TextureFromHeightMap(worldStats.heightWorld)); } else if (drawMode == DrawMode.ColourWorld) { display.DrawTexture(Texturing.TextureFromColourMap(worldStats.colourWorld, worldPartSize, worldPartSize)); } else if (drawMode == DrawMode.Mesh) { display.DrawMesh(MeshGenerator.GenerateTerrainMesh(worldStats.heightWorld, meshHeightMultiplier, meshHeightCurve, ValueLevelOfDetail), Texturing.TextureFromColourMap(worldStats.colourWorld, worldPartSize, worldPartSize)); } else if (drawMode == DrawMode.FallMap) { display.DrawTexture(Texturing.TextureFromHeightMap(FallGenerator.GenerateFall(worldPartSize))); } }
public void RemoveSprite(Texturing.SpriteTexture sprite) { if (!allSprites.Contains(sprite)) return; allSprites.Remove(sprite); }
public void AddSprite(Texturing.SpriteTexture sprite) { allSprites.Add(sprite); }