本文整理汇总了C#中Terraria.UI.UIElement类的典型用法代码示例。如果您正苦于以下问题:C# UIElement类的具体用法?C# UIElement怎么用?C# UIElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIElement类属于Terraria.UI命名空间,在下文中一共展示了UIElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Publish
private void Publish(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(10, -1, -1, 1);
try
{
TmodFile[] modFiles = ModLoader.FindMods();
bool ok = false;
TmodFile theTModFile = null;
foreach (TmodFile tModFile in modFiles)
{
if (Path.GetFileName(tModFile.Name).Equals(@Path.GetFileName(mod) + @".tmod"))
{
ok = true;
theTModFile = tModFile;
}
}
if (!ok)
{
throw new Exception();
}
System.Net.ServicePointManager.Expect100Continue = false;
string filename = @ModLoader.ModPath + @Path.DirectorySeparatorChar + @Path.GetFileName(mod) + @".tmod";
string url = "http://javid.ddns.net/tModLoader/publishmod.php";
using (var stream = File.Open(filename, FileMode.Open))
{
var files = new[]
{
new IO.UploadFile
{
Name = "file",
Filename = Path.GetFileName(filename),
// ContentType = "text/plain",
Stream = stream
}
};
BuildProperties bp = BuildProperties.ReadModFile(theTModFile);
var values = new NameValueCollection
{
{ "displayname", bp.displayName },
{ "name", Path.GetFileNameWithoutExtension(filename) },
{ "version", bp.version },
{ "author", bp.author },
{ "homepage", bp.homepage },
{ "description", bp.description },
{ "steamid64", Steamworks.SteamUser.GetSteamID().ToString() },
{ "modloaderversion", bp.modBuildVersion },
};
byte[] result = IO.UploadFile.UploadFiles(url, files, values);
string s = System.Text.Encoding.UTF8.GetString(result, 0, result.Length);
ErrorLogger.LogModPublish(s);
}
}
catch (WebException e)
{
ErrorLogger.LogModBrowserException(e);
}
}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:57,代码来源:UIModSourceItem.cs
示例2: Draw
public void Draw(SpriteBatch spriteBatch, GameTime time)
{
this.Use();
if (this._currentState != null)
{
MouseState state = Mouse.GetState();
this.MousePosition = new Vector2((float)state.X, (float)state.Y);
bool flag = state.LeftButton == ButtonState.Pressed && Main.hasFocus;
UIElement uIElement = Main.hasFocus ? this._currentState.GetElementAt(this.MousePosition) : null;
this._clickDisabledTimeRemaining = Math.Max(0.0, this._clickDisabledTimeRemaining - time.ElapsedGameTime.TotalMilliseconds);
bool flag2 = this._clickDisabledTimeRemaining > 0.0;
if (uIElement != this._lastElementHover)
{
if (this._lastElementHover != null)
{
this._lastElementHover.MouseOut(new UIMouseEvent(this._lastElementHover, this.MousePosition));
}
if (uIElement != null)
{
uIElement.MouseOver(new UIMouseEvent(uIElement, this.MousePosition));
}
this._lastElementHover = uIElement;
}
if (flag && !this._wasMouseDown && uIElement != null && !flag2)
{
this._lastElementDown = uIElement;
uIElement.MouseDown(new UIMouseEvent(uIElement, this.MousePosition));
if (this._lastElementClicked == uIElement && time.TotalGameTime.TotalMilliseconds - this._lastMouseDownTime < 500.0)
{
uIElement.DoubleClick(new UIMouseEvent(uIElement, this.MousePosition));
this._lastElementClicked = null;
}
this._lastMouseDownTime = time.TotalGameTime.TotalMilliseconds;
}
else if (!flag && this._wasMouseDown && this._lastElementDown != null && !flag2)
{
UIElement lastElementDown = this._lastElementDown;
if (lastElementDown.ContainsPoint(this.MousePosition))
{
lastElementDown.Click(new UIMouseEvent(lastElementDown, this.MousePosition));
this._lastElementClicked = this._lastElementDown;
}
lastElementDown.MouseUp(new UIMouseEvent(lastElementDown, this.MousePosition));
this._lastElementDown = null;
}
if (state.ScrollWheelValue != this._scrollWheelState)
{
if (uIElement != null)
{
uIElement.ScrollWheel(new UIScrollWheelEvent(uIElement, this.MousePosition, state.ScrollWheelValue - this._scrollWheelState));
}
this._scrollWheelState = state.ScrollWheelValue;
}
this._wasMouseDown = flag;
if (this._currentState != null)
{
this._currentState.Draw(spriteBatch);
}
}
}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:60,代码来源:UserInterface.cs
示例3: Append
public void Append(UIElement element)
{
element.Remove();
element.Parent = this;
this.Elements.Add(element);
element.Recalculate();
}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:7,代码来源:UIElement.cs
示例4: OKClick
private void OKClick(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(10, -1, -1, 1);
ModLoader.modBrowserPassphrase = passcodeTextField.currentString;
Main.SaveSettings();
Main.menuMode = this.gotoMenu;
}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:7,代码来源:UIEnterPassphraseMenu.cs
示例5: OnInitialize
public override void OnInitialize()
{
UIElement uIElement = new UIElement();
uIElement.Width.Set(0f, 0.8f);
uIElement.MaxWidth.Set(600f, 0f);
uIElement.Top.Set(220f, 0f);
uIElement.Height.Set(-220f, 1f);
uIElement.HAlign = 0.5f;
UIPanel uIPanel = new UIPanel();
uIPanel.Width.Set(0f, 1f);
uIPanel.Height.Set(-110f, 1f);
uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
uIElement.Append(uIPanel);
modInfo = new UITextPanel("This is a test of mod info here.");
modInfo.Width.Set(-25f, 1f);
modInfo.Height.Set(0f, 1f);
uIPanel.Append(modInfo);
uITextPanel = new UITextPanel("Mod Info", 0.8f, true);
uITextPanel.HAlign = 0.5f;
uITextPanel.Top.Set(-35f, 0f);
uITextPanel.SetPadding(15f);
uITextPanel.BackgroundColor = new Color(73, 94, 171);
uIElement.Append(uITextPanel);
UITextPanel button3 = new UITextPanel("Back", 1f, false);
button3.Width.Set(-10f, 0.5f);
button3.Height.Set(25f, 0f);
button3.VAlign = 1f;
button3.Top.Set(-20f, 0f);
button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
button3.OnClick += new UIElement.MouseEvent(BackClick);
uIElement.Append(button3);
base.Append(uIElement);
}
开发者ID:Evarenis,项目名称:tModLoader,代码行数:34,代码来源:UIModInfo.cs
示例6: Add
public virtual void Add(UIElement item)
{
_items.Add(item);
_innerList.Append(item);
UpdateOrder();
_innerList.Recalculate();
}
开发者ID:EmuDevs,项目名称:EDTerraria,代码行数:7,代码来源:UIList.cs
示例7: OnInitialize
public override void OnInitialize()
{
UIElement area = new UIElement();
area.Width.Set(0f, 0.8f);
area.Top.Set(200f, 0f);
area.Height.Set(-240f, 1f);
area.HAlign = 0.5f;
message.Width.Set(0f, 1f);
message.Height.Set(0f, 0.8f);
message.HAlign = 0.5f;
area.Append(message);
UITextPanel button = new UITextPanel("Continue", 0.7f, true);
button.Width.Set(-10f, 0.5f);
button.Height.Set(50f, 0f);
button.VAlign = 1f;
button.Top.Set(-30f, 0f);
button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
button.OnClick += new UIElement.MouseEvent(ContinueClick);
area.Append(button);
UITextPanel button2 = new UITextPanel("Open Logs", 0.7f, true);
button2.CopyStyle(button);
button2.HAlign = 1f;
button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
button2.OnClick += new UIElement.MouseEvent(OpenFile);
area.Append(button2);
base.Append(area);
}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:29,代码来源:UIErrorMessage.cs
示例8: OnInitialize
public override void OnInitialize()
{
UIElement uIElement = new UIElement();
uIElement.Width.Set(0f, 0.8f);
uIElement.MaxWidth.Set(600f, 0f);
uIElement.Top.Set(220f, 0f);
uIElement.Height.Set(-220f, 1f);
uIElement.HAlign = 0.5f;
UIPanel uIPanel = new UIPanel();
uIPanel.Width.Set(0f, 1f);
uIPanel.Height.Set(-110f, 1f);
uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
uIPanel.PaddingTop = 0f;
uIElement.Append(uIPanel);
uITextPanel = new UITextPanel<string>("Please Enter Your Passcode", 0.8f, true);
uITextPanel.HAlign = 0.5f;
uITextPanel.Top.Set(-35f, 0f);
uITextPanel.SetPadding(15f);
uITextPanel.BackgroundColor = new Color(73, 94, 171);
uIElement.Append(uITextPanel);
UITextPanel<string> button = new UITextPanel<string>("Back", 1f, false);
button.Width.Set(-10f, 0.5f);
button.Height.Set(25f, 0f);
button.VAlign = 1f;
button.Top.Set(-65f, 0f);
button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
button.OnClick += new UIElement.MouseEvent(BackClick);
uIElement.Append(button);
UITextPanel<string> button2 = new UITextPanel<string>("Submit", 1f, false);
button2.CopyStyle(button);
button2.HAlign = 1f;
button2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
button2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
button2.OnClick += new UIElement.MouseEvent(OKClick);
uIElement.Append(button2);
UITextPanel<string> button3 = new UITextPanel<string>("Visit Website to Generate Passphrase", 1f, false);
button3.CopyStyle(button);
button3.Width.Set(0f, 1f);
button3.Top.Set(-20f, 0f);
button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
button3.OnClick += new UIElement.MouseEvent(VisitRegisterWebpage);
uIElement.Append(button3);
passcodeTextField = new UIInputTextField("Paste Passphrase (ctrl-v)");
passcodeTextField.HAlign = 0.5f;
passcodeTextField.VAlign = 0.5f;
passcodeTextField.Left.Set(-100, 0);
passcodeTextField.OnTextChange += new UIInputTextField.EventHandler(OnTextChange);
uIPanel.Append(passcodeTextField);
base.Append(uIElement);
}
开发者ID:bluemagic123,项目名称:tModLoader,代码行数:59,代码来源:UIEnterPassphraseMenu.cs
示例9: UIWindow_OnMouseDown
void UIWindow_OnMouseDown(UIMouseEvent evt, UIElement listeningElement)
{
var element = UIController.GetElementAt(evt.MousePosition);
if (element == this)
{
_dragging = true;
}
}
开发者ID:chatrat12,项目名称:Prism,代码行数:8,代码来源:PUIWindow.cs
示例10: NewCharacterClick
private void NewCharacterClick(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(10, -1, -1, 1);
Player player = new Player();
player.GiveStartEquipment();
Main.PendingPlayer = player;
Main.menuMode = 2;
}
开发者ID:EmuDevs,项目名称:EDTerraria,代码行数:8,代码来源:UICharacterSelect.cs
示例11: OnInitialize
public override void OnInitialize()
{
UIElement uIElement = new UIElement();
uIElement.Width.Set(0f, 0.8f);
uIElement.MaxWidth.Set(600f, 0f);
uIElement.Top.Set(220f, 0f);
uIElement.Height.Set(-220f, 1f);
uIElement.HAlign = 0.5f;
UIPanel scrollPanel = new UIPanel();
scrollPanel.Width.Set(0f, 1f);
scrollPanel.Height.Set(-65f, 1f);
scrollPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
uIElement.Append(scrollPanel);
settingsItemList = new UIList();
settingsItemList.Width.Set(-25f, 1f);
settingsItemList.Height.Set(0f, 1f);
settingsItemList.ListPadding = 5f;
scrollPanel.Append(settingsItemList);
UIScrollbar uIScrollbar = new UIScrollbar();
uIScrollbar.SetView(100f, 1000f);
uIScrollbar.Height.Set(0f, 1f);
uIScrollbar.HAlign = 1f;
scrollPanel.Append(uIScrollbar);
settingsItemList.SetScrollbar(uIScrollbar);
UITextPanel titleTextPanel = new UITextPanel("Saved Settings", 0.8f, true);
titleTextPanel.HAlign = 0.5f;
titleTextPanel.Top.Set(-35f, 0f);
titleTextPanel.SetPadding(15f);
titleTextPanel.BackgroundColor = new Color(73, 94, 171);
uIElement.Append(titleTextPanel);
UITextPanel backButton = new UITextPanel("Back", 1f, false);
backButton.Width.Set(-10f, 1f / 2f);
backButton.Height.Set(25f, 0f);
backButton.VAlign = 1f;
backButton.Top.Set(-20f, 0f);
backButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
backButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
backButton.OnClick += new UIElement.MouseEvent(BackClick);
uIElement.Append(backButton);
UIColorTextPanel saveNewButton = new UIColorTextPanel("Save Current Settings as New", Color.Green, 1f, false);
saveNewButton.CopyStyle(backButton);
saveNewButton.HAlign = 1f;
saveNewButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
saveNewButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
saveNewButton.OnClick += new UIElement.MouseEvent(SaveNewSettings);
uIElement.Append(saveNewButton);
base.Append(uIElement);
}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:55,代码来源:UISettingsView.cs
示例12: NewCharacterClick
private void NewCharacterClick(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(10, -1, -1, 1);
Player player = new Player();
player.inventory[0].SetDefaults("Copper Shortsword");
player.inventory[0].Prefix(-1);
player.inventory[1].SetDefaults("Copper Pickaxe");
player.inventory[1].Prefix(-1);
player.inventory[2].SetDefaults("Copper Axe");
player.inventory[2].Prefix(-1);
Main.PendingPlayer = player;
Main.menuMode = 2;
}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:13,代码来源:UICharacterSelect.cs
示例13: OnInitialize
public override void OnInitialize()
{
uIElement = new UIElement();
uIElement.Width.Set(0f, 0.8f);
uIElement.MaxWidth.Set(600f, 0f);
uIElement.Top.Set(220f, 0f);
uIElement.Height.Set(-220f, 1f);
uIElement.HAlign = 0.5f;
UIPanel uIPanel = new UIPanel();
uIPanel.Width.Set(0f, 1f);
uIPanel.Height.Set(-110f, 1f);
uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
uIElement.Append(uIPanel);
modInfo = new UIMessageBox("This is a test of mod info here.");
modInfo.Width.Set(-25f, 1f);
modInfo.Height.Set(0f, 1f);
uIPanel.Append(modInfo);
UIScrollbar uIScrollbar = new UIScrollbar();
uIScrollbar.SetView(100f, 1000f);
uIScrollbar.Height.Set(0f, 1f);
uIScrollbar.HAlign = 1f;
uIPanel.Append(uIScrollbar);
modInfo.SetScrollbar(uIScrollbar);
uITextPanel = new UITextPanel("Mod Info", 0.8f, true);
uITextPanel.HAlign = 0.5f;
uITextPanel.Top.Set(-35f, 0f);
uITextPanel.SetPadding(15f);
uITextPanel.BackgroundColor = new Color(73, 94, 171);
uIElement.Append(uITextPanel);
modHomepageButton = new UITextPanel("Visit the Mod's Homepage for even more info", 1f, false);
modHomepageButton.Width.Set(-10f, 1f);
modHomepageButton.Height.Set(25f, 0f);
modHomepageButton.VAlign = 1f;
modHomepageButton.Top.Set(-65f, 0f);
modHomepageButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
modHomepageButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
modHomepageButton.OnClick += new UIElement.MouseEvent(VisitModHomePage);
uIElement.Append(modHomepageButton);
UITextPanel backButton = new UITextPanel("Back", 1f, false);
backButton.Width.Set(-10f, 0.5f);
backButton.Height.Set(25f, 0f);
backButton.VAlign = 1f;
backButton.Top.Set(-20f, 0f);
backButton.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
backButton.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
backButton.OnClick += new UIElement.MouseEvent(BackClick);
uIElement.Append(backButton);
base.Append(uIElement);
}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:49,代码来源:UIModInfo.cs
示例14: OnInitialize
public override void OnInitialize()
{
UIElement uIElement = new UIElement();
uIElement.Width.Set(0f, 0.8f);
uIElement.MaxWidth.Set(600f, 0f);
uIElement.Top.Set(220f, 0f);
uIElement.Height.Set(-220f, 1f);
uIElement.HAlign = 0.5f;
UIPanel uIPanel = new UIPanel();
uIPanel.Width.Set(0f, 1f);
uIPanel.Height.Set(-110f, 1f);
uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
uIElement.Append(uIPanel);
this._playerList = new UIList();
this._playerList.Width.Set(-25f, 1f);
this._playerList.Height.Set(0f, 1f);
this._playerList.ListPadding = 5f;
uIPanel.Append(this._playerList);
UIScrollbar uIScrollbar = new UIScrollbar();
uIScrollbar.SetView(100f, 1000f);
uIScrollbar.Height.Set(0f, 1f);
uIScrollbar.HAlign = 1f;
uIPanel.Append(uIScrollbar);
this._playerList.SetScrollbar(uIScrollbar);
UITextPanel uITextPanel = new UITextPanel("Select Player", 0.8f, true);
uITextPanel.HAlign = 0.5f;
uITextPanel.Top.Set(-35f, 0f);
uITextPanel.SetPadding(15f);
uITextPanel.BackgroundColor = new Color(73, 94, 171);
uIElement.Append(uITextPanel);
UITextPanel uITextPanel2 = new UITextPanel("Back", 0.7f, true);
uITextPanel2.Width.Set(-10f, 0.5f);
uITextPanel2.Height.Set(50f, 0f);
uITextPanel2.VAlign = 1f;
uITextPanel2.Top.Set(-45f, 0f);
uITextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver);
uITextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut);
uITextPanel2.OnClick += new UIElement.MouseEvent(this.GoBackClick);
uIElement.Append(uITextPanel2);
UITextPanel uITextPanel3 = new UITextPanel("New", 0.7f, true);
uITextPanel3.CopyStyle(uITextPanel2);
uITextPanel3.HAlign = 1f;
uITextPanel3.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver);
uITextPanel3.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut);
uITextPanel3.OnClick += new UIElement.MouseEvent(this.NewCharacterClick);
uIElement.Append(uITextPanel3);
base.Append(uIElement);
}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:48,代码来源:UICharacterSelect.cs
示例15: OnInitialize
public override void OnInitialize()
{
UIElement element = new UIElement();
element.Width.Set(0.0f, 0.8f);
element.MaxWidth.Set(600f, 0.0f);
element.Top.Set(220f, 0.0f);
element.Height.Set(-220f, 1f);
element.HAlign = 0.5f;
UIPanel uiPanel = new UIPanel();
uiPanel.Width.Set(0.0f, 1f);
uiPanel.Height.Set(-110f, 1f);
uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
element.Append(uiPanel);
_worldList = new UIList();
_worldList.Width.Set(-25f, 1f);
_worldList.Height.Set(0.0f, 1f);
_worldList.ListPadding = 5f;
uiPanel.Append(_worldList);
UIScrollbar scrollbar = new UIScrollbar();
scrollbar.SetView(100f, 1000f);
scrollbar.Height.Set(0.0f, 1f);
scrollbar.HAlign = 1f;
uiPanel.Append(scrollbar);
_worldList.SetScrollbar(scrollbar);
UITextPanel uiTextPanel1 = new UITextPanel("Select World", 0.8f, true);
uiTextPanel1.HAlign = 0.5f;
uiTextPanel1.Top.Set(-35f, 0.0f);
uiTextPanel1.SetPadding(15f);
uiTextPanel1.BackgroundColor = new Color(73, 94, 171);
element.Append(uiTextPanel1);
UITextPanel uiTextPanel2 = new UITextPanel("Back", 0.7f, true);
uiTextPanel2.Width.Set(-10f, 0.5f);
uiTextPanel2.Height.Set(50f, 0.0f);
uiTextPanel2.VAlign = 1f;
uiTextPanel2.Top.Set(-45f, 0.0f);
uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
uiTextPanel2.OnClick += new UIElement.MouseEvent(GoBackClick);
element.Append(uiTextPanel2);
UITextPanel uiTextPanel3 = new UITextPanel("New", 0.7f, true);
uiTextPanel3.CopyStyle(uiTextPanel2);
uiTextPanel3.HAlign = 1f;
uiTextPanel3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
uiTextPanel3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
uiTextPanel3.OnClick += new UIElement.MouseEvent(NewWorldClick);
element.Append(uiTextPanel3);
Append(element);
}
开发者ID:EmuDevs,项目名称:EDTerraria,代码行数:48,代码来源:UIWorldSelect.cs
示例16: OnInitialize
public override void OnInitialize()
{
UIElement uIElement = new UIElement();
uIElement.Width.Set(0f, 0.8f);
uIElement.MaxWidth.Set(600f, 0f);
uIElement.Top.Set(220f, 0f);
uIElement.Height.Set(-220f, 1f);
uIElement.HAlign = 0.5f;
UIPanel uIPanel = new UIPanel();
uIPanel.Width.Set(0f, 1f);
uIPanel.Height.Set(-110f, 1f);
uIPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f;
uIElement.Append(uIPanel);
myPublishedMods = new UIList();
myPublishedMods.Width.Set(-25f, 1f);
myPublishedMods.Height.Set(0f, 1f);
myPublishedMods.ListPadding = 5f;
uIPanel.Append(myPublishedMods);
UIScrollbar uIScrollbar = new UIScrollbar();
uIScrollbar.SetView(100f, 1000f);
uIScrollbar.Height.Set(0f, 1f);
uIScrollbar.HAlign = 1f;
uIPanel.Append(uIScrollbar);
myPublishedMods.SetScrollbar(uIScrollbar);
uITextPanel = new UITextPanel("My Published Mods", 0.8f, true);
uITextPanel.HAlign = 0.5f;
uITextPanel.Top.Set(-35f, 0f);
uITextPanel.SetPadding(15f);
uITextPanel.BackgroundColor = new Color(73, 94, 171);
uIElement.Append(uITextPanel);
UITextPanel button3 = new UITextPanel("Back", 1f, false);
button3.VAlign = 1f;
button3.Height.Set(25f, 0f);
button3.Width.Set(-10f, 1f / 2f);
button3.Top.Set(-20f, 0f);
button3.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
button3.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
button3.OnClick += new UIElement.MouseEvent(BackClick);
uIElement.Append(button3);
base.Append(uIElement);
}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:41,代码来源:UIManagePublished.cs
示例17: OnInitialize
public override void OnInitialize()
{
UIElement area = new UIElement();
area.Width.Set(0f, 0.8f);
area.Top.Set(200f, 0f);
area.Height.Set(-240f, 1f);
area.HAlign = 0.5f;
message.Width.Set(0f, 1f);
message.Height.Set(0f, 0.8f);
message.HAlign = 0.5f;
area.Append(message);
UITextPanel<string> button = new UITextPanel<string>("OK", 0.7f, true);
button.Width.Set(-10f, 0.5f);
button.Height.Set(50f, 0f);
button.Left.Set(0, .25f);
button.VAlign = 1f;
button.Top.Set(-30f, 0f);
button.OnMouseOver += new UIElement.MouseEvent(FadedMouseOver);
button.OnMouseOut += new UIElement.MouseEvent(FadedMouseOut);
button.OnClick += new UIElement.MouseEvent(OKClick);
area.Append(button);
base.Append(area);
}
开发者ID:bluemagic123,项目名称:tModLoader,代码行数:23,代码来源:UIInfoMessage.cs
示例18: BackClick
private static void BackClick(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(11, -1, -1, 1);
Main.menuMode = Interface.modBrowserID;
}
开发者ID:Evarenis,项目名称:tModLoader,代码行数:5,代码来源:UIModInfo.cs
示例19: Moreinfo
internal void Moreinfo(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(10, -1, -1, 1);
Interface.modInfo.SetModName(properties.displayName);
Interface.modInfo.SetModInfo(properties.description);
Interface.modInfo.SetGotoMenu(Interface.modsMenuID);
Interface.modInfo.SetURL(properties.homepage);
Main.menuMode = Interface.modInfoID;
}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:9,代码来源:UIModItem.cs
示例20: ToggleEnabled
internal void ToggleEnabled(UIMouseEvent evt, UIElement listeningElement)
{
Main.PlaySound(12, -1, -1, 1);
this.enabled = !this.enabled;
button2.SetText(this.enabled ? "Click to Disable" : "Click to Enable", 1f, false);
ModLoader.SetModActive(this.mod, this.enabled);
}
开发者ID:JavidPack,项目名称:TerraCustom,代码行数:7,代码来源:UIModItem.cs
注:本文中的Terraria.UI.UIElement类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论