本文整理汇总了C#中Client.MirControls.MirLabel类的典型用法代码示例。如果您正苦于以下问题:C# MirLabel类的具体用法?C# MirLabel怎么用?C# MirLabel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MirLabel类属于Client.MirControls命名空间,在下文中一共展示了MirLabel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public void Draw(Point displayLocation)
{
long timeRemaining = ExpireTime - CMain.Time;
if (DamageLabel == null)
{
DamageLabel = new MirLabel
{
AutoSize = true,
BackColour = Color.Transparent,
ForeColour = Colour,
OutLine = true,
OutLineColour = Color.Black,
Text = Text,
Font = new Font(Settings.FontName, 10F, FontStyle.Bold)
};
DamageLabel.Disposing += label_Disposing;
MapObject.DamageLabelList.Add(DamageLabel);
}
displayLocation.Offset((int)(15 - (Text.Length * 3)), (int)(((int)((double)timeRemaining / Factor)) - Distance) - 75 - Offset);
DamageLabel.Location = displayLocation;
DamageLabel.Draw();
}
示例2: MirGoodsCell
public bool usePearls = false;//pearl currency
public MirGoodsCell()
{
Size = new Size(205, 32);
BorderColour = Color.Lime;
NameLabel = new MirLabel
{
AutoSize = true,
Parent = this,
NotControl = true,
Location = new Point(44, 0),
};
CountLabel = new MirLabel
{
AutoSize = true,
Parent = this,
NotControl = true,
DrawControlTexture = true,
Location = new Point(23, 17),
ForeColour = Color.Yellow,
};
PriceLabel = new MirLabel
{
AutoSize = true,
Parent = this,
NotControl = true,
Location = new Point(44, 14),
};
BeforeDraw += (o, e) => Update();
AfterDraw += (o, e) => DrawItem();
}
示例3: CreateNPCLabel
public void CreateNPCLabel(string word, int wordOrder)
{
TempLabel = null;
for (int i = 0; i < LabelList.Count; i++)
{
if (LabelList[i].Text != word || LabelList[i].ForeColour != (wordOrder == 0 ? NameColour : Color.White)) continue;
TempLabel = LabelList[i];
break;
}
if (TempLabel != null && !TempLabel.IsDisposed) return;
TempLabel = new MirLabel
{
AutoSize = true,
BackColour = Color.Transparent,
ForeColour = wordOrder == 0 ? NameColour : Color.White,
OutLine = true,
OutLineColour = Color.Black,
Text = word,
};
TempLabel.Disposing += (o, e) => LabelList.Remove(TempLabel);
LabelList.Add(TempLabel);
}
示例4: MirButton
public MirButton()
{
HoverIndex = -1;
PressedIndex = -1;
Sound = SoundList.ButtonB;
_label = new MirLabel
{
NotControl = true,
Parent = this,
};
}
示例5: MirInputBox
public MirInputBox(string message)
{
Modal = true;
Movable = false;
Index = 660;
Library = Libraries.Prguse;
Location = new Point((Settings.ScreenWidth - Size.Width) / 2, (Settings.ScreenHeight - Size.Height) / 2);
CaptionLabel = new MirLabel
{
DrawFormat = TextFormatFlags.WordBreak,
Location = new Point(25, 25),
Size = new Size(235, 40),
Parent = this,
Text = message,
};
InputTextBox = new MirTextBox
{
Parent = this,
Border = true,
BorderColour = Color.Lime,
Location = new Point(23, 86),
Size = new Size(240, 19),
MaxLength = 50,
};
InputTextBox.SetFocus();
InputTextBox.TextBox.KeyPress += MirInputBox_KeyPress;
OKButton = new MirButton
{
HoverIndex = 201,
Index = 200,
Library = Libraries.Title,
Location = new Point(60, 123),
Parent = this,
PressedIndex = 202,
};
CancelButton = new MirButton
{
HoverIndex = 204,
Index = 203,
Library = Libraries.Title,
Location = new Point(160, 123),
Parent = this,
PressedIndex = 205,
};
CancelButton.Click += DisposeDialog;
}
示例6: LoginScene
public LoginScene()
{
SoundManager.PlaySound(SoundList.IntroMusic, true);
Disposing += (o, e) => SoundManager.StopSound(SoundList.IntroMusic);
_background = new MirAnimatedControl
{
Animated = false,
AnimationCount = 19,
AnimationDelay = 100,
Index = 0,
Library = Libraries.ChrSel,
Loop = false,
Parent = this,
};
_login = new LoginDialog {Parent = _background, Visible = false};
_login.AccountButton.Click += (o, e) =>
{
_login.Hide();
_account = new NewAccountDialog { Parent = _background };
_account.Disposing += (o1, e1) => _login.Show();
};
_login.PassButton.Click += (o, e) =>
{
_login.Hide();
_password = new ChangePasswordDialog { Parent = _background };
_password.Disposing += (o1, e1) => _login.Show();
};
Version = new MirLabel
{
AutoSize = true,
BackColour = Color.FromArgb(200, 50, 50, 50),
Border = true,
BorderColour = Color.Black,
Location = new Point(5, 580),
Parent = _background,
Text = string.Format("Version: {0}", Application.ProductVersion),
};
_connectBox = new MirMessageBox("Attempting to connect to the server.", MirMessageBoxButtons.Cancel);
_connectBox.CancelButton.Click += (o, e) => Program.Form.Close();
Shown += (sender, args) =>
{
Network.Connect();
_connectBox.Show();
};
}
示例7: ChatNoticeDialog
public ChatNoticeDialog()
{
Index = 1361;
Library = Libraries.Prguse;
Movable = false;
Sort = false;
Location = new Point(Settings.ScreenWidth / 2 - Size.Width / 2, Settings.ScreenHeight / 6 - Size.Height / 2);
Opacity = 0.7F;
TextLabel1 = new MirLabel
{
Text = "",
Font = new Font(Settings.FontName, 10F),
DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter,
Parent = this,
NotControl = true,
Location = new Point(0, -6),
Size = new Size(660, 40),
ForeColour = Color.Yellow,
OutLineColour = Color.Black,
};
TextLabel2 = new MirLabel
{
Text = "",
Font = new Font(Settings.FontName, 15F),
DrawFormat = TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter,
Parent = this,
NotControl = true,
Location = new Point(0, 0),
Size = new Size(660, 40),
ForeColour = Color.Yellow,
OutLineColour = Color.Black,
};
Layout = new MirImageControl
{
Index = 1360,
Library = Libraries.Prguse,
Location = new Point(0, 0),
Parent = this
};
AfterDraw += ChatNotice_AfterDraw;
}
示例8: CreateDebugLabel
private static void CreateDebugLabel()
{
if (!Settings.DebugMode) return;
if (DebugBaseLabel == null || DebugBaseLabel.IsDisposed)
{
DebugBaseLabel = new MirControl
{
BackColour = Color.FromArgb(50, 50, 50),
Border = true,
BorderColour = Color.Black,
DrawControlTexture = true,
Location = new Point(5, 5),
NotControl = true,
Opacity = 0.5F
};
}
if (DebugTextLabel == null || DebugTextLabel.IsDisposed)
{
DebugTextLabel = new MirLabel
{
AutoSize = true,
BackColour = Color.Transparent,
ForeColour = Color.White,
Parent = DebugBaseLabel,
};
DebugTextLabel.SizeChanged += (o, e) => DebugBaseLabel.Size = DebugTextLabel.Size;
}
string text;
if (MirControl.MouseControl != null)
{
text = string.Format("FPS: {0}", FPS);
if (MirControl.MouseControl is MapControl)
text += string.Format(", Co Ords: {0}", MapControl.MapLocation);
if (MirScene.ActiveScene is GameScene)
text += string.Format(", Objects: {0}", MapControl.Objects.Count);
}
else
{
text = string.Format("FPS: {0}", FPS);
}
DebugTextLabel.Text = text;
}
示例9: NewCharacterDialog
//.........这里部分代码省略.........
PressedIndex = 2431,
Sound = SoundList.ButtonA,
};
WizardButton.Click += (o, e) =>
{
_class = MirClass.Wizard;
UpdateInterface();
};
TaoistButton = new MirButton
{
HoverIndex = 2433,
Index = 2432,
Library = Libraries.Prguse,
Location = new Point(423, 296),
Parent = this,
PressedIndex = 2434,
Sound = SoundList.ButtonA,
};
TaoistButton.Click += (o, e) =>
{
_class = MirClass.Taoist;
UpdateInterface();
};
AssassinButton = new MirButton
{
HoverIndex = 2436,
Index = 2435,
Library = Libraries.Prguse,
Location = new Point(473, 296),
Parent = this,
PressedIndex = 2437,
Sound = SoundList.ButtonA,
};
AssassinButton.Click += (o, e) =>
{
_class = MirClass.Assassin;
UpdateInterface();
};
ArcherButton = new MirButton
{
HoverIndex = 2439,
Index = 2438,
Library = Libraries.Prguse,
Location = new Point(523, 296),
Parent = this,
PressedIndex = 2440,
Sound = SoundList.ButtonA,
};
ArcherButton.Click += (o, e) =>
{
_class = MirClass.Archer;
UpdateInterface();
};
MaleButton = new MirButton
{
HoverIndex = 2421,
Index = 2421,
Library = Libraries.Prguse,
Location = new Point(323, 343),
Parent = this,
PressedIndex = 2422,
Sound = SoundList.ButtonA,
};
MaleButton.Click += (o, e) =>
{
_gender = MirGender.Male;
UpdateInterface();
};
FemaleButton = new MirButton
{
HoverIndex = 2424,
Index = 2423,
Library = Libraries.Prguse,
Location = new Point(373, 343),
Parent = this,
PressedIndex = 2425,
Sound = SoundList.ButtonA,
};
FemaleButton.Click += (o, e) =>
{
_gender = MirGender.Female;
UpdateInterface();
};
Description = new MirLabel
{
Border = true,
Location = new Point(279, 70),
Parent = this,
Size = new Size(278, 170),
Text = WarriorDescription,
};
}
示例10: SelectScene
public SelectScene(List<SelectInfo> characters)
{
SoundManager.PlaySound(SoundList.SelectMusic, true);
Disposing += (o, e) => SoundManager.StopSound(SoundList.SelectMusic);
Characters = characters;
SortList();
KeyPress +=SelectScene_KeyPress;
Background = new MirImageControl
{
Index = 64,
Library = Libraries.Prguse,
Parent = this,
};
Title = new MirImageControl
{
Index = 40,
Library = Libraries.Title,
Parent = this,
Location = new Point(364, 12)
};
ServerLabel = new MirLabel
{
Location = new Point(322, 44),
Parent = Background,
Size = new Size(155, 17),
Text = "Legend of Mir 2",
DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter
};
StartGameButton = new MirButton
{
Enabled = false,
HoverIndex = 341,
Index = 340,
Library = Libraries.Title,
Location = new Point(110, 568),
Parent = Background,
PressedIndex = 342
};
StartGameButton.Click += (o, e) => StartGame();
NewCharacterButton = new MirButton
{
HoverIndex = 344,
Index = 343,
Library = Libraries.Title,
Location = new Point(230, 568),
Parent = Background,
PressedIndex = 345,
GrayScale = true
};
NewCharacterButton.Click += (o, e) => _character = new NewCharacterDialog { Parent = this };
DeleteCharacterButton = new MirButton
{
HoverIndex = 347,
Index = 346,
Library = Libraries.Title,
Location = new Point(350, 568),
Parent = Background,
PressedIndex = 348
};
DeleteCharacterButton.Click += (o, e) => DeleteCharacter();
CreditsButton = new MirButton
{
HoverIndex = 350,
Index = 349,
Library = Libraries.Title,
Location = new Point(470, 568),
Parent = Background,
PressedIndex = 351
};
ExitGame = new MirButton
{
HoverIndex = 353,
Index = 352,
Library = Libraries.Title,
Location = new Point(590, 568),
Parent = Background,
PressedIndex = 354
};
ExitGame.Click += (o, e) => Program.Form.Close();
CharacterDisplay = new MirAnimatedControl
{
Animated = true,
AnimationCount = 16,
AnimationDelay = 250,
FadeIn = true,
FadeInDelay = 75,
//.........这里部分代码省略.........
示例11: QuestGroupQuestItem
public QuestGroupQuestItem(string group, List<ClientQuestProgress> quests, bool expanded)
{
Group = group;
Quests = quests;
Expanded = expanded;
_expandButton = new MirButton
{
Index = Expanded ? 917 : 918,
Library = Libraries.Prguse,
Parent = this,
Size = new Size(16, 14),
Location = new Point(0, 0),
Sound = SoundList.ButtonA
};
_expandButton.Click += (o, e) => ChangeExpand();
_groupLabel = new MirLabel
{
Text = Group,
AutoSize = true,
Parent = this,
Font = new Font(Settings.FontName, 8F),
ForeColour = Color.LimeGreen,
Location = new Point(18, 0),
Visible = true,
};
for (int i = 0; i < Quests.Count; i++)
{
QuestSingleQuestItem singleQuest = new QuestSingleQuestItem(Quests[i])
{
Parent = this,
Location = new Point(18, (15 * (i + 1))),
Size = new Size(280, 15),
Visible = Expanded
};
singleQuest.SelectedQuestChanged += (o, e) => OnSelectedQuestChanged(o);
_tasks.Add(singleQuest);
if (Expanded)
SizeY += 15;
}
Size = new Size(280, SizeY);
}
示例12: DisplayQuests
public void DisplayQuests()
{
foreach (MirLabel label in TaskLines)
label.Dispose();
List<ClientQuestProgress> questsToTrack = new List<ClientQuestProgress>();
questsToTrack.Clear();
questsToTrack.AddRange(from quest in MapObject.User.CurrentQuests from id in TrackedQuestsIds.Where(id => quest.Id == id) select quest);
if (questsToTrack.Count < 1)
{
Hide();
return;
}
int y = 0;
for (int i = 0; i < questsToTrack.Count; i++)
{
_questNameLabel = new MirLabel
{
Text = questsToTrack[i].QuestInfo.Name,
AutoSize = true,
BackColour = Color.Transparent,
Font = QuestFont,
ForeColour = Color.LimeGreen,
Location = new Point(5, 20 + y),
OutLine = true,
Parent = this,
Visible = true,
};
TaskLines.Add(_questNameLabel);
foreach (string questToTrack in questsToTrack[i].TaskList)
{
y += 15;
string trackedQuest = questToTrack;
_questTaskLabel = new MirLabel
{
Text = trackedQuest,
AutoSize = true,
BackColour = Color.Transparent,
Font = QuestFont,
ForeColour = Color.White, //trackedQuest.Contains("(Completed)") ? Color.LimeGreen :
Location = new Point(25, 20 + y),
OutLine = true,
Parent = this,
Visible = true,
};
TaskLines.Add(_questTaskLabel);
}
if (i >= 5) break;
y += 30;
}
Show();
}
示例13: QuestSingleQuestItem
public QuestSingleQuestItem(ClientQuestProgress quest)
{
Quest = quest;
Size = new Size(250, 15);
TrackQuest = GameScene.Scene.QuestTrackingDialog.TrackedQuestsIds.Contains(quest.Id);
string name = Quest.QuestInfo.Name;
string level = string.Format("Lv{0}", Quest.QuestInfo.MinLevelNeeded);
string state = quest.Completed ? "(Complete)" : "(In Progress)";
bool lowLevelQuest = (MapObject.User.Level - quest.QuestInfo.MinLevelNeeded) > 10;
BeforeDraw += QuestTaskSingleItem_BeforeDraw;
AfterDraw += QuestTaskSingleItem_AfterDraw;
_selectedImage = new MirImageControl
{
Index = 956,
Library = Libraries.Prguse,
Location = new Point(-10, 0),
Parent = this,
Visible = false
};
_questLabel = new MirLabel
{
Text = string.Format("{0,-4} {1}", level, name),
AutoSize = true,
Font = new Font(Settings.FontName, 8F),
ForeColour = lowLevelQuest ? Color.Gray : quest.New ? Color.Yellow : Color.White,
Parent = this,
Location = new Point(0, 0),
Sound = SoundList.ButtonA
};
_questLabel.Click += (o, e) =>
{
MouseEventArgs me = e as MouseEventArgs;
if (me == null) return;
switch (me.Button)
{
case MouseButtons.Left:
GameScene.Scene.QuestDetailDialog.DisplayQuestDetails(Quest);
break;
case MouseButtons.Right:
{
if (TrackQuest)
{
GameScene.Scene.QuestTrackingDialog.RemoveQuest(Quest);
}
else
{
if (GameScene.Scene.QuestTrackingDialog.TrackedQuestsIds.Count >= 5) return;
GameScene.Scene.QuestTrackingDialog.AddQuest(Quest);
}
TrackQuest = !TrackQuest;
}
break;
}
OnSelectedQuestChanged();
};
_stateLabel = new MirLabel
{
Text = string.Format("{0}", state),
AutoSize = true,
Font = new Font(Settings.FontName, 8F),
ForeColour = lowLevelQuest ? Color.Gray : quest.New ? Color.Yellow : Color.White,
Parent = this,
Location = new Point(185, 0),
Sound = SoundList.ButtonA
};
}
示例14: CreateLabel
public override void CreateLabel()
{
NameLabel = null;
GuildLabel = null;
for (int i = 0; i < LabelList.Count; i++)
{
if (LabelList[i].Text != Name || LabelList[i].ForeColour != NameColour) continue;
NameLabel = LabelList[i];
break;
}
for (int i = 0; i < LabelList.Count; i++)
{
if (LabelList[i].Text != GuildName || LabelList[i].ForeColour != NameColour) continue;
GuildLabel = LabelList[i];
break;
}
if (NameLabel != null && !NameLabel.IsDisposed && GuildLabel != null && !GuildLabel.IsDisposed) return;
NameLabel = new MirLabel
{
AutoSize = true,
BackColour = Color.Transparent,
ForeColour = NameColour,
OutLine = true,
OutLineColour = Color.Black,
Text = Name,
};
NameLabel.Disposing += (o, e) => LabelList.Remove(NameLabel);
LabelList.Add(NameLabel);
GuildLabel = new MirLabel
{
AutoSize = true,
BackColour = Color.Transparent,
ForeColour = NameColour,
OutLine = true,
OutLineColour = Color.Black,
Text = GuildName,
};
GuildLabel.Disposing += (o, e) => LabelList.Remove(GuildLabel);
LabelList.Add(GuildLabel);
}
示例15: MainDialog
//.........这里部分代码省略.........
};
MenuButton.Click += (o, e) =>
{
if (!GameScene.Scene.MenuDialog.Visible) GameScene.Scene.MenuDialog.Show();
else GameScene.Scene.MenuDialog.Hide();
};
GameShopButton = new MirButton
{
HoverIndex = 827,
Index = 826,
Library = Libraries.Prguse,
Location = new Point(this.Size.Width - 105, 35),
Parent = this,
PressedIndex = 828,
Sound = SoundList.ButtonC,
Hint = "Game Shop"
};
GameShopButton.Click += (o, e) =>
{
if (!GameScene.Scene.GameShopDialog.Visible) GameScene.Scene.GameShopDialog.Show();
else GameScene.Scene.GameShopDialog.Hide();
};
HealthOrb = new MirControl
{
Parent = this,
Location = new Point(0, 30),
NotControl = true,
};
HealthOrb.BeforeDraw += HealthOrb_BeforeDraw;
HealthLabel = new MirLabel
{
AutoSize = true,
Location = new Point(0, 27),
Parent = HealthOrb
};
HealthLabel.SizeChanged += Label_SizeChanged;
ManaLabel = new MirLabel
{
AutoSize = true,
Location = new Point(0, 42),
Parent = HealthOrb
};
ManaLabel.SizeChanged += Label_SizeChanged;
TopLabel = new MirLabel
{
Size = new Size(85, 30),
DrawFormat = TextFormatFlags.HorizontalCenter,
Location = new Point(9, 20),
Parent = HealthOrb,
};
BottomLabel = new MirLabel
{
Size = new Size(85, 30),
DrawFormat = TextFormatFlags.HorizontalCenter,
Location = new Point(9, 50),
Parent = HealthOrb,
};
LevelLabel = new MirLabel