/// <summary> /// Draw Item /// </summary> /// <param name="id"></param> /// <param name="dst"></param> /// <param name="fade"></param> public virtual void Draw(Enum id, Rectangle dst, float fade = 1) { Rectangle src = GetEntry(id).GetRectangle; TextureHandler tex = GetTexture(id); tex.Draw(dst, src, Color.White * fade); }
public void LoadFonts() { ArchiveWorker aw = new ArchiveWorker(Memory.Archives.A_MENU); string sysfntTdwFilepath = aw.GetListOfFiles().First(x => x.ToLower().Contains("sysfnt.tdw")); string sysfntFilepath = aw.GetListOfFiles().First(x => x.ToLower().Contains("sysfnt.tex")); TEX tex = new TEX(ArchiveWorker.GetBinaryFile(Memory.Archives.A_MENU, sysfntFilepath)); sysfnt = tex.GetTexture((int)ColorID.White); sysfntbig = new TextureHandler("sysfld{0:00}.tex", tex, 2, 1, (int)ColorID.White); ReadTdw(ArchiveWorker.GetBinaryFile(Memory.Archives.A_MENU, sysfntTdwFilepath)); }
public virtual void Draw(Enum id, Rectangle dst, Vector2 fill, float fade = 1) { Rectangle src = GetEntry(id).GetRectangle; if (fill == Vector2.UnitX) { float r = (float)dst.Height / dst.Width; src.Height = (int)Math.Round(src.Height * r); } else if (fill == Vector2.UnitY) { float r = (float)dst.Width / dst.Height; src.Width = (int)Math.Round(src.Width * r); } TextureHandler tex = GetTexture(id); tex.Draw(dst, src, Color.White * fade); }
protected virtual void InitTextures(ArchiveWorker aw = null) { if (Textures == null) { Textures = new List <TextureHandler>(TextureCount.Sum()); } if (Textures.Count <= 0) { if (aw == null) { aw = new ArchiveWorker(ArchiveString); } TEX tex; Scale = new Dictionary <uint, Vector2>(TextureCount.Sum()); int b = 0; for (int j = 0; j < TextureCount.Length; j++) { for (uint i = 0; i < TextureCount[j]; i++) { string path = aw.GetListOfFiles().First(x => x.ToLower().Contains(string.Format(TextureFilename[j], i + TextureStartOffset))); tex = new TEX(ArchiveWorker.GetBinaryFile(ArchiveString, path)); if (TextureBigFilename != null && FORCE_ORIGINAL == false && b < TextureBigFilename.Length && b < TextureBigSplit.Length) { TextureHandler th = new TextureHandler(TextureBigFilename[b], tex, 2, TextureBigSplit[b++] / 2); Textures.Add(th); Scale[i] = Vector2.One;//th.GetScale(); } else { TextureHandler th = new TextureHandler(path, tex); Textures.Add(th); Scale[i] = th.GetScale(); } } } } }