public class SeviyeGump : Gump
{
private Mobile from;
public SeviyeGump(Mobile m)
: base( 0, 0 )
{
from = m;
PlayerMobile pm = m as PlayerMobile;
int xdeger = (pm.Exp * 100) / pm.NeedExp;
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
this.AddPage(0);
this.AddBackground(157, 58, 510, 434, 83);
this.AddImageTiled(259, 224, 100, 12, 5055);
this.AddImageTiled(259, 224, xdeger, 12, 9271);
this.AddLabel(261, 246, 1153, "%"+xdeger+"");
}
public void AddProgressBar(int x, int y, int w, int h, string text, double min, double max, Color color, Color back, Color fore)
{
var bg = String.Format("<BODYBGCOLOR=#{0:X}>", back.ToArgb( ) );
var fg = String.Format("<BODYBGCOLOR=#{0:X}>", fore.ToArgb( ) );
var label = String.Format("<BASEFONT COLOR=#{0:X}><CENTER>{1} {2:#,0.0}%", color.ToArgb( ), text, ( min / max ) * 100 );
AddHtml( x, y, w, h, bg, false, false );
AddHtml( x + 2, y + 2, (int)Math.Ceiling( ( w - 4 ) * ( min / max ) ), h - 4, fg, false, false );
AddHtml( x + 2, y + 2, w - 4, h - 4, label, false, false );
}
AddProgressBar( 0, 0, 300, 30, "Progress", 33, 100, Color.White, Color.Black, Color.Blue );
Am I crazy or does VNC support all kinds of background colors? Solid, Rainbow, etc.You don't have to use tiled images, you can use any solid color you wish;
Code:public void AddProgressBar(int x, int y, int w, int h, string text, double min, double max, Color color, Color back, Color fore) { var bg = String.Format("<BODYBGCOLOR=#{0:X}>", back.ToArgb( ) ); var fg = String.Format("<BODYBGCOLOR=#{0:X}>", fore.ToArgb( ) ); var label = String.Format("<BASEFONT COLOR=#{0:X}><CENTER>{1} {2:#,0.0}%", color.ToArgb( ), text, ( min / max ) * 100 ); AddHtml( x, y, w, h, bg, false, false ); AddHtml( x + 2, y + 2, (int)Math.Ceiling( ( w - 4 ) * ( min / max ) ), h - 4, fg, false, false ); AddHtml( x + 2, y + 2, w - 4, h - 4, label, false, false ); }
Code:AddProgressBar( 0, 0, 300, 30, "Progress", 33, 100, Color.White, Color.Black, Color.Blue );
Am I crazy or does VNC support all kinds of background colors? Solid, Rainbow, etc.
Perhaps
You can manipulate colors in a lot of interesting ways and even draw images in gumps.
https://github.com/Vita-Nex/Core/tree/master/SuperGumps/Framework/Base/Entries
However, the code in my example above does not require VNc.
Can you explain me what is it exactly?
And thanks for all.
We use essential cookies to make this site work, and optional cookies to enhance your experience.