public UOText(string text,string pathToFontFile) { _gidx = new GumpIdx(0, new byte[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}); _text=text; generateImage(); }
void loadIndexes() { FileStream fs = new FileStream(getFileDirectory(GumpPath)+"\\GumpIdx.mul",FileMode.Open,FileAccess.Read); BinaryReader br = new BinaryReader(fs); byte[] barr = new byte[12]; GumpIdx gidx; int id=0; while(true) { barr = br.ReadBytes(12); if (barr.Length < 12) break; gidx = new GumpIdx(id, barr); if (gidx.Lookup != 0xFFFFFFFF) { indexes.Add("0x"+Convert.ToString(id,16), gidx); } id++; } br.Close(); }
public GumpButton(GumpIdx gidx, string pathToGumpArt) : base(gidx,pathToGumpArt) { _pressedId=gidx.ID+1; }
public Gump(GumpIdx gidx, string pathToGumpArt) { image=Gump.getBitmap(gidx,pathToGumpArt); this._gidx=gidx; }
public static Bitmap getBitmap(GumpIdx gidx, string pathToGumpArt) { Bitmap img = new Bitmap(gidx.Width, gidx.Height); FileStream fs = new FileStream(pathToGumpArt,FileMode.Open,FileAccess.Read); BinaryReader br = new BinaryReader(fs); uint width=gidx.Width; uint height=gidx.Height; uint lookup=gidx.Lookup; uint size=gidx.Size; int[] lookupTable=new int[height]; int[] rgb; Color c; short length; fs.Seek(lookup,SeekOrigin.Begin); for(int i=0; i < height; i++) { lookupTable[i]=BitConverter.ToInt32(br.ReadBytes(4),0); } for(int y=0; y<height; y++) { fs.Seek(lookupTable[y]*4+lookup,SeekOrigin.Begin); for (int x=0; x<width; x++) { rgb=uoColorToRgb(BitConverter.ToUInt16(br.ReadBytes(2),0)); length=BitConverter.ToInt16(br.ReadBytes(2),0); c=Color.FromArgb(rgb[0]%255,rgb[1]%255,rgb[2]%255); for(int i=0; i<length; i++) { if(rgb[0] !=0 || rgb[1] !=0 || rgb[2] != 0) img.SetPixel(x+i, y, c); } x += length - 1; } } br.Close(); return img; }
public ResizableGump(GumpIdx gidx, string pathToGumpArt) : base(gidx, pathToGumpArt) { this._width = gidx.Width; this._height = gidx.Height; }