public HUDNewCharacterStats() { Bg = Engine.Singleton.Labeler.NewSimpleQuad("InventoryBgMaterial", 0.01f, 0.01f, 0.98f, 0.98f, new ColourValue(1, 1, 1), 0); MouseCursor = Engine.Singleton.Labeler.NewSimpleQuad("Kursor", 0.0f, 0.0f, Engine.Singleton.GetFloatFromPxWidth(32), Engine.Singleton.GetFloatFromPxHeight(32), new ColourValue(1, 1, 1), 4); HeaderBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.25f, 0.04f, 0.5f, 0.1f, ColourValue.White, 1); Header = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.08f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); Header.SetPosition(0.4f, 0.06f); Header.Caption = "Statystyki"; ResetBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.8f, 0.85f, 0.09f, 0.06f, ColourValue.White, 1); Reset = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.04f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); Reset.SetPosition(0.81f, 0.86f); Reset.Caption = "RESET"; DownArrow = Engine.Singleton.Labeler.NewSimpleQuad("DownArrow", 0.45f, 0.75f, Engine.Singleton.GetFloatFromPxWidth(64), Engine.Singleton.GetFloatFromPxHeight(128), ColourValue.White, 3); DownArrow.IsVisible = DownArrowEnabled; KwadratyLosu = new KwadratLosu[6]; for (int i = 0; i < 6; i++) { KwadratyLosu[i] = new KwadratLosu(Engine.Singleton.Kostka(2, 10).ToString(), 0.2f, 0.215f + i * 0.1f); } StatyLosu = new StatLosu[6]; StatyLosu[0] = new StatLosu("Walka wrecz", CharStats.WalkaWrecz.ToString(), 0.32f, 0.1f); StatyLosu[1] = new StatLosu("Krzepa", CharStats.Krzepa.ToString(), 0.38f, 0.1f); StatyLosu[2] = new StatLosu("Zrecznosc", CharStats.Zrecznosc.ToString(), 0.44f, 0.1f); StatyLosu[3] = new StatLosu("Charyzma", CharStats.Charyzma.ToString(), 0.5f, 0.1f); StatyLosu[4] = new StatLosu("Opanowanie", CharStats.Opanowanie.ToString(), 0.56f, 0.1f); StatyLosu[5] = new StatLosu("Odpornosc", CharStats.Odpornosc.ToString(), 0.62f, 0.1f); IsVisible = false; }
public void registerSprites() { buildMessageBackground(); text = TextLabel.create(spriteRenderer, contentManager, "sierra_agi_font_black"); text.alignCenter = true; text.worldPosition = new Vector3(0.5f, 0.5f, -9.5f); text.hide(); // textLabel = new GameObject("message text"); // textLabel.active = false; // text = textLabel.AddComponent<GUIText>(); // textLabel.transform.position = new Vector3(0.5f, 0.5f, -9.5f); // text.alignment = TextAlignment.Center; // text.anchor = TextAnchor.MiddleCenter; // text.font = font; // text.material.SetColor("_Color", Color.black); leftBorder = spriteRenderer.add(new Sprite(), "messageBorder"); rightBorder = spriteRenderer.add(new Sprite(), "messageBorder"); topBorder = spriteRenderer.add(new Sprite(), "messageBorder"); bottomBorder = spriteRenderer.add(new Sprite(), "messageBorder"); // these are positive because they are relative to the camera's placement // the world z coordinate will be negative leftBorder.setDepth(-9f); rightBorder.setDepth(-9f); topBorder.setDepth(-9f); bottomBorder.setDepth(-9f); hide(); }
public HUDInventory() { InventorySlot.Width = InventorySlot.Size / Engine.Singleton.Camera.AspectRatio; Slots = new InventorySlot[SlotsCount]; for (int i = 0; i < SlotsCount; i++) Slots[i] = new InventorySlot(SlotsSpacing, SlotsSpacing + i * (InventorySlot.Size + SlotsSpacing)); SelectQuad = Engine.Singleton.Labeler.NewSimpleQuad("HighlightMaterial", SlotsSpacing, SlotsSpacing, InventorySlot.Width, InventorySlot.Size, new ColourValue(1, 1, 1), 4); DescriptionBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.2f, 0.5f, 0.6f, 0.45f, ColourValue.White, 1); SelectedPicture = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.21f, 0.58f, 0.3f / Engine.Singleton.Camera.AspectRatio, 0.3f, ColourValue.White, 2); DescriptionLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.03f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); DescriptionLabel.SetPosition(0.45f, 0.51f); GoldBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.7f, 0.1f, 0.2f, 0.1f, new ColourValue(1, 1, 1), 1); GoldLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.05f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); GoldLabel.SetPosition(0.71f, 0.13f); InventoryBg = Engine.Singleton.Labeler.NewSimpleQuad("InventoryBgMaterial", 0.01f, 0.01f, 0.98f, 0.98f, new ColourValue(1, 1, 1), 0); CharacterPicture = Engine.Singleton.Labeler.NewSimpleQuad("Default", 0.4f, 0.1f, 0.2f / Engine.Singleton.Camera.AspectRatio, 0.2f, new ColourValue(1, 1, 1), 1); IsVisible = false; }
public TextLabelControl(TextLabel tl) { this.m_tl = null; this.m_tl = tl; this.InitializeComponent(); this.Draw(); }
public void registerSprites() { text = TextLabel.create(spriteRenderer, contentManager, "sierra_agi_font_white"); text.isVisible = false; text.setScreenPosition(4, Camera.main.pixelHeight - blackBoxHeight + 8); text.setDepth(-9.5f); buildBlackBox(spriteRenderer); }
public TextLabel NewTextLabel(String fontName, float fontSize, ColourValue colourtop, ColourValue colourbottom, int layer) { TextLabel textLabel = new TextLabel(GetUniqueLabelName(), fontName, fontSize, colourtop, colourbottom); Panels[layer].AddChild(textLabel.TextArea); Labels.Add(textLabel); return textLabel; }
public HUDMenu() { Menu = Engine.Singleton.Menu; //Options2Choose = new List<TextLabel>(); Options2Choose = new TextLabel[6]; Header = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.1f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); Header.SetPosition(0.4f, 0.3f); MouseCursor = Engine.Singleton.Labeler.NewSimpleQuad("Kursor", 0.0f, 0.0f, Engine.Singleton.GetFloatFromPxWidth(32), Engine.Singleton.GetFloatFromPxHeight(32), new ColourValue(1, 1, 1), 4); BGQuad = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.35f, 0.25f, 0.3f, 0.5f, ColourValue.Black, 1); for (int i = 0; i < 6; i++) { Options2Choose[i] = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.03f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); } }
public HUD() { _isVisible = false; Slot.Width = Slot.Size * 6 / Engine.Singleton.Camera.AspectRatio; Slots = new Slot[SlotsCount]; for (int i = 0; i < SlotsCount; i++) Slots[i] = new Slot(SlotsSpacing, SlotsSpacing + i * (Slot.Size + SlotsSpacing)); DescriptionBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.3f, 0.5f, 0.6f, 0.45f, ColourValue.White, 1); SelectedPicture = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.31f, 0.58f, 0.3f / Engine.Singleton.Camera.AspectRatio, 0.3f, ColourValue.White, 2); DescriptionLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.03f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); DescriptionLabel.SetPosition(0.55f, 0.51f); ChosenItemBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.0f, 0.0f, 0.2f, 0.05f, ColourValue.White, 1); ChosenItemLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.02f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); ChosenItemLabel.SetPosition(0.05f, 0.0f); ChosenItemPicture = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.0f, 0.0f, 0.05f, 0.05f, ColourValue.White, 2); GravityBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.5f, 0.0f, 0.3f, 0.07f, ColourValue.White, 1); GravityLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.05f, ColourValue.Green, ColourValue.Green, 2); GravityLabel.SetPosition(0.55f, 0.01f); GravityLabel.Caption = "Gravity: ON"; InventoryBg = Engine.Singleton.Labeler.NewSimpleQuad("InventoryBgMaterial", 0.01f, 0.01f, 0.98f, 0.98f, new ColourValue(1, 1, 1), 0); ArrowDown = Engine.Singleton.Labeler.NewSimpleQuad("DownArrow", 0.2f, 0.7f, Engine.Singleton.GetFloatFromPxWidth(64), Engine.Singleton.GetFloatFromPxHeight(128), ColourValue.White, 2); ArrowUp = Engine.Singleton.Labeler.NewSimpleQuad("UpArrow", 0.2f, 0.1f, Engine.Singleton.GetFloatFromPxWidth(64), Engine.Singleton.GetFloatFromPxHeight(128), ColourValue.Black, 2); MouseCursor = Engine.Singleton.Labeler.NewSimpleQuad("Kursor", 0.0f, 0.0f, Engine.Singleton.GetFloatFromPxWidth(32), Engine.Singleton.GetFloatFromPxHeight(32), new ColourValue(1, 1, 1), 4); CategoryBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.35f, 0.02f, 0.45f, 0.1f, new ColourValue(1, 1, 1), 1); CategoryLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.05f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); CategoryLabel.SetPosition(0.5f, 0.04f); KtoraStrona = 0; SelectedOne = -1; IsVisible = false; }
public HUD() { LogList = new List<Pair<string, ColourValue>>(8); for (int i = 0; i < 8; i++) { LogList.Add(new Pair<string, ColourValue>("", ColourValue.Black)); } CompassBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.1f, 0.1f, 0.2f, 0.1f, new ColourValue(1, 1, 1), 1); CompassLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.05f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); CompassLabel.SetPosition(0.11f, 0.13f); Crosshair = Engine.Singleton.Labeler.NewSimpleQuad("CrosshairMat", Engine.Singleton.GetFloatFromPxWidth(((int)Engine.Singleton.Root.AutoCreatedWindow.Width / 2) - 10), Engine.Singleton.GetFloatFromPxHeight(((int)Engine.Singleton.Root.AutoCreatedWindow.Height / 2) - 10), Engine.Singleton.GetFloatFromPxWidth(20), Engine.Singleton.GetFloatFromPxHeight(20), new ColourValue(1, 1, 1), 2); HPHero = Engine.Singleton.Labeler.NewSimpleQuad("CzerwonyMaterial", 0.05f, 0.05f, 0.1f, 0.05f, new ColourValue(1, 1, 1), 1); HPEnemy = Engine.Singleton.Labeler.NewSimpleQuad("ZoltyMaterial", 0.45f, 0.05f, 0.1f, 0.05f, new ColourValue(1, 1, 1), 1); Log = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.8f, 0.8f, 0.18f, 0.18f, new ColourValue(1, 1, 1), 1); HPHeroLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.05f, new ColourValue(1, 0, 0), new ColourValue(1, 0, 0), 2); HPEnemyLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.05f, new ColourValue(1, 0, 0), new ColourValue(1, 0, 0), 2); LogLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.05f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); LoadScreen = Engine.Singleton.Labeler.NewSimpleQuad("Loading1", 0, 0, 1.0f, 1.0f, ColourValue.White, 4); HPHeroLabel.SetPosition(0.055f, 0.055f); HPEnemyLabel.SetPosition(0.455f, 0.055f); LogLabel.SetPosition(0.82f, 0.82f); LogSlots = new LogSlot[8]; for (int i = 0; i < 8; i++) { LogSlots[i] = new LogSlot(0.81f, 0.81f + i * 0.02f); } IsVisible = false; DrawEnemyHP = false; DrawLog = false; LoadScreen.IsVisible = false; }
public void ReadResult(string dir, string fn) { double avg_h = 0; double avg_w = 0; int char_count = 0; StreamReader sr = new StreamReader(dir + fn); string line = sr.ReadLine(); while (line != null) { //char[] ch = ';'; string[] token = line.Split(';'); //135; 974; 354; 33; John Av; TextLabel textlabel = new TextLabel(); textlabel.id = Convert.ToInt16(token[0]); textlabel.mass_center = new System.Drawing.Point(Convert.ToInt16(token[1]), Convert.ToInt16(token[2])); textlabel.orientation = Convert.ToDouble(token[3]); textlabel.text = token[4].Trim(); //if(textlabel.text.Length <=3) textlabel.susp_text = token[5]; textlabel.bbxx = Convert.ToInt16(token[6]); textlabel.bbxy = Convert.ToInt16(token[7]); textlabel.bbxw = Convert.ToInt16(token[8]); textlabel.bbxh = Convert.ToInt16(token[9]); //textlabel.mass_center = new System.Drawing.Point(Convert.ToInt16(textlabel.bbxx + textlabel.bbxw / 2), Convert.ToInt16(textlabel.bbxy + textlabel.bbxh / 2)); textlabel.avg_h = Convert.ToDouble(textlabel.bbxh) / Convert.ToDouble(textlabel.text.Length); textlabel.avg_w = Convert.ToDouble(textlabel.bbxw) / Convert.ToDouble(textlabel.text.Length); textlabel_list.Add(textlabel); line = sr.ReadLine(); char_count += textlabel.text.Length; avg_h += textlabel.bbxh; avg_w += textlabel.bbxw; } avg_h /= char_count; avg_w /= char_count; Console.WriteLine("Size:" +avg_h + ";" + avg_w +";"+ Convert.ToString((avg_h + avg_w /2))); }
public HumanController() { TargetLabel = Engine.Singleton.Labeler.NewTextLabel3D("Primitive", 0.04f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 0); ColLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.04f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); ColLabel.Caption = "Kolizja"; ColLabel.SetColor(ColourValue.Green, ColourValue.Green); ColLabel.SetPosition(0.4f, 0.1f); TalkBox = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.05f, 0.85f, 0.9f, 0.1f, new ColourValue(1, 1, 1), 1); TalkBox.IsVisible = false; TalkLabels = new List<TextLabel>(); for (int i = 0; i < 8; i++) { TalkLabels.Add(Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.04f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2)); TalkLabels[i].SetPosition(0.07f, 0.63f + i * 0.037f); } ValidReplies = new List<TalkReply>(); HUDInventory = new HUDInventory(); HUDContainer = new HUDContainer(); HUDShop = new HUDShop(); HUD = new HUD(); HUDMenu = new HUDMenu(); Mysz = new MOIS.MouseState_NativePtr(); light.Type = Light.LightTypes.LT_POINT; light.Direction = new Vector3(0, -1, 0).NormalisedCopy; light.DiffuseColour = new ColourValue(0.2f, 0.2f, 0.8f); light.SpecularColour = new ColourValue(0.3f, 0.3f, 0.9f); // light.SetAttenuation(10.0f, 0, 5.0f, 10.0f); light.PowerScale = 1.0f; l1.Type = Light.LightTypes.LT_POINT; l1.DiffuseColour = new ColourValue(1,0,0); l1.SpecularColour = new ColourValue(1,0,0); l1.PowerScale = 1.0f; l1.Visible = false; l2.Type = Light.LightTypes.LT_POINT; l2.DiffuseColour = new ColourValue(0, 1, 0); l2.SpecularColour = new ColourValue(0, 1, 0); l2.PowerScale = 1.0f; l2.Visible = false; l3.Type = Light.LightTypes.LT_POINT; l3.DiffuseColour = new ColourValue(0, 0, 1); l3.SpecularColour = new ColourValue(0, 0, 1); l3.PowerScale = 1.0f; l3.Visible = false; l4.Type = Light.LightTypes.LT_POINT; l4.DiffuseColour = new ColourValue(1, 1, 0); l4.SpecularColour = new ColourValue(1, 1, 0); l4.PowerScale = 1.0f; l4.Visible = false; l5.Type = Light.LightTypes.LT_POINT; l5.DiffuseColour = new ColourValue(1, 1, 1); l5.SpecularColour = new ColourValue(1, 1, 1); l5.PowerScale = 1.0f; l5.Visible = false; l6.Type = Light.LightTypes.LT_POINT; l6.DiffuseColour = new ColourValue(1, 0, 1); l6.SpecularColour = new ColourValue(1, 0, 1); l6.PowerScale = 1.0f; l6.Visible = false; l7.Type = Light.LightTypes.LT_POINT; l7.DiffuseColour = new ColourValue(0, 1, 1); l7.SpecularColour = new ColourValue(0, 1, 1); l7.PowerScale = 1.0f; l7.Visible = false; }
private bool suscharratio(TextLabel textlabel) { if (textlabel.susp_char_count == textlabel.text.Length) return true; else return false; }
protected override void Setup() { // Load native texture nativeTexture = DaggerfallUI.GetTextureFromImg(nativeImgName); if (!nativeTexture) { throw new Exception("DaggerfallOptionsWindow: Could not load native texture."); } // Always dim background ParentPanel.BackgroundColor = ScreenDimColor; // Native options panel optionsPanel.HorizontalAlignment = HorizontalAlignment.Center; optionsPanel.Position = new Vector2(0, 40); optionsPanel.Size = TextureReplacement.GetSize(nativeTexture, nativeImgName); optionsPanel.BackgroundColor = Color.black; optionsPanel.BackgroundTexture = nativeTexture; NativePanel.Components.Add(optionsPanel); // Exit game Button exitButton = DaggerfallUI.AddButton(new Rect(101, 4, 45, 16), optionsPanel); exitButton.OnMouseClick += ExitButton_OnMouseClick; exitButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.OptionsExit); // Continue Button continueButton = DaggerfallUI.AddButton(new Rect(76, 60, 70, 17), optionsPanel); continueButton.OnMouseClick += ContinueButton_OnMouseClick; continueButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.OptionsContinue); // Save game Button saveButton = DaggerfallUI.AddButton(new Rect(4, 4, 45, 16), optionsPanel); //saveButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor; saveButton.OnMouseClick += SaveButton_OnMouseClick; saveButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.OptionsSave); // Load game Button loadButton = DaggerfallUI.AddButton(new Rect(52, 4, 46, 16), optionsPanel); //loadButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor; loadButton.OnMouseClick += LoadButton_OnMouseClick; loadButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.OptionsLoad); // Sound Bar Button soundPanel = DaggerfallUI.AddButton(new Rect(6.15f, 23.20f, barMaxLength, 5.5f), optionsPanel); soundPanel.OnMouseClick += SoundBar_OnMouseClick; soundBar = DaggerfallUI.AddPanel(new Rect(0f, 1f, DaggerfallUnity.Settings.SoundVolume * barMaxLength, 3.5f), soundPanel); soundBar.BackgroundColor = DaggerfallUI.DaggerfallUnityDefaultCheckboxToggleColor; // Music Bar Button musicPanel = DaggerfallUI.AddButton(new Rect(6.15f, 30.85f, barMaxLength, 5.5f), optionsPanel); musicPanel.OnMouseClick += MusicBar_OnMouseClick; musicBar = DaggerfallUI.AddPanel(new Rect(0f, 1f, DaggerfallUnity.Settings.MusicVolume * barMaxLength, 3.5f), musicPanel); musicBar.BackgroundColor = DaggerfallUI.DaggerfallUnityDefaultCheckboxToggleColor; // Detail level Button detailButton = DaggerfallUI.AddButton(new Rect(6.15f, 39f, barMaxLength, 5.5f), optionsPanel); detailButton.OnMouseClick += DetailButton_OnMouseClick; detailBar = DaggerfallUI.AddPanel(new Rect(0f, 1f, GetDetailBarWidth(QualitySettings.GetQualityLevel()), 3.5f), detailButton); detailBar.BackgroundColor = DaggerfallUI.DaggerfallUnityDefaultCheckboxToggleColor; // Controls Button controlsButton = DaggerfallUI.AddButton(new Rect(5, 60, 70, 17), optionsPanel); controlsButton.OnMouseClick += ControlsButton_OnMouseClick; controlsButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.OptionsControls); // Full screen Button fullScreenButton = DaggerfallUI.AddButton(new Rect(5, 47, 70, 8), optionsPanel); fullScreenButton.OnMouseClick += FullScreenButton_OnMouseClick; fullScreenButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.OptionsFullScreen); fullScreenTick = DaggerfallUI.AddPanel(new Rect(64f, 3.2f, 3.7f, 3.2f), fullScreenButton); fullScreenTick.BackgroundColor = DaggerfallUI.DaggerfallUnityDefaultCheckboxToggleColor; fullScreenTick.Enabled = !DaggerfallUnity.Settings.LargeHUD; // Head bobbing Button headBobbingButton = DaggerfallUI.AddButton(new Rect(76, 47, 70, 8), optionsPanel); headBobbingButton.OnMouseClick += HeadBobbingButton_OnMouseClick; headBobbingButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.OptionsHeadBobbing); headBobbingTick = DaggerfallUI.AddPanel(new Rect(64f, 3.2f, 3.7f, 3.2f), headBobbingButton); headBobbingTick.BackgroundColor = DaggerfallUI.DaggerfallUnityDefaultCheckboxToggleColor; headBobbingTick.Enabled = DaggerfallUnity.Settings.HeadBobbing; // Set version text versionTextLabel = new TextLabel(); versionTextLabel.Text = string.Format("{0} {1} {2}", VersionInfo.DaggerfallUnityProductName, VersionInfo.DaggerfallUnityStatus, VersionInfo.DaggerfallUnityVersion); versionTextLabel.TextColor = versionTextColor; versionTextLabel.ShadowColor = versionShadowColor; versionTextLabel.ShadowPosition = Vector2.one; versionTextLabel.HorizontalAlignment = HorizontalAlignment.Right; ParentPanel.Components.Add(versionTextLabel); }
private void SetGitAction(GitAction action, bool hasConflicts) { if ((action == _action) && (hasConflicts == _hasConflicts)) { // nothing to do return; } _action = action; _hasConflicts = hasConflicts; // remove old controls ButtonContainer.Controls.Clear(); if ((_action == GitAction.None) && !_hasConflicts) { Visible = false; return; } IconBox.Image = _hasConflicts ? Properties.Images.SolveMerge : Properties.Resources.information; BackColor = (_hasConflicts ? System.Drawing.Color.Orange : System.Drawing.Color.LightSkyBlue).AdaptBackColor(); TextLabel.SetForeColorForBackColor(); string actionStr = ""; switch (_action) { case GitAction.Bisect: actionStr = _bisect.Text; ButtonContainer.Controls.Add(MoreButton); break; case GitAction.Rebase: actionStr = _rebase.Text; ButtonContainer.Controls.Add(_hasConflicts ? ResolveButton : ContinueButton); ButtonContainer.Controls.Add(AbortButton); ButtonContainer.Controls.Add(MoreButton); break; case GitAction.Merge: actionStr = _merge.Text; ButtonContainer.Controls.Add(_hasConflicts ? ResolveButton : ContinueButton); ButtonContainer.Controls.Add(AbortButton); break; case GitAction.Patch: actionStr = _patch.Text; ButtonContainer.Controls.Add(_hasConflicts ? ResolveButton : ContinueButton); ButtonContainer.Controls.Add(AbortButton); ButtonContainer.Controls.Add(MoreButton); break; case GitAction.None: // can only get here if hasConflicts so add resolve button ButtonContainer.Controls.Add(ResolveButton); break; } TextLabel.Text = (_action == GitAction.None) ? _conflictsMessage.Text : string.Format( _hasConflicts ? _progressWithConflictsMessage.Text : _progressMessage.Text, actionStr); ControlDpiExtensions.AdjustForDpiScaling(this); Visible = true; }
public KwadratLosu(String wartosc, float top, float left) { Kwadrat = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", left, top, 0.08f, 0.08f, ColourValue.White, 1); Wartosc = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.05f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 4); Wartosc.SetPosition(left + 0.02f, top + 0.01f); Wartosc.Caption = wartosc; CzerwonaPoswiata = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", left - 0.01f, top - 0.01f, 0.1f, 0.1f, ColourValue.Red, 2); }
void ShowOptionsPanel() { // Disable previous stage resolutionPanel.Enabled = false; // Create backdrop if (!backdropCreated) { CreateBackdrop(); } // Add options panel optionsPanel.Outline.Enabled = true; optionsPanel.BackgroundColor = backgroundColor; optionsPanel.HorizontalAlignment = HorizontalAlignment.Center; //optionsPanel.VerticalAlignment = VerticalAlignment.Middle; optionsPanel.Position = new Vector2(0, 8); optionsPanel.Size = new Vector2(318, 165); NativePanel.Components.Add(optionsPanel); // Add title text TextLabel titleLabel = new TextLabel(DaggerfallUI.Instance.Font2); titleLabel.Text = "Daggerfall Unity"; titleLabel.Position = new Vector2(0, 15); titleLabel.TextScale = 1.4f; titleLabel.HorizontalAlignment = HorizontalAlignment.Center; optionsPanel.Components.Add(titleLabel); // Add version text TextLabel versionLabel = new TextLabel(DaggerfallUI.DefaultFont); versionLabel.Text = string.Format("{0} v{1}", char.ToUpper(VersionInfo.DaggerfallUnityStatus[0]) + VersionInfo.DaggerfallUnityStatus.Substring(1), VersionInfo.DaggerfallUnityVersion); versionLabel.Position = new Vector2(0, 40); versionLabel.TextScale = 1.0f; versionLabel.HorizontalAlignment = HorizontalAlignment.Center; versionLabel.ShadowPosition = Vector2.zero; versionLabel.TextColor = secondaryTextColor; optionsPanel.Components.Add(versionLabel); // Add settings path text TextLabel settingsPathLabel = new TextLabel(); settingsPathLabel.Text = DaggerfallUnity.Settings.PersistentDataPath; settingsPathLabel.Position = new Vector2(0, 170); settingsPathLabel.HorizontalAlignment = HorizontalAlignment.Center; settingsPathLabel.ShadowPosition = Vector2.zero; settingsPathLabel.TextColor = secondaryTextColor; settingsPathLabel.BackgroundColor = backgroundColor; optionsPanel.Components.Add(settingsPathLabel); // Setup options checkboxes float x = 8; optionPos = 60; alwayShowOptions = AddOption(x, "alwayShowOptions", DaggerfallUnity.Settings.ShowOptionsAtStart); vsync = AddOption(x, "vsync", DaggerfallUnity.Settings.VSync); swapHealthAndFatigue = AddOption(x, "swapHealthAndFatigue", DaggerfallUnity.Settings.SwapHealthAndFatigueColors); invertMouseVertical = AddOption(x, "invertMouseVertical", DaggerfallUnity.Settings.InvertMouseVertical); mouseSmoothing = AddOption(x, "mouseSmoothing", DaggerfallUnity.Settings.MouseLookSmoothing); x = 165; optionPos = 60; leftHandWeapons = AddOption(x, "leftHandWeapons", GetLeftHandWeapons()); playerNudity = AddOption(x, "playerNudity", DaggerfallUnity.Settings.PlayerNudity); clickToAttack = AddOption(x, "clickToAttack", DaggerfallUnity.Settings.ClickToAttack); // Setup mods checkboxes // TODO: Might rework this, but could still be useful for certain core mods later sdfFontRendering = AddOption(x, "sdfFontRendering", DaggerfallUnity.Settings.SDFFontRendering); sdfFontRendering.OnToggleState += SDFFontRendering_OnToggleState; //bool exampleModCheckbox = AddOption(x, "Example", "Example built-in mod", DaggerfallUnity.Settings.ExampleModOption); enableController = AddOption(x, "enableController", DaggerfallUnity.Settings.EnableController); enableController.OnToggleState += EnableController_OnToggleState; // Add mod note TextLabel modNoteLabel = DaggerfallUI.AddTextLabel(DaggerfallUI.DefaultFont, new Vector2(0, 125), GetText("modNote"), optionsPanel); modNoteLabel.HorizontalAlignment = HorizontalAlignment.Center; modNoteLabel.ShadowPosition = Vector2.zero; // Confirm button Button optionsConfirmButton = new Button(); optionsConfirmButton.Position = new Vector2(0, optionsPanel.InteriorHeight - 15); optionsConfirmButton.Size = new Vector2(40, 12); optionsConfirmButton.Outline.Enabled = true; optionsConfirmButton.Label.Text = GetText("play"); optionsConfirmButton.BackgroundColor = new Color(0.0f, 0.5f, 0.0f, 0.4f); optionsConfirmButton.HorizontalAlignment = HorizontalAlignment.Center; optionsConfirmButton.OnMouseClick += OptionsConfirmButton_OnMouseClick; optionsConfirmButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.GameSetupPlay); optionsPanel.Components.Add(optionsConfirmButton); // Restart button Button restartButton = new Button(); restartButton.Size = new Vector2(45, 12); restartButton.Label.Text = string.Format("< {0}", GetText("restart")); restartButton.Label.ShadowPosition = DaggerfallUI.DaggerfallDefaultShadowPos; restartButton.Label.TextColor = DaggerfallUI.DaggerfallDefaultTextColor; restartButton.Label.HorizontalAlignment = HorizontalAlignment.Left; restartButton.ToolTip = defaultToolTip; restartButton.ToolTipText = GetText("restartInfo"); restartButton.VerticalAlignment = VerticalAlignment.Top; restartButton.HorizontalAlignment = HorizontalAlignment.Left; restartButton.OnMouseClick += RestartButton_OnMouseClick; restartButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.GameSetupRestart); optionsPanel.Components.Add(restartButton); if (DaggerfallUnity.Settings.LypyL_ModSystem) { Button ShowModsButton = new Button(); ShowModsButton.Label.Text = GetText("mods"); ShowModsButton.Position = new Vector2(3, optionsConfirmButton.Position.y); ShowModsButton.Size = optionsConfirmButton.Size; ShowModsButton.BackgroundColor = optionsConfirmButton.BackgroundColor; ShowModsButton.Label.TextColor = optionsConfirmButton.Label.TextColor; ShowModsButton.Outline.Enabled = true; optionsPanel.Components.Add(ShowModsButton); ShowModsButton.OnMouseClick += ModsButton_OnOnMouseBlick; ShowModsButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.GameSetupMods); } // Advanced Settings Button AdvancedSettingsButton = new Button(); AdvancedSettingsButton.Label.Text = GetText("advanced"); AdvancedSettingsButton.Size = new Vector2(45, 12); AdvancedSettingsButton.Position = new Vector2(optionsPanel.InteriorWidth - AdvancedSettingsButton.Size.x - 3, optionsConfirmButton.Position.y); AdvancedSettingsButton.BackgroundColor = optionsConfirmButton.BackgroundColor; AdvancedSettingsButton.Label.TextColor = optionsConfirmButton.Label.TextColor; AdvancedSettingsButton.Outline.Enabled = true; optionsPanel.Components.Add(AdvancedSettingsButton); AdvancedSettingsButton.OnMouseClick += AdvancedSettingsButton_OnOnMouseBlick; AdvancedSettingsButton.Hotkey = DaggerfallShortcut.GetBinding(DaggerfallShortcut.Buttons.GameSetupAdvancedSettings); }
public LogSlot(float left, float top) { Label = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.02f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); //Label.Caption = "dzambersmok"; Label.SetPosition(0.81f, top); }
public static void MakeSelected(Planet picked, GUI_Base root, Player viewing) { //If required, remove the existing routes. //this only happens when we move from one planet selected to another. if (s_previousSelected != null) { ClearSelected(root); } s_root = root; s_previousSelected = picked; //How much information is the player going to be able to see? bool playerControledPlanet = viewing.ControlsPlanet(picked); bool visibleToPlayer; if (playerControledPlanet == true) { visibleToPlayer = true; } else { visibleToPlayer = viewing.CanSeePlanet(picked); } TextLabel planetName = (TextLabel)root.GetChildByName("Planet Name"); TextLabel defenseLabel = (TextLabel)root.GetChildByName("Defense Fleets"); TextLabel production = (TextLabel)root.GetChildByName("Production"); planetName.DisplayText = picked.Name; defenseLabel.DisplayText = "Deffense Fleets: " + picked.DefenseFleets.ToString(); if (visibleToPlayer == true) { production.DisplayText = string.Format("Production: {0} per min", (int)picked.Production); } else { production.DisplayText = "No Data Available"; } if (playerControledPlanet == true) { List <float> depolymentRates = picked.DispatchRates; for (int i = 0; i < depolymentRates.Count; i++) { XmlDocument doc = new XmlDocument(); doc.LoadXml(string.Format(c_sliderXMLTemplate, i, 40 + (c_SliderSpacingPercent * i), (int)(100 * depolymentRates[i]))); SliderBar s = new SliderBar(doc.GetElementsByTagName("ScrollBar")[0], root, null); root.AddChild(s); if (i != 0) { doc.LoadXml(string.Format(c_cancelRouteButton, i, 40 + (c_SliderSpacingPercent * i))); Button b = new Button(doc.GetElementsByTagName("Button")[0], root, picked); root.AddChild(b); doc.LoadXml(string.Format(c_TestLabel, i, 40 + (c_SliderSpacingPercent * i) - 3, picked.DeploymentRoutes[i - 1].Desitnation.Name)); TextLabel label = new TextLabel(doc.GetElementsByTagName("TextLabel")[0], root, null); root.AddChild(label); } } } }
public void Activate() { Window.Instance.BackgroundColor = Color.White; root = new SampleLayout(); root.HeaderText = "RadioButton"; if (styles.Length == 0 || applications.Length == 0) { return; } colNum = (uint)applications.Length + 1; rowNum = (uint)styles.Length + 1; table = new TableView(rowNum, colNum) { Size2D = new Size2D(1920, 1080), }; for (uint i = 1; i < rowNum; i++) { TextLabel text = new TextLabel(); text.Size2D = new Size2D(Width, Height); text.PointSize = 12; text.Focusable = true; text.HorizontalAlignment = HorizontalAlignment.Center; text.VerticalAlignment = VerticalAlignment.Center; text.Text = styles[i - 1]; table.AddChild(text, new TableView.CellPosition(i, 0)); } for (uint i = 1; i < colNum; i++) { TextLabel text = new TextLabel(); text.Size2D = new Size2D(Width, Height); text.PointSize = 12; text.HorizontalAlignment = HorizontalAlignment.Center; text.VerticalAlignment = VerticalAlignment.Center; text.Text = applications[i - 1]; text.Focusable = true; table.AddChild(text, new TableView.CellPosition(0, i)); } group = new RadioButtonGroup[4]; for (uint j = 1; j < colNum; j++) { group[j - 1] = new RadioButtonGroup(); for (uint i = 1; i < rowNum; i++) { Tizen.NUI.CommonUI.RadioButton radioButton = new Tizen.NUI.CommonUI.RadioButton("RadioButton"); radioButton.Size2D = new Size2D(48, 48); if (i == 3) { radioButton.IsEnabled = false; } else if (i == 4) { radioButton.IsEnabled = false; radioButton.IsSelected = true; } else { group[j - 1].Add(radioButton); } radioButton.Focusable = true; //radioButton.Text = radioButton.IsSelected.ToString(); radioButton.SelectedEvent += RadioButtonSelectedEvent; table.AddChild(radioButton, new TableView.CellPosition(i, j)); } } for (uint i = 0; i < rowNum; i++) { table.SetFixedHeight(i, Height); for (uint j = 0; j < colNum; j++) { table.SetFixedWidth(j, Width); table.SetCellAlignment(new TableView.CellPosition(i, j), HorizontalAlignmentType.Center, VerticalAlignmentType.Center); } } root.Add(table); }
protected override void Setup() { // Load native texture nativeTexture = DaggerfallUI.GetTextureFromImg(nativeImgName); if (!nativeTexture) { throw new Exception("DaggerfallCharacterSheetWindow: Could not load native texture."); } // Always dim background ParentPanel.BackgroundColor = ScreenDimColor; // Setup native panel background NativePanel.BackgroundTexture = nativeTexture; // Character portrait NativePanel.Components.Add(characterPortrait); characterPortrait.Position = new Vector2(200, 8); // Setup labels nameLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(41, 4), NativePanel); raceLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(41, 14), NativePanel); classLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(46, 24), NativePanel); levelLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(45, 34), NativePanel); goldLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(39, 44), NativePanel); fatigueLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(57, 54), NativePanel); healthLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(52, 64), NativePanel); encumbranceLabel = DaggerfallUI.AddDefaultShadowedTextLabel(new Vector2(90, 74), NativePanel); // Setup stat labels Vector2 panelPos = new Vector2(141, 17); for (int i = 0; i < DaggerfallStats.Count; i++) { statPanels[i] = DaggerfallUI.AddPanel(new Rect(panelPos.x, panelPos.y, 28, 6), NativePanel); statLabels[i] = DaggerfallUI.AddDefaultShadowedTextLabel(Vector2.zero, statPanels[i]); statLabels[i].HorizontalAlignment = HorizontalAlignment.Center; panelPos.y += 24f; } // Name button Button nameButton = DaggerfallUI.AddButton(new Rect(4, 3, 132, 8), NativePanel); nameButton.OnMouseClick += NameButton_OnMouseClick; // Level button Button levelButton = DaggerfallUI.AddButton(new Rect(4, 33, 132, 8), NativePanel); levelButton.OnMouseClick += LevelButton_OnMouseClick; // Gold button Button goldButton = DaggerfallUI.AddButton(new Rect(4, 43, 132, 8), NativePanel); goldButton.OnMouseClick += GoldButton_OnMouseClick; // Health button Button healthButton = DaggerfallUI.AddButton(new Rect(4, 63, 128, 8), NativePanel); healthButton.OnMouseClick += HealthButton_OnMouseClick; // Affiliations button Button affiliationsButton = DaggerfallUI.AddButton(new Rect(3, 84, 130, 8), NativePanel); affiliationsButton.OnMouseClick += AffiliationsButton_OnMouseClick; // Primary skills button Button primarySkillsButton = DaggerfallUI.AddButton(new Rect(11, 106, 115, 8), NativePanel); primarySkillsButton.OnMouseClick += PrimarySkillsButton_OnMouseClick; // Major skills button Button majorSkillsButton = DaggerfallUI.AddButton(new Rect(11, 116, 115, 8), NativePanel); majorSkillsButton.OnMouseClick += MajorSkillsButton_OnMouseClick; // Minor skills button Button minorSkillsButton = DaggerfallUI.AddButton(new Rect(11, 126, 115, 8), NativePanel); minorSkillsButton.OnMouseClick += MinorSkillsButton_OnMouseClick; // Miscellaneous skills button Button miscSkillsButton = DaggerfallUI.AddButton(new Rect(11, 136, 115, 8), NativePanel); miscSkillsButton.OnMouseClick += MiscSkillsButton_OnMouseClick; // Inventory button Button inventoryButton = DaggerfallUI.AddButton(new Rect(3, 151, 65, 12), NativePanel); inventoryButton.OnMouseClick += InventoryButton_OnMouseClick; //inventoryButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor; // Spellbook button Button spellBookButton = DaggerfallUI.AddButton(new Rect(69, 151, 65, 12), NativePanel); spellBookButton.OnMouseClick += SpellBookButton_OnMouseClick; //spellBookButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor; // Logbook button Button logBookButton = DaggerfallUI.AddButton(new Rect(3, 165, 65, 12), NativePanel); logBookButton.OnMouseClick += LogBookButton_OnMouseClick; //logBookButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor; // History button Button historyButton = DaggerfallUI.AddButton(new Rect(69, 165, 65, 12), NativePanel); historyButton.OnMouseClick += HistoryButton_OnMouseClick; // Exit button Button exitButton = DaggerfallUI.AddButton(new Rect(50, 179, 39, 19), NativePanel); exitButton.OnMouseClick += ExitButton_OnMouseClick; // Attribute popup text Vector2 pos = new Vector2(141, 6); for (int i = 0; i < DaggerfallStats.Count; i++) { Rect rect = new Rect(pos.x, pos.y, 28, 20); AddAttributePopupButton((DFCareer.Stats)i, rect); pos.y += 24f; } statsRollout = new StatsRollout(true); statsRollout.OnStatChanged += StatsRollout_OnStatChanged; // Update player paper doll for first time UpdatePlayerValues(); characterPortrait.Refresh(); // Store toggle closed binding for this window toggleClosedBinding = InputManager.Instance.GetBinding(InputManager.Actions.CharacterSheet); }
public void OnResourceStart() { townHallTextLabel = NAPI.TextLabel.CreateTextLabel("/" + Commands.COM_TOWNHALL, new Vector3(-139.2177f, -631.8386f, 168.86f), 10.0f, 0.5f, 4, new Color(255, 255, 153), false, 0); NAPI.TextLabel.CreateTextLabel(GenRes.townhall_help, new Vector3(-139.2177f, -631.8386f, 168.76f), 10.0f, 0.5f, 4, new Color(255, 255, 255), false, 0); }
private void makeParentsAndChildrenToAdd(View root) { parent1 = new View() { Size = new Size(500, 500), Position = new Position(0, 10), BackgroundColor = Color.Blue, Name = "parent1", }; root.Add(parent1); childList1 = new TextLabel[numberOfChildren]; for (int i = 0; i < numberOfChildren; i++) { childList1[i] = new TextLabel(); childList1[i].Size = new Size(100, 100); childList1[i].PositionUsesPivotPoint = true; childList1[i].ParentOrigin = ParentOrigin.TopLeft; childList1[i].PivotPoint = PivotPoint.Center; childList1[i].BackgroundColor = new Color(0.1f, 0.1f, (float)rand.NextDouble(), 0.8f); childList1[i].Position = new Position(rand.Next(100, 400), rand.Next(100, 400)); childList1[i].Name = childList1[i].Text = $"ID={childList1[i].ID}"; childList1[i].TextFit = new PropertyMap().Add("enable", new PropertyValue(true)).Add("minSize", new PropertyValue(5.0f)).Add("maxSize", new PropertyValue(50.0f)); parent1.Add(childList1[i]); } removeTargetID1 = childList1[0].ID; tlog.Debug(tag, $" \n"); tlog.Debug(tag, $" parent1 Id={parent1.Id} ID={parent1.ID}"); for (int i = 0; i < numberOfChildren; i++) { tlog.Debug(tag, $" child1({childList1[i].Text}) Id={childList1[i].Id}, ID={childList1[i].ID}"); } parent2 = new View() { Size = new Size(500, 500), Position = new Position(500, 10), BackgroundColor = Color.Red, Name = "parent2", }; root.Add(parent2); childList2 = new TextLabel[numberOfChildren]; for (int i = 0; i < numberOfChildren; i++) { childList2[i] = new TextLabel(); childList2[i].Size = new Size(100, 100); childList2[i].PositionUsesPivotPoint = true; childList2[i].ParentOrigin = ParentOrigin.TopLeft; childList2[i].PivotPoint = PivotPoint.Center; childList2[i].BackgroundColor = new Color((float)rand.NextDouble(), 0.1f, 0.1f, 1.0f); childList2[i].Position = new Position(rand.Next(100, 400), rand.Next(100, 400)); childList2[i].Name = childList2[i].Text = $"ID={childList2[i].ID}"; childList2[i].TextFit = new PropertyMap().Add("enable", new PropertyValue(true)).Add("minSize", new PropertyValue(5.0f)).Add("maxSize", new PropertyValue(50.0f)); parent2.Add(childList2[i]); } removeTargetID2 = childList2[0].ID; tlog.Debug(tag, $" \n"); tlog.Debug(tag, $" parent2 Id={parent2.Id} ID={parent2.ID}"); for (int i = 0; i < numberOfChildren; i++) { tlog.Debug(tag, $" child2({childList2[i].Text}) Id={childList2[i].Id}, ID={childList2[i].ID}"); } }
private void BtnSoftkeyService_ClickEvent(object sender, Button.ClickEventArgs e) { Window window = NUIApplication.GetDefaultWindow(); window.WindowSize = new Size(500, 500); window.WindowPosition = new Position(0, 700); window.Remove(BtnService); window.Remove(BtnClient); window.Remove(BtnSoftkeyService); window.Remove(BtnSoftkeyClient); softkeyService = new Shell.SoftkeyService(tzShell, window); textSoftkeyServiceVisible = new TextLabel($"Visible: None"); textSoftkeyServiceVisible.Position = new Position(0, -100); textSoftkeyServiceVisible.HorizontalAlignment = HorizontalAlignment.Center; textSoftkeyServiceVisible.VerticalAlignment = VerticalAlignment.Center; textSoftkeyServiceVisible.TextColor = Color.Blue; textSoftkeyServiceVisible.PointSize = 12.0f; textSoftkeyServiceVisible.HeightResizePolicy = ResizePolicyType.FillToParent; textSoftkeyServiceVisible.WidthResizePolicy = ResizePolicyType.FillToParent; window.Add(textSoftkeyServiceVisible); textSoftkeyServiceExpand = new TextLabel($"Expand: None"); textSoftkeyServiceExpand.Position = new Position(0, 0); textSoftkeyServiceExpand.HorizontalAlignment = HorizontalAlignment.Center; textSoftkeyServiceExpand.VerticalAlignment = VerticalAlignment.Center; textSoftkeyServiceExpand.TextColor = Color.Blue; textSoftkeyServiceExpand.PointSize = 12.0f; textSoftkeyServiceExpand.HeightResizePolicy = ResizePolicyType.FillToParent; textSoftkeyServiceExpand.WidthResizePolicy = ResizePolicyType.FillToParent; window.Add(textSoftkeyServiceExpand); textSoftkeyServiceOpacity = new TextLabel($"Opacity: None"); textSoftkeyServiceOpacity.Position = new Position(0, 100); textSoftkeyServiceOpacity.HorizontalAlignment = HorizontalAlignment.Center; textSoftkeyServiceOpacity.VerticalAlignment = VerticalAlignment.Center; textSoftkeyServiceOpacity.TextColor = Color.Blue; textSoftkeyServiceOpacity.PointSize = 12.0f; textSoftkeyServiceOpacity.HeightResizePolicy = ResizePolicyType.FillToParent; textSoftkeyServiceOpacity.WidthResizePolicy = ResizePolicyType.FillToParent; window.Add(textSoftkeyServiceOpacity); Button BtnShow = new Button() { Text = "Show", Size = new Size(200, 100), Position = new Position(50, 800), Margin = 10, }; Button BtnHide = new Button() { Text = "Hide", Size = new Size(200, 100), Position = new Position(410, 800), Margin = 10, }; window.Add(BtnShow); window.Add(BtnHide); BtnShow.ClickEvent += BtnSoftkeyServiceShow_ClickEvent; BtnHide.ClickEvent += BtnSoftkeyServiceHide_ClickEvent; softkeyService.VisibleChanged += OnSoftkeyServiceVisibleEvent; softkeyService.ExpandChanged += OnSoftkeyServiceExpandEvent; softkeyService.OpacityChanged += OnSoftkeyServiceOpacityEvent; }
private void ribbonButton46_Click(object sender, EventArgs e) { if (textLabel == null) { textLabel = new TextLabel(); textLabel.setText( "测试一下TextLabel" ); GeoPoint pos = new GeoPoint(); pos.x = 116.3; pos.y = 39.9; pos.z = 1000.0; pos.srs = m_earthMap.getSRS(); textLabel.setPosition( pos ); m_earthRoot.addChild( textLabel ); } }
public MessageItem() { Size = new Size(360, 172); Layout = new AbsoluteLayout() { SetPositionByLayout = false, }; BackgroundView = new View() { CornerRadius = 54, PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.Center, BackgroundColor = new Color("#FFFFFF0F"), Opacity = 0.0f, Size = new Size(360, 150), }; Title = new TextLabel() { PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.Center, TextColor = Color.White, Opacity = 0.7f, PixelSize = 38.0f, Size = new Size(328, 50), Position = new Position(-2, 0), VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, Layout = new AbsoluteLayout() { SetPositionByLayout = false }, AutoScrollStopMode = AutoScrollStopMode.Immediate, AutoScrollLoopCount = 1, Ellipsis = true, }; SubTitle = new TextLabel() { PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.Center, TextColor = Color.White, Opacity = 0.0f, MultiLine = true, PixelSize = 24.0f, Ellipsis = true, Size = new Size(340, 64), Position = new Position(-2, 0), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Layout = new AbsoluteLayout() { SetPositionByLayout = false }, }; TimeStamp = new TextLabel() { PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.Center, TextColor = Color.White, Opacity = 0.0f, PixelSize = 24.0f, Size = new Size(340, 32), Position = new Position(-2, 0), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Layout = new AbsoluteLayout() { SetPositionByLayout = false }, }; Add(BackgroundView); Add(Title); Add(SubTitle); Add(TimeStamp); }
public DynamicResource() { global::Tizen.NUI.Xaml.Extensions.LoadFromXaml(this, typeof(DynamicResource)); label0 = global::Tizen.NUI.Binding.NameScopeExtensions.FindByName <TextLabel>(this, "label0"); }
private void BtnSoftkeyClient_ClickEvent(object sender, Button.ClickEventArgs e) { Window window = NUIApplication.GetDefaultWindow(); window.Remove(BtnService); window.Remove(BtnClient); window.Remove(BtnSoftkeyService); window.Remove(BtnSoftkeyClient); softkeyClient = new Shell.SoftkeyClient(tzShell, window); textSoftkeyClientVisible = new TextLabel($"Visible: {softkeyClient.Visible}"); textSoftkeyClientVisible.Position = new Position(0, -100); textSoftkeyClientVisible.HorizontalAlignment = HorizontalAlignment.Center; textSoftkeyClientVisible.VerticalAlignment = VerticalAlignment.Center; textSoftkeyClientVisible.TextColor = Color.Blue; textSoftkeyClientVisible.PointSize = 12.0f; textSoftkeyClientVisible.HeightResizePolicy = ResizePolicyType.FillToParent; textSoftkeyClientVisible.WidthResizePolicy = ResizePolicyType.FillToParent; window.Add(textSoftkeyClientVisible); textSoftkeyClientExpand = new TextLabel($"Expand: {softkeyClient.Expand}"); textSoftkeyClientExpand.Position = new Position(0, 0); textSoftkeyClientExpand.HorizontalAlignment = HorizontalAlignment.Center; textSoftkeyClientExpand.VerticalAlignment = VerticalAlignment.Center; textSoftkeyClientExpand.TextColor = Color.Blue; textSoftkeyClientExpand.PointSize = 12.0f; textSoftkeyClientExpand.HeightResizePolicy = ResizePolicyType.FillToParent; textSoftkeyClientExpand.WidthResizePolicy = ResizePolicyType.FillToParent; window.Add(textSoftkeyClientExpand); textSoftkeyClientOpacity = new TextLabel($"Opacity: {softkeyClient.Opacity}"); textSoftkeyClientOpacity.Position = new Position(0, 100); textSoftkeyClientOpacity.HorizontalAlignment = HorizontalAlignment.Center; textSoftkeyClientOpacity.VerticalAlignment = VerticalAlignment.Center; textSoftkeyClientOpacity.TextColor = Color.Blue; textSoftkeyClientOpacity.PointSize = 12.0f; textSoftkeyClientOpacity.HeightResizePolicy = ResizePolicyType.FillToParent; textSoftkeyClientOpacity.WidthResizePolicy = ResizePolicyType.FillToParent; window.Add(textSoftkeyClientOpacity); Button BtnExpandSetOn = new Button() { Text = "Expand On", Size = new Size(300, 100), Position = new Position(50, 800), Margin = 10, }; Button BtnExpandSetOff = new Button() { Text = "Expand Off", Size = new Size(300, 100), Position = new Position(400, 800), Margin = 10, }; Button BtnOpacitySetOpaque = new Button() { Text = "Opacity Opaque", Size = new Size(300, 100), Position = new Position(50, 1000), Margin = 10, }; Button BtnOpacitySetTransparent = new Button() { Text = "Opacity Transparent", Size = new Size(300, 100), Position = new Position(400, 1000), Margin = 10, }; Button BtnShow = new Button() { Text = "Show", Size = new Size(200, 100), Position = new Position(50, 1100), Margin = 10, }; Button BtnHide = new Button() { Text = "Hide", Size = new Size(200, 100), Position = new Position(410, 1100), Margin = 10, }; BtnExpandSetOn.ClickEvent += BtnExpandSetOn_ClickEvent; BtnExpandSetOff.ClickEvent += BtnExpandSetOff_ClickEvent; BtnOpacitySetOpaque.ClickEvent += BtnOpacitySetOpaque_ClickEvent; BtnOpacitySetTransparent.ClickEvent += BtnOpacitySetTransparent_ClickEvent; BtnShow.ClickEvent += BtnSoftkeyClientShow_ClickEvent; BtnHide.ClickEvent += BtnSoftkeyClientHide_ClickEvent; window.Add(BtnExpandSetOn); window.Add(BtnExpandSetOff); window.Add(BtnOpacitySetOpaque); window.Add(BtnOpacitySetTransparent); window.Add(BtnShow); window.Add(BtnHide); }
public async static Task SpawnCompanies() { using (MySqlConnection connection = new MySqlConnection(Data.DatabaseHandler.connectionHandle)) { await connection.OpenAsync().ConfigureAwait(false); MySqlCommand command = connection.CreateCommand(); command.CommandText = "SELECT * FROM companies"; DbDataReader reader = await command.ExecuteReaderAsync().ConfigureAwait(false); if (reader.HasRows) { while (await reader.ReadAsync().ConfigureAwait(false)) { int id = reader.GetInt32(reader.GetOrdinal("id")); int userid = reader.GetInt32(reader.GetOrdinal("owner")); int type = reader.GetInt32(reader.GetOrdinal("type")); string name = reader.GetString(reader.GetOrdinal("name")); int price = reader.GetInt32(reader.GetOrdinal("price")); string area = reader.GetString(reader.GetOrdinal("area")); int number = reader.GetInt32(reader.GetOrdinal("number")); double safeBox = reader.GetDouble(reader.GetOrdinal("safeBox")); int percentage = reader.GetInt32(reader.GetOrdinal("percentage")); int subsidy = reader.GetInt32(reader.GetOrdinal("subsidy")); double x = reader.GetDouble(reader.GetOrdinal("x")); double y = reader.GetDouble(reader.GetOrdinal("y")); double z = reader.GetDouble(reader.GetOrdinal("z")); Vector3 position = new Vector3(x, y, z); string nombre; if (name == "NO") { nombre = "Compañía en venta"; } else { nombre = name; } int workers = GetWorkersCompany(id); NAPI.Task.Run(async() => { // Exterior entities ColShape company = NAPI.ColShape.CreateCylinderColShape(position.Subtract(new Vector3(0, 0, 1)), 2, 2); TextLabel label = NAPI.TextLabel.CreateTextLabel($"{nombre}~n~Pulsa ~y~F5 ~w~para interactuar~n~~p~{area}, {number}", position, 5, 1, 0, new Color(255, 255, 255)); Marker marker = NAPI.Marker.CreateMarker(0, position.Subtract(new Vector3(0, 0, 0.1)), new Vector3(), new Vector3(), 1, new Color(251, 244, 1)); Blip blip = NAPI.Blip.CreateBlip(position); blip.Color = 3; blip.Name = nombre; switch (type) { case 1: blip.Sprite = 198; break; case 2: blip.Sprite = 477; break; case 3: blip.Sprite = 72; break; case 4: blip.Sprite = 528; break; case 5: blip.Sprite = 135; break; } // Interior entities TextLabel label_interior = NAPI.TextLabel.CreateTextLabel("~w~Pulsa ~y~F5 ~w~para salir", Interior.interior, 3, 1, 0, new Color(255, 255, 255)); label_interior.Dimension = (uint)id; ColShape shape_interior = NAPI.ColShape.CreateCylinderColShape(Interior.interior.Subtract(new Vector3(0, 0, 1)), 2, 2, (uint)id); ColShape shape_duty = NAPI.ColShape.CreateCylinderColShape(Interior.duty.Subtract(new Vector3(0, 0, 1)), 2, 2, (uint)id); TextLabel label_duty = NAPI.TextLabel.CreateTextLabel("~w~Pulsa ~y~F6 ~w~para ponerte en servicio", Interior.duty, 3, 1, 0, new Color(255, 255, 255)); Marker marker_duty = NAPI.Marker.CreateMarker(1, Interior.duty.Subtract(new Vector3(0, 0, 1)), new Vector3(), new Vector3(), 1, new Color(251, 244, 1)); ColShape shape_contract = NAPI.ColShape.CreateCylinderColShape(Interior.contract.Subtract(new Vector3(0, 0, 1)), 2, 2, (uint)id); TextLabel label_contract = NAPI.TextLabel.CreateTextLabel("~w~Pulsa ~y~F6 ~w~para firmar el contrato de empleo", Interior.contract, 3, 1, 0, new Color(255, 255, 255)); Marker marker_contract = NAPI.Marker.CreateMarker(1, Interior.contract.Subtract(new Vector3(0, 0, 1)), new Vector3(), new Vector3(), 1, new Color(251, 244, 1)); Data.Entities.Company dcompany = new Data.Entities.Company { id = id, owner = userid, type = type, name = name, price = price, blip = blip, label = label, marker = marker, area = area, number = number, safeBox = safeBox, workers = workers, percentage = percentage, subsidy = subsidy, interior = shape_interior, shape = company, contract = shape_contract, duty = shape_duty }; //company.SetExternalData<Data.Entities.Company>(0, dcompany); //shape_interior.SetExternalData<Data.Entities.Company>(0, dcompany); company.SetData("COMPANY_CLASS", dcompany); shape_interior.SetData("COMPANY_CLASS", dcompany); shape_contract.SetData("COMPANY_CLASS", dcompany); Data.Lists.Companies.Add(dcompany); await SpawnVehicleCompanies(dcompany); }); Data.Info.companiesSpawned++; } } } }
public void Deactivate() { if (root != null) { NUIApplication.GetDefaultWindow().Remove(root); if (text_nullstyle != null) { text_nullstyle.Dispose(); text_nullstyle = null; } if (text_style != null) { text_style.Dispose(); text_style = null; } for (int i = 0; i < 4; i++) { if (button[i] != null) { button[i].Dispose(); button[i] = null; } } for (int i = 0; i < 3; i++) { if (scrollBar[i] != null) { scrollBar[i].Dispose(); scrollBar[i] = null; } } if (top_parent != null) { top_parent.Dispose(); top_parent = null; } if (bottom_parent != null) { bottom_parent.Dispose(); bottom_parent = null; } if (null_style_parent != null) { null_style_parent.Dispose(); null_style_parent = null; } if (style_parent != null) { style_parent.Dispose(); style_parent = null; } root.Dispose(); root = null; } }
private void AddPage(string titleKey, Action <Panel, Panel> setup) { string title = GetText(titleKey); Panel panel = new Panel(); panel.Name = title; panel.Outline.Enabled = true; panel.BackgroundColor = backgroundColor; panel.HorizontalAlignment = HorizontalAlignment.Center; panel.Position = new Vector2(0, topY + bar.Size.y); panel.Size = pageSize; pages.Add(panel); NativePanel.Components.Add(panel); if (pages.Count > 1) { panel.Enabled = false; } TextLabel textLabel = new TextLabel(titleFont); textLabel.Text = title; textLabel.Position = new Vector2(0, 2); textLabel.HorizontalAlignment = HorizontalAlignment.Center; panel.Components.Add(textLabel); Button pageButton = new Button(); pageButton.Name = title; pageButton.Size = new Vector2(topBarButtonsLength, 9); pageButton.HorizontalAlignment = HorizontalAlignment.None; pageButton.Position = new Vector2((pages.Count - 1) * topBarButtonsLength, 0); pageButton.VerticalAlignment = VerticalAlignment.Middle; pageButton.BackgroundColor = Color.clear; pageButton.Outline.Enabled = false; pageButton.Label.Text = title; pageButton.Label.Font = pageButtonFont; pageButton.Label.TextColor = pages.Count > 1 ? pageButtonUnselected : pageButtonSelected; pageButton.Label.ShadowColor = Color.clear; pageButton.OnMouseClick += PageButton_OnMouseClick; bar.Components.Add(pageButton); pagesButton.Add(pageButton); Vector2 size = new Vector2(panel.Size.x / 2 - offset.x * 2, columnHeight); Panel leftPanel = new Panel(); leftPanel.Outline.Enabled = false; leftPanel.Position = offset; leftPanel.Size = size; panel.Components.Add(leftPanel); Panel rightPanel = new Panel(); rightPanel.Outline.Enabled = false; rightPanel.Position = new Vector2(panel.Size.x / 2 + offset.x, offset.y); rightPanel.Size = size; panel.Components.Add(rightPanel); y = 0; setup(leftPanel, rightPanel); }
public StatLosu(String name, String value, float top, float left) { Name = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.05f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 4); Name.Caption = name; Name.SetPosition(left + 0.01f, top + 0.01f); Value = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.05f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 4); Value.Caption = value; Value.SetPosition(left + 0.22f, top + 0.01f); AddPoint = Engine.Singleton.Labeler.NewSimpleQuad("AddPoint", left + 0.34f, top, Engine.Singleton.GetFloatFromPxWidth(32), Engine.Singleton.GetFloatFromPxHeight(32), new ColourValue(1, 1, 1), 2); AddPoint.IsVisible = false; NameBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", left, top, 0.2f, 0.05f, new ColourValue(1, 1, 1), 2); ValueBg = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", left + 0.21f, top, 0.12f, 0.05f, new ColourValue(1, 1, 1), 2); }
public void CreatePage(int idx) { view = new View() { Size = new Size(windowWidth, windowHeight - bottomHeight), Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical }, }; currentWindow.Add(view); imageView = CreateImageView(viewIndex); view.Add(imageView); timer.Start(); palette = ImageGenerate(viewIndex); timer.Stop(); TextLabel label = new TextLabel("Time = " + timer.ElapsedMilliseconds.ToString() + "ms") { Size2D = new Size2D((int)(windowWidth), (int)((windowHeight - windowWidth) / 9)), HorizontalAlignment = HorizontalAlignment.End, VerticalAlignment = VerticalAlignment.Center, }; view.Add(label); dominantSwatch = palette.GetDominantSwatch(); if (dominantSwatch != null) { CreateLabel(dominantSwatch); } lightVibrantSwatch = palette.GetLightVibrantSwatch(); if (lightVibrantSwatch != null) { CreateLabel(lightVibrantSwatch); } vibrantSwatch = palette.GetVibrantSwatch(); if (vibrantSwatch != null) { CreateLabel(vibrantSwatch); } darkVibrantSwatch = palette.GetDarkVibrantSwatch(); if (darkVibrantSwatch != null) { CreateLabel(darkVibrantSwatch); } lightMutedSwatch = palette.GetLightMutedSwatch(); if (lightMutedSwatch != null) { CreateLabel(lightMutedSwatch); } mutedSwatch = palette.GetMutedSwatch(); if (mutedSwatch != null) { CreateLabel(mutedSwatch); } darkMutedSwatch = palette.GetDarkMutedSwatch(); if (darkMutedSwatch != null) { CreateLabel(darkMutedSwatch); } timer.Reset(); }
protected override void Setup() { ParentPanel.BackgroundColor = Color.clear; ModListPanel.Outline.Enabled = true; ModListPanel.BackgroundColor = backgroundColor; ModListPanel.HorizontalAlignment = HorizontalAlignment.Left; ModListPanel.VerticalAlignment = VerticalAlignment.Middle; ModListPanel.Size = new Vector2(120, 175); NativePanel.Components.Add(ModListPanel); modsFound.HorizontalAlignment = HorizontalAlignment.Center; modsFound.Position = new Vector2(10, 20); modsFound.Text = "Mods Found: "; ModListPanel.Components.Add(modsFound); modList.BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.5f); modList.Size = new Vector2(110, 115); modList.HorizontalAlignment = HorizontalAlignment.Center; modList.VerticalAlignment = VerticalAlignment.Middle; modList.TextColor = unselectedTextColor; modList.SelectedTextColor = textColor; modList.ShadowPosition = Vector2.zero; modList.RowsDisplayed = 14; modList.RowAlignment = HorizontalAlignment.Center; modList.SelectedShadowPosition = DaggerfallUI.DaggerfallDefaultShadowPos; modList.SelectedShadowColor = Color.black; modList.OnScroll += ModList_OnScroll; modList.MaxCharacters = 20; ModListPanel.Components.Add(modList); modListScrollBar.Size = new Vector2(5, 115); modListScrollBar.HorizontalAlignment = HorizontalAlignment.Right; modListScrollBar.VerticalAlignment = VerticalAlignment.Middle; modListScrollBar.Position = new Vector2(100, 12); modListScrollBar.BackgroundColor = Color.grey; modListScrollBar.DisplayUnits = 14; modListScrollBar.TotalUnits = modList.Count; modListScrollBar.OnScroll += ModListScrollBar_OnScroll; ModListPanel.Components.Add(modListScrollBar); modList.ScrollToSelected(); backButton.Size = new Vector2(45, 12); backButton.Label.Text = "< Options"; backButton.Label.ShadowPosition = Vector2.zero; backButton.Label.TextColor = Color.gray; backButton.ToolTip = defaultToolTip; backButton.ToolTipText = "Back to options without saving changes"; backButton.VerticalAlignment = VerticalAlignment.Top; backButton.HorizontalAlignment = HorizontalAlignment.Left; backButton.OnMouseClick += BackButton_OnMouseClick; ModListPanel.Components.Add(backButton); increaseLoadOrderButton.Size = new Vector2(40, 12); increaseLoadOrderButton.Position = new Vector2(62, 150); increaseLoadOrderButton.Outline.Enabled = true; increaseLoadOrderButton.BackgroundColor = textColor; increaseLoadOrderButton.Label.Text = "Increase"; increaseLoadOrderButton.OnMouseClick += IncreaseLoadOrderButton_OnMouseClick; ModListPanel.Components.Add(increaseLoadOrderButton); decreaseLoadOrderButton.Size = new Vector2(40, 12); decreaseLoadOrderButton.Position = new Vector2(21, 150); decreaseLoadOrderButton.Outline.Enabled = true; decreaseLoadOrderButton.BackgroundColor = textColor; decreaseLoadOrderButton.Label.Text = "Lower"; decreaseLoadOrderButton.OnMouseClick += DecreaseLoadOrderButton_OnMouseClick; ModListPanel.Components.Add(decreaseLoadOrderButton); enableAllButton.Size = new Vector2(40, 12); enableAllButton.Position = new Vector2(21, 163); enableAllButton.Outline.Enabled = true; enableAllButton.BackgroundColor = textColor; enableAllButton.VerticalAlignment = VerticalAlignment.Bottom; enableAllButton.Label.Text = "ALL ON"; enableAllButton.ToolTipText = "Enable All Mods"; enableAllButton.OnMouseClick += EnableAllButton_OnMouseClick; ModListPanel.Components.Add(enableAllButton); disableAllButton.Size = new Vector2(40, 12); disableAllButton.Position = new Vector2(62, 163); disableAllButton.Outline.Enabled = true; disableAllButton.BackgroundColor = textColor; disableAllButton.VerticalAlignment = VerticalAlignment.Bottom; disableAllButton.Label.Text = "ALL OFF"; disableAllButton.ToolTipText = "Disable All Mods"; disableAllButton.OnMouseClick += DisableAllButton_OnMouseClick; ModListPanel.Components.Add(disableAllButton); //Add main mod panel ModPanel.Outline.Enabled = true; ModPanel.BackgroundColor = backgroundColor; ModPanel.HorizontalAlignment = HorizontalAlignment.Right; ModPanel.VerticalAlignment = VerticalAlignment.Middle; ModPanel.Size = new Vector2(200, 175); NativePanel.Components.Add(ModPanel); modEnabledCheckBox.Label.Text = "Enabled"; modEnabledCheckBox.Label.TextColor = selectedTextColor; modEnabledCheckBox.CheckBoxColor = selectedTextColor; modEnabledCheckBox.ToolTip = defaultToolTip; modEnabledCheckBox.ToolTipText = "Toggle Mod"; modEnabledCheckBox.IsChecked = true; modEnabledCheckBox.Position = new Vector2(1, 25); modEnabledCheckBox.OnToggleState += modEnabledCheckBox_OnToggleState; ModPanel.Components.Add(modEnabledCheckBox); modLoadPriorityLabel.Position = new Vector2(60, 25); ModPanel.Components.Add(modLoadPriorityLabel); modTitleLabel.Position = new Vector2(0, 5); modTitleLabel.HorizontalAlignment = HorizontalAlignment.Center; modTitleLabel.MaxCharacters = 40; ModPanel.Components.Add(modTitleLabel); modVersionLabel.Position = new Vector2(5, 40); modVersionLabel.MaxCharacters = 40; ModPanel.Components.Add(modVersionLabel); modAuthorLabel.Position = new Vector2(5, 50); modAuthorLabel.MaxCharacters = 40; ModPanel.Components.Add(modAuthorLabel); modAuthorContactLabel = new TextLabel(); modAuthorContactLabel.Position = new Vector2(5, 60); modAuthorContactLabel.MaxCharacters = 40; ModPanel.Components.Add(modAuthorContactLabel); modDFTFUVersionLabel.Position = new Vector2(5, 70); modDFTFUVersionLabel.MaxCharacters = 40; ModPanel.Components.Add(modDFTFUVersionLabel); showModDescriptionButton = new Button(); showModDescriptionButton.Position = new Vector2(5, 95); showModDescriptionButton.Size = new Vector2(75, 12); showModDescriptionButton.HorizontalAlignment = HorizontalAlignment.Center; showModDescriptionButton.Label.Text = "Mod Description"; showModDescriptionButton.BackgroundColor = textColor; showModDescriptionButton.Outline.Enabled = true; showModDescriptionButton.OnMouseClick += ShowModDescriptionPopUp_OnMouseClick; ModPanel.Components.Add(showModDescriptionButton); refreshButton.Size = new Vector2(50, 12); refreshButton.Position = new Vector2(5, 139); refreshButton.Outline.Enabled = true; refreshButton.BackgroundColor = textColor; refreshButton.HorizontalAlignment = HorizontalAlignment.Center; refreshButton.Label.Text = "Refresh"; refreshButton.Label.ToolTipText = "Check for changes in mod directory"; refreshButton.OnMouseClick += RefreshButton_OnMouseClick; ModPanel.Components.Add(refreshButton); saveAndCloseButton.Size = new Vector2(70, 12); saveAndCloseButton.Outline.Enabled = true; saveAndCloseButton.BackgroundColor = textColor; saveAndCloseButton.VerticalAlignment = VerticalAlignment.Bottom; saveAndCloseButton.HorizontalAlignment = HorizontalAlignment.Center; saveAndCloseButton.Label.Text = "Save and Close"; saveAndCloseButton.Label.ToolTipText = "Save changes and return to options menu"; saveAndCloseButton.OnMouseClick += SaveAndCloseButton_OnMouseClick; ModPanel.Components.Add(saveAndCloseButton); extractFilesButton.Size = new Vector2(60, 12); extractFilesButton.Position = new Vector2(5, 117); extractFilesButton.Outline.Enabled = true; extractFilesButton.BackgroundColor = textColor; extractFilesButton.HorizontalAlignment = HorizontalAlignment.Center; extractFilesButton.Label.Text = "Extract Text"; extractFilesButton.Label.ToolTipText = "Extract Text Assets"; extractFilesButton.OnMouseClick += ExtractFilesButton_OnMouseClick; ModPanel.Components.Add(extractFilesButton); GetLoadedMods(); UpdateModPanel(); }
public void Activate() { resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; myWindow = NUIApplication.GetDefaultWindow(); //two buttons popup, type1 ButtonStyle buttonStyle = new ButtonStyle() { Icon = new ImageViewStyle() { ResourceUrl = new Selector <string>() { All = resourcePath + "images/PopupTest/tw_ic_popup_btn_bg.png", }, Size = new Size(BUTTON_WIDTH, BUTTON_HEIGHT), Color = new Selector <Color>() { All = BUTTON_COLOR, }, }, Overlay = new ImageViewStyle() { ResourceUrl = new Selector <string>() { All = resourcePath + "images/PopupTest/tw_ic_popup_btn_check.png", }, Size = new Size(BUTTON_ICON_WIDTH, BUTTON_ICON_HEIGHT), Color = new Selector <Color>() { All = Color.Cyan, }, }, }; Button leftButton = new Button(buttonStyle) { Name = "LeftButton", Size = new Size(BUTTON_WIDTH, BUTTON_HEIGHT), }; myPopup1 = new W.Popup(); myPopup1.AppendButton("LeftButton", leftButton); buttonStyle.Overlay.ResourceUrl = new Selector <string>() { All = resourcePath + "images/PopupTest/tw_ic_popup_btn_delete.png", }; Button rightButton = new Button(buttonStyle) { Name = "RightButton", Size = new Size(BUTTON_WIDTH, BUTTON_HEIGHT), }; myPopup1.AppendButton("RightButton", rightButton); TextLabel t = myPopup1.GetTitle(); t.Text = "User consent"; myContent1 = new TextLabel(); myContent1.Text = "Agree? \n GPS location \n and use of your \n location data \n are controlled \n by the applications you \n \n \n this is additional text!"; myContent1.MultiLine = true; myContent1.Size = new Size(200, 800); myContent1.PointSize = 6; myContent1.HorizontalAlignment = HorizontalAlignment.Center; myContent1.VerticalAlignment = VerticalAlignment.Top; myContent1.TextColor = Color.White; myContent1.PositionUsesPivotPoint = true; myContent1.ParentOrigin = ParentOrigin.Center; myContent1.PivotPoint = PivotPoint.Center; myPopup1.AppendContent("ContentText", myContent1); leftButton.Clicked += LeftButton_Clicked; rightButton.Clicked += RightButton_Clicked; myPopup1.OutsideClicked += Mp_OutsideClicked; myPopup1.ContentContainer.WidthResizePolicy = ResizePolicyType.FitToChildren; myPopup1.ContentContainer.HeightResizePolicy = ResizePolicyType.FitToChildren; myPopup1.Post(myWindow); myPopup1.AfterDissmising += MyPopup1_AfterDissmising; }
/// <summary> /// Animation Sample Application initialisation. /// </summary> private void Initialize() { Window.Instance.BackgroundColor = Color.Black; View focusIndicator = new View(); FocusManager.Instance.FocusIndicator = focusIndicator; _positionButton = CreateButton("Position", "PositionAnimation"); _sizeButton = CreateButton("Size", "SizeAnimation"); _scaleButton = CreateButton("Scale", "ScaleAnimation"); _orientationButton = CreateButton("Orientation", "OrientationAnimation"); _opacityButton = CreateButton("Opacity", "OpacityAnimation"); _pixelAreaButton = CreateButton("PixelArea", "PixelAreaAnimation"); _PositionSizeOpacity = CreateButton("PositionSizeOpacity", "Position + Size + Opacity animation at same time!"); _PositionSizeOpacity.Size2D = new Size2D(1400, 80); //Set the callback of button's clicked event _positionButton.Clicked += ButtonClick; _sizeButton.Clicked += ButtonClick; _scaleButton.Clicked += ButtonClick; _orientationButton.Clicked += ButtonClick; _opacityButton.Clicked += ButtonClick; _pixelAreaButton.Clicked += ButtonClick; _PositionSizeOpacity.Clicked += ButtonClick; //Create a tableView as the container of the pushButton. TableView tableView = new TableView(3, 3); tableView.Size2D = new Size2D(1500, 440); tableView.PivotPoint = PivotPoint.TopLeft; tableView.ParentOrigin = ParentOrigin.TopLeft; tableView.Position2D = new Position2D(300, 630); tableView.AddChild(_positionButton, new TableView.CellPosition(0, 0)); tableView.AddChild(_sizeButton, new TableView.CellPosition(0, 1)); tableView.AddChild(_scaleButton, new TableView.CellPosition(0, 2)); tableView.AddChild(_orientationButton, new TableView.CellPosition(1, 0)); tableView.AddChild(_opacityButton, new TableView.CellPosition(1, 1)); tableView.AddChild(_pixelAreaButton, new TableView.CellPosition(1, 2)); tableView.AddChild(_PositionSizeOpacity, new TableView.CellPosition(2, 0, 1, 3)); Window.Instance.GetDefaultLayer().Add(tableView); FocusManager.Instance.SetCurrentFocusView(_positionButton); //This textLable is used to show the title. guide = new TextLabel(); guide.HorizontalAlignment = HorizontalAlignment.Center; guide.VerticalAlignment = VerticalAlignment.Center; guide.BackgroundColor = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f); guide.TextColor = Color.White; guide.PositionUsesPivotPoint = true; guide.ParentOrigin = ParentOrigin.TopLeft; guide.PivotPoint = PivotPoint.TopLeft; guide.Size2D = new Size2D(1920, 100); guide.FontFamily = "Samsung One 600"; guide.Position2D = new Position2D(0, 0); guide.MultiLine = false; guide.PointSize = 15.0f; guide.Text = "Animation Sample"; Window.Instance.GetDefaultLayer().Add(guide); // Create the view to animate. view = new ImageView(); view.Size2D = new Size2D(200, 200); view.Position = new Position(860, 250, 0); view.PositionUsesPivotPoint = true; view.PivotPoint = PivotPoint.TopLeft; view.ParentOrigin = ParentOrigin.TopLeft; view.ResourceUrl = resources + "/gallery-2.jpg"; // Add view on Window. Window.Instance.GetDefaultLayer().Add(view); // Create the position animation. // The duration of the animation is 1.5s; positionAnimation = new Animation(); positionAnimation.Duration = 1500; // Sets the default alpha function for the animation. positionAnimation.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1)); // To reset the view's position. positionAnimation.AnimateTo(view, "Position", new Position(100, 150, 0), 0, 0); positionAnimation.AnimateTo(view, "Position", new Position(300, 200, 0), 0, 300); positionAnimation.AnimateTo(view, "Position", new Position(500, 200, 0), 0, 800); positionAnimation.AnimateTo(view, "Position", new Position(600, 250, 0), 0, 1000); positionAnimation.AnimateTo(view, "Position", new Position(860, 300, 0), 0, 1500); //StopFinal: If the animation is stopped, the animated property values are saved as if the animation had run to completion positionAnimation.EndAction = Animation.EndActions.StopFinal; // Create the size animation using AnimateTo. sizeAnimation = new Animation(1000); sizeAnimation.AnimateTo(view, "size", new Vector3(view.SizeWidth, view.SizeHeight, 0)); sizeAnimation.AnimateTo(view, "sizeWidth", view.SizeWidth * 1.25f); sizeAnimation.AnimateTo(view, "sizeHeight", view.SizeHeight * 1.25f); sizeAnimation.AnimateTo(view, "sizeDepth", 0); //StopFinal: If the animation is stopped, the animated property values are saved as if the animation had run to completion sizeAnimation.EndAction = Animation.EndActions.StopFinal; // Create the scale animation using AnimateTo. scaleAnimation = new Animation(1500); scaleAnimation.AnimateTo(view, "scale", new Vector3(1.2f, 1.2f, 1.0f), 0, 200, new AlphaFunction(AlphaFunction.BuiltinFunctions.Sin)); scaleAnimation.AnimateTo(view, "scaleX", 1.5f, 200, 500, new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear)); scaleAnimation.AnimateTo(view, "ScaleY", 1.5f, 500, 800, new AlphaFunction(AlphaFunction.BuiltinFunctions.Bounce)); scaleAnimation.AnimateTo(view, "scaleX", 1.0f, 800, 1200, new AlphaFunction(AlphaFunction.BuiltinFunctions.Bounce)); scaleAnimation.AnimateTo(view, "scaleX", 1.0f, 1200, 1500, new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear)); //StopFinal: If the animation is stopped, the animated property values are saved as if the animation had run to completion scaleAnimation.EndAction = Animation.EndActions.StopFinal; // Create the orientation animation using AnimateTo. orientationAnimation = new Animation(); orientationAnimation.AnimateTo(view, "Orientation", new Rotation(new Radian(new Degree(60.0f)), PositionAxis.X), 0, 400); orientationAnimation.AnimateTo(view, "Orientation", new Rotation(new Radian(new Degree(60.0f)), PositionAxis.Y), 400, 800); orientationAnimation.AnimateTo(view, "Orientation", new Rotation(new Radian(new Degree(60.0f)), PositionAxis.Z), 800, 1000); orientationAnimation.AnimateTo(view, "Orientation", new Rotation(new Radian(0.0f), PositionAxis.X), 1000, 1400); orientationAnimation.AnimateTo(view, "Orientation", new Rotation(new Radian(0.0f), PositionAxis.Y), 1400, 1800); orientationAnimation.AnimateTo(view, "Orientation", new Rotation(new Radian(0.0f), PositionAxis.Z), 1800, 2200); //StopFinal: If the animation is stopped, the animated property values are saved as if the animation had run to completion orientationAnimation.EndAction = Animation.EndActions.StopFinal; // Create the Opacity animation using AnimateTo. opacityAnimation = new Animation(1500); opacityAnimation.AnimateTo(view, "Opacity", 0.5f, 0, 400); opacityAnimation.AnimateTo(view, "Opacity", 0.0f, 400, 800); opacityAnimation.AnimateTo(view, "Opacity", 0.5f, 800, 1250); opacityAnimation.AnimateTo(view, "Opacity", 1.0f, 1250, 1500); //StopFinal: If the animation is stopped, the animated property values are saved as if the animation had run to completion opacityAnimation.EndAction = Animation.EndActions.StopFinal; // Create the pixelArea animation using AnimateTo. pixelArealAnimation = new Animation(2000); RelativeVector4 vec1 = new RelativeVector4(0.0f, 0.0f, 0.5f, 0.5f); RelativeVector4 vec2 = new RelativeVector4(0.0f, 0.0f, 0.0f, 0.0f); RelativeVector4 vec3 = new RelativeVector4(0.0f, 0.0f, 1.0f, 1.0f); pixelArealAnimation.AnimateTo(view, "pixelArea", vec1, 0, 500); pixelArealAnimation.AnimateTo(view, "pixelArea", vec2, 500, 1000); pixelArealAnimation.AnimateTo(view, "pixelArea", vec1, 1000, 1500); pixelArealAnimation.AnimateTo(view, "pixelArea", vec3, 1500, 2000); //StopFinal: If the animation is stopped, the animated property values are saved as if the animation had run to completion pixelArealAnimation.EndAction = Animation.EndActions.StopFinal; view.Focusable = true; Window.Instance.KeyEvent += AppBack; }
public override void CreateBorderView(View rootView) { this.rootView = rootView; rootView.CornerRadius = new Vector4(0.03f, 0.03f, 0.03f, 0.03f); rootView.CornerRadiusPolicy = VisualTransformPolicyType.Relative; borderView = new View() { Layout = new LinearLayout() { LinearAlignment = LinearLayout.Alignment.End, LinearOrientation = LinearLayout.Orientation.Horizontal, }, WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, }; title = new TextLabel() { Text = "CustomBorder", Size = new Size(300, 50), Position = new Position(60, 0), PositionUsesPivotPoint = true, PivotPoint = PivotPoint.BottomLeft, ParentOrigin = ParentOrigin.BottomLeft, }; var minimalizeIcon = new Button() { Text = "m", PositionUsesPivotPoint = true, PivotPoint = PivotPoint.BottomLeft, ParentOrigin = ParentOrigin.BottomLeft, Size = new Size(50, 50), }; var maximalizeIcon = new Button() { Text = "M", PositionUsesPivotPoint = true, PivotPoint = PivotPoint.BottomLeft, ParentOrigin = ParentOrigin.BottomLeft, Size = new Size(50, 50), }; var closeIcon = new Button() { Text = "C", PositionUsesPivotPoint = true, PivotPoint = PivotPoint.BottomLeft, ParentOrigin = ParentOrigin.BottomLeft, Size = new Size(50, 50), }; var leftPadding = new View() { PositionUsesPivotPoint = true, PivotPoint = PivotPoint.BottomLeft, ParentOrigin = ParentOrigin.BottomLeft, Size = new Size(50, 50), }; var rightPadding = new View() { PositionUsesPivotPoint = true, PivotPoint = PivotPoint.BottomLeft, ParentOrigin = ParentOrigin.BottomLeft, Size = new Size(50, 50), }; rootView.Add(leftPadding); rootView.Add(title); borderView.Add(minimalizeIcon); borderView.Add(maximalizeIcon); borderView.Add(closeIcon); borderView.Add(rightPadding); rootView.Add(borderView); minimalizeIcon.TouchEvent += OnMinimizeIconTouched; maximalizeIcon.TouchEvent += OnMaximizeIconTouched; closeIcon.TouchEvent += OnCloseIconTouched; leftPadding.TouchEvent += OnLeftCornerIconTouched; rightPadding.TouchEvent += OnRightCornerIconTouched; }
private void BtnClient_ClickEvent(object sender, Button.ClickEventArgs e) { Window window = NUIApplication.GetDefaultWindow(); window.Remove(BtnService); window.Remove(BtnClient); window.Remove(BtnSoftkeyService); window.Remove(BtnSoftkeyClient); qpClient = new Shell.QuickPanelClient(tzShell, window, Shell.QuickPanelClient.Types.SystemDefault); qpClient.VisibleChanged += OnVisibleEvent; qpClient.OrientationChanged += OnOrientationEvent; textClientVisible = new TextLabel($"Visible: {qpClient.Visible}"); textClientVisible.Position = new Position(0, -100); textClientVisible.HorizontalAlignment = HorizontalAlignment.Center; textClientVisible.VerticalAlignment = VerticalAlignment.Center; textClientVisible.TextColor = Color.Blue; textClientVisible.PointSize = 12.0f; textClientVisible.HeightResizePolicy = ResizePolicyType.FillToParent; textClientVisible.WidthResizePolicy = ResizePolicyType.FillToParent; window.Add(textClientVisible); textClientScrollable = new TextLabel($"Scrollable: {qpClient.Scrollable}"); textClientScrollable.HorizontalAlignment = HorizontalAlignment.Center; textClientScrollable.VerticalAlignment = VerticalAlignment.Center; textClientScrollable.TextColor = Color.Blue; textClientScrollable.PointSize = 12.0f; textClientScrollable.HeightResizePolicy = ResizePolicyType.FillToParent; textClientScrollable.WidthResizePolicy = ResizePolicyType.FillToParent; window.Add(textClientScrollable); textClientOrientation = new TextLabel($"Orientation: {qpClient.Orientation}"); textClientOrientation.Position = new Position(0, 100); textClientOrientation.HorizontalAlignment = HorizontalAlignment.Center; textClientOrientation.VerticalAlignment = VerticalAlignment.Center; textClientOrientation.TextColor = Color.Blue; textClientOrientation.PointSize = 12.0f; textClientOrientation.HeightResizePolicy = ResizePolicyType.FillToParent; textClientOrientation.WidthResizePolicy = ResizePolicyType.FillToParent; window.Add(textClientOrientation); Button BtnScrollableSet = new Button() { Text = "Scrollable Set", Size = new Size(400, 100), Position = new Position(50, 800), Margin = 10, }; Button BtnScrollableUnset = new Button() { Text = "Scrollable Unset", Size = new Size(400, 100), Position = new Position(50, 920), Margin = 10, }; Button BtnScrollableRetain = new Button() { Text = "Scrollable Retain", Size = new Size(400, 100), Position = new Position(50, 1040), Margin = 10, }; Button BtnShow = new Button() { Text = "Show", Size = new Size(200, 100), Position = new Position(470, 850), Margin = 10, }; Button BtnHide = new Button() { Text = "Hide", Size = new Size(200, 100), Position = new Position(470, 990), Margin = 10, }; BtnScrollableSet.ClickEvent += BtnScrollableSet_ClickEvent; BtnScrollableUnset.ClickEvent += BtnScrollableUnset_ClickEvent; BtnScrollableRetain.ClickEvent += BtnScrollableRetain_ClickEvent; BtnShow.ClickEvent += BtnClientShow_ClickEvent; BtnHide.ClickEvent += BtnClientHide_ClickEvent; window.Add(BtnScrollableSet); window.Add(BtnScrollableUnset); window.Add(BtnScrollableRetain); window.Add(BtnShow); window.Add(BtnHide); }
public TextLabelControl() { this.m_tl = null; this.InitializeComponent(); }
private View CreateListItem(int imageIndex, string text, bool toggle) { LinearLayout linearLayout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal, }; View listItem = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.WrapContent, Layout = linearLayout, Padding = new Extents(5, 5, 40, 40), Name = "scrollingItem-entry-" + text, }; TextLabel textLabel = new TextLabel() { Text = text, Name = "scrollingItem-entry-text-label-" + text, Margin = new Extents(90, 0, 0, 0), TextColor = new Color(0.6f, 0.6f, 0.6f, 1), PointSize = 38, FontFamily = "SamsungOneUI 500C", }; if (imageIndex >= 0) { ImageView icon = new ImageView(applicationIconsArray[imageIndex]); listItem.Add(icon); } listItem.Add(textLabel); if (toggle) { Tizen.NUI.Components.ButtonStyle buttonStyle = new Tizen.NUI.Components.ButtonStyle { Icon = new ImageViewStyle { ResourceUrl = new Tizen.NUI.Components.StringSelector { Normal = "res/" + TestImages.iconImage[2], Selected = "res/" + TestImages.iconImage[1] }, }, IsSelectable = true, }; Tizen.NUI.Components.Button toggleButton = new Tizen.NUI.Components.Button(buttonStyle) { Name = "toggleButton", Size2D = new Size2D(90, 30), }; listItem.Add(toggleButton); } return(listItem); }
private string StyleFromLabelImplementation(TextLabel label, string clipId) { StringBuilder style = new StringBuilder(); //Sort out the fill style.Append("fill:none;"); //Sort out the stroke, ignore custom pens and use defaults //If mShape.CustomPen Is Nothing Then style.Append("stroke:"); style.Append(GetCompatibleColor(label.Color)); style.Append(";"); style.Append("stroke-width:1;"); return style.ToString(); }
public Slot(float left, float top) { BgQuad = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", left, top, Width, Size, new ColourValue(1, 1, 1), 1); BlueQuad = Engine.Singleton.Labeler.NewSimpleQuad("HighlightBlueMaterial", left, top, Width, Size, new ColourValue(1, 1, 1), 3); ItemLabel = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.02f, ColourValue.White, ColourValue.Black, 2); ItemLabel.SetPosition(left, top + 0.015f); BlueQuad.IsVisible = false; isSelected = false; }
private void InitializeCiaForm() { m_ciaForm = new FormWidget("CIA World Fact Book"); m_ciaForm.Anchor = WorldWind.NewWidgets.WidgetEnums.AnchorStyles.Right; m_ciaForm.ClientSize = new System.Drawing.Size(512, 384); // make it right aligned m_ciaForm.Location = new System.Drawing.Point( DrawArgs.ParentControl.Width - m_ciaForm.ClientSize.Width, DrawArgs.ParentControl.Height / 2 - m_ciaForm.ClientSize.Height / 2); m_ciaForm.BackgroundColor = System.Drawing.Color.FromArgb(0, 0, 0, 0); m_ciaForm.HeaderHeight = 0; m_ciaForm.HorizontalResizeEnabled = false; m_ciaForm.VerticalResizeEnabled = false; m_ciaForm.BorderEnabled = false; m_ciaForm.HorizontalScrollbarEnabled = false; m_ciaForm.VerticalScrollbarEnabled = false; m_bg_top = CreatePictureBox("Data\\Icons\\Interface\\bg-top.png", 0, 0, m_ciaForm); m_bg_middle = CreatePictureBox("Data\\Icons\\Interface\\bg-middle-extra.png", 0, 64, m_ciaForm); m_bg_bottom = CreatePictureBox("Data\\Icons\\Interface\\bg-bottom.png", 0, 320, m_ciaForm); int navOffset = 15; int navY = 329; m_nav_bar_up = CreatePictureBox("Data\\Icons\\Interface\\nav-bar-up.png", 0 * 32 + navOffset, navY, m_ciaForm); m_nav_bar_down = CreatePictureBox("Data\\Icons\\Interface\\nav-bar-down.png", 1 * 32 + navOffset, navY, m_ciaForm); m_nav_flag_up = CreatePictureBox("Data\\Icons\\Interface\\nav-flag-up.png", 2 * 32 + navOffset, navY, m_ciaForm); m_nav_flag_down = CreatePictureBox("Data\\Icons\\Interface\\nav-flag-down.png", 3 * 32 + navOffset, navY, m_ciaForm); int categoryOffset = 4 * 32 + navOffset + 32; m_category_introduction = CreatePictureBox("Data\\Icons\\Interface\\catagory-introduction.png", 0 * 32 + categoryOffset, navY, m_ciaForm); m_category_introduction.OnMouseUpEvent += new System.Windows.Forms.MouseEventHandler(m_category_introduction_OnMouseUpEvent); m_category_geography = CreatePictureBox("Data\\Icons\\Interface\\catagory-geography.png", 1 * 32 + categoryOffset, navY, m_ciaForm); m_category_geography.OnMouseUpEvent += new System.Windows.Forms.MouseEventHandler(m_category_geography_OnMouseUpEvent); m_category_people = CreatePictureBox("Data\\Icons\\Interface\\catagory-people.png", 2 * 32 + categoryOffset, navY, m_ciaForm); m_category_people.OnMouseUpEvent += new System.Windows.Forms.MouseEventHandler(m_category_people_OnMouseUpEvent); m_category_economy = CreatePictureBox("Data\\Icons\\Interface\\catagory-economy.png", 3 * 32 + categoryOffset, navY, m_ciaForm); m_category_economy.OnMouseUpEvent += new System.Windows.Forms.MouseEventHandler(m_category_economy_OnMouseUpEvent); m_category_communications = CreatePictureBox("Data\\Icons\\Interface\\catagory-communications.png", 4 * 32 + categoryOffset, navY, m_ciaForm); m_category_communications.OnMouseUpEvent += new System.Windows.Forms.MouseEventHandler(m_category_communications_OnMouseUpEvent); m_category_transportation = CreatePictureBox("Data\\Icons\\Interface\\catagory-transportation.png", 5 * 32 + categoryOffset, navY, m_ciaForm); m_category_transportation.OnMouseUpEvent += new System.Windows.Forms.MouseEventHandler(m_category_transportation_OnMouseUpEvent); m_category_military = CreatePictureBox("Data\\Icons\\Interface\\catagory-military.png", 6 * 32 + categoryOffset, navY, m_ciaForm); m_category_military.OnMouseUpEvent += new System.Windows.Forms.MouseEventHandler(m_category_military_OnMouseUpEvent); m_nav_left = CreatePictureBox("Data\\Icons\\Interface\\nav-left.png", 8 * 32 + categoryOffset, navY, m_ciaForm); m_nav_left.OnMouseUpEvent += new System.Windows.Forms.MouseEventHandler(m_nav_left_OnMouseUpEvent); m_nav_right = CreatePictureBox("Data\\Icons\\Interface\\nav-right.png", 9 * 32 + categoryOffset, navY, m_ciaForm); m_nav_right.OnMouseUpEvent += new System.Windows.Forms.MouseEventHandler(m_nav_right_OnMouseUpEvent); m_nav_close = CreatePictureBox("Data\\Icons\\Interface\\close.png", 16, 16, m_ciaForm); m_nav_close.OnMouseUpEvent += new System.Windows.Forms.MouseEventHandler(m_nav_close_OnMouseUpEvent); m_countryNameLabel = new TextLabel(); m_countryNameLabel.Name = "CountryName"; m_countryNameLabel.Text = "Country Name"; m_countryNameLabel.ForeColor = System.Drawing.Color.FromArgb(37, 64, 71); // dark forest green m_countryNameLabel.Location = new System.Drawing.Point(75, 65); m_countryNameLabel.ClientSize = new System.Drawing.Size(m_ciaForm.ClientSize.Width - 100, 100); m_countryNameLabel.Font = new System.Drawing.Font("Ariel", 16.0f, System.Drawing.FontStyle.Bold); m_countryNameLabel.Alignment = Alignment.Right; m_currentCategoryLabel = new TextLabel(); m_currentCategoryLabel.Name = "CurrentCategory"; m_currentCategoryLabel.Text = ""; m_currentCategoryLabel.ForeColor = System.Drawing.Color.FromArgb(37, 64, 71); // dark forest green m_currentCategoryLabel.Location = new System.Drawing.Point(75, 90); m_currentCategoryLabel.ClientSize = new System.Drawing.Size(m_ciaForm.ClientSize.Width - 100, 100); m_currentCategoryLabel.Font = new System.Drawing.Font("Ariel", 14.0f, System.Drawing.FontStyle.Regular); m_currentCategoryLabel.Alignment = Alignment.Right; m_currentBodyText = new TextLabel(); m_currentBodyText.Name = "CurrentBodyText"; m_currentBodyText.Text = ""; m_currentBodyText.ForeColor = System.Drawing.Color.FromArgb(37, 64, 71); // dark forest green m_currentBodyText.Location = new System.Drawing.Point(25, 110); m_currentBodyText.ClientSize = new System.Drawing.Size(m_ciaForm.ClientSize.Width - 40, 220); m_currentBodyText.Font = new System.Drawing.Font("Ariel", 8.0f, System.Drawing.FontStyle.Regular); m_currentBodyText.WordBreak = true; int offsetY = m_currentBodyText.Location.Y + 5; m_listLabels = new TextLabel[10]; for (int i = 0; i < m_listLabels.Length; i++) { m_listLabels[i] = new TextLabel(); m_listLabels[i].ClientSize = new System.Drawing.Size(250, 14); m_listLabels[i].Location = new System.Drawing.Point(m_currentBodyText.Location.X, offsetY + i * m_listLabels[i].ClientSize.Height); m_listLabels[i].ForeColor = System.Drawing.Color.FromArgb(37, 64, 71); m_listLabels[i].Font = new System.Drawing.Font("Ariel", 10.0f, System.Drawing.FontStyle.Regular); m_listLabels[i].Visible = false; m_ciaForm.ChildWidgets.Add(m_listLabels[i]); } m_scrollbars = new Scrollbar[10]; for (int i = 0; i < m_scrollbars.Length; i++) { m_scrollbars[i] = new Scrollbar(); m_scrollbars[i].ClientSize = new System.Drawing.Size(150, 7); m_scrollbars[i].Location = new System.Drawing.Point(m_currentBodyText.Location.X + 265, m_listLabels[i].Location.Y + 2); m_scrollbars[i].ForeColor = System.Drawing.Color.DarkOrange; m_scrollbars[i].Value = 0.0f; m_scrollbars[i].Visible = false; m_ciaForm.ChildWidgets.Add(m_scrollbars[i]); } m_ciaForm.ChildWidgets.Add(m_countryNameLabel); m_ciaForm.ChildWidgets.Add(m_currentCategoryLabel); m_ciaForm.ChildWidgets.Add(m_currentBodyText); m_ciaForm.Visible = false; DrawArgs.NewRootWidget.ChildWidgets.Add(m_ciaForm); DrawArgs.ParentControl.Resize += new EventHandler(ParentControl_Resize); }
protected override void LayoutItems() { if (styleApplied == false) { return; } if ((Icon == null) && (TextLabel == null)) { return; } // Icon is added in Button.LayoutItems(). if ((Icon != null) && (Children.Contains(Icon) == false)) { Add(Icon); } // TextLabel is added in Button.LayoutItems(). if ((TextLabel != null) && (Children.Contains(TextLabel) == false)) { Add(TextLabel); } // FIXME: set Selector<Extents> to padding var padding = new Extents(40, 40, 24, 24); var iconPadding = IconPadding; var textPadding = TextPadding; // Calculate size of TextLabel. if (TextLabel != null) { // TODO: Other orientation cases are not implemented yet. if ((IconRelativeOrientation == IconOrientation.Left) || (IconRelativeOrientation == IconOrientation.Right)) { var naturalWidthSum = (ushort)padding?.Start + (ushort)padding?.End + iconPadding.Start + iconPadding.End + (float)Icon?.SizeWidth + TextLabel.GetNaturalSize().Width; var naturalWidthDiff = SizeWidth - naturalWidthSum; if (naturalWidthDiff > 0) { TextLabel.SizeWidth = TextLabel.GetNaturalSize().Width; } else { TextLabel.SizeWidth = SizeWidth - (ushort)padding?.Start - (ushort)padding?.End - iconPadding.Start - iconPadding.End - textPadding.Start - textPadding.End - (float)Icon?.SizeWidth; } } } // Calculate positions of Icon and TextLabel. switch (IconRelativeOrientation) { // TODO: Other orientation cases are not implemented yet. case IconOrientation.Left: if (LayoutDirection == ViewLayoutDirectionType.LTR) { if (Icon != null) { float iconX = 0; float iconY = (ushort)padding?.Top + iconPadding.Top; if (string.IsNullOrEmpty(TextLabel?.Text)) { iconX = (SizeWidth - Icon.SizeWidth) / 2; } else { var widthSum = (ushort)padding?.Start + (ushort)padding?.End + iconPadding.Start + iconPadding.End + textPadding.Start + textPadding.End + Icon.SizeWidth + (float)TextLabel?.SizeWidth; var widthDiff = SizeWidth - widthSum; if (widthDiff > 0) { iconX = (ushort)padding?.Start + iconPadding.Start + (widthDiff / 2); } else { iconX = (ushort)padding?.Start + iconPadding.Start; } } Icon.Position = new Position(iconX, iconY); } if (TextLabel != null) { TextLabel.HorizontalAlignment = HorizontalAlignment.Begin; float textX = 0; float textY = 0; if (string.IsNullOrEmpty(Icon?.ResourceUrl)) { textX = (SizeWidth - TextLabel.SizeWidth) / 2; textY = (ushort)padding?.Top + textPadding.Top; } else { textX = (float)Icon?.PositionX + (float)Icon?.SizeWidth; textY = (ushort)padding?.Top + textPadding.Top + (((float)Icon?.SizeHeight - TextLabel.SizeHeight) / 2); } TextLabel.Position = new Position(textX, textY); } } break; default: break; } padding?.Dispose(); }
void ShowResolutionPanel() { // Disable previous stage browserPanel.Enabled = false; // Get resolutions initialResolution = Screen.currentResolution; availableResolutions = DaggerfallUI.GetDistinctResolutions(); // Create backdrop if (!backdropCreated) { CreateBackdrop(); } // Add resolution panel resolutionPanel.Outline.Enabled = true; resolutionPanel.BackgroundColor = backgroundColor; resolutionPanel.HorizontalAlignment = HorizontalAlignment.Left; resolutionPanel.VerticalAlignment = VerticalAlignment.Middle; resolutionPanel.Size = new Vector2(120, 175); NativePanel.Components.Add(resolutionPanel); // Add resolution title text TextLabel resolutionTitleLabel = new TextLabel(); resolutionTitleLabel.Text = GetText("resolution"); resolutionTitleLabel.Position = new Vector2(0, 2); //resolutionTitleLabel.ShadowPosition = Vector2.zero; resolutionTitleLabel.HorizontalAlignment = HorizontalAlignment.Center; resolutionPanel.Components.Add(resolutionTitleLabel); // Add resolution picker resolutionList.BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.5f); resolutionList.TextColor = unselectedTextColor; resolutionList.SelectedTextColor = selectedTextColor; resolutionList.ShadowPosition = Vector2.zero; resolutionList.HorizontalAlignment = HorizontalAlignment.Center; resolutionList.RowsDisplayed = 8; resolutionList.RowAlignment = HorizontalAlignment.Center; resolutionList.Position = new Vector2(0, 12); resolutionList.Size = new Vector2(80, 62); resolutionList.SelectedShadowPosition = DaggerfallUI.DaggerfallDefaultShadowPos; resolutionList.SelectedShadowColor = Color.black; resolutionList.OnMouseClick += ResolutionList_OnMouseClick; resolutionList.OnScroll += ResolutionList_OnScroll; resolutionPanel.Components.Add(resolutionList); // Add resolution scrollbar resolutionScroller.Position = new Vector2(100, 12); resolutionScroller.Size = new Vector2(5, 62); resolutionScroller.OnScroll += ResolutionScroller_OnScroll; resolutionPanel.Components.Add(resolutionScroller); // Add resolutions for (int i = 0; i < availableResolutions.Length; i++) { string item = string.Format("{0}x{1}", availableResolutions[i].width, availableResolutions[i].height); resolutionList.AddItem(item); if (availableResolutions[i].width == initialResolution.width && availableResolutions[i].height == initialResolution.height) { resolutionList.SelectedIndex = i; } } resolutionList.ScrollToSelected(); // Setup scroller resolutionScroller.DisplayUnits = 8; resolutionScroller.TotalUnits = resolutionList.Count; resolutionScroller.BackgroundColor = resolutionList.BackgroundColor; // Add fullscreen checkbox fullscreenCheckbox.Label.Text = GetText("fullscreen"); fullscreenCheckbox.Label.ShadowPosition = DaggerfallUI.DaggerfallDefaultShadowPos; fullscreenCheckbox.Label.ShadowColor = Color.black; fullscreenCheckbox.Position = new Vector2(0, 76); fullscreenCheckbox.HorizontalAlignment = HorizontalAlignment.Center; fullscreenCheckbox.IsChecked = Screen.fullScreen; fullscreenCheckbox.CheckBoxColor = selectedTextColor; fullscreenCheckbox.Label.TextColor = selectedTextColor; fullscreenCheckbox.OnToggleState += FullscreenCheckbox_OnToggleState; resolutionPanel.Components.Add(fullscreenCheckbox); // Add quality title text TextLabel qualityTitleLabel = new TextLabel(); qualityTitleLabel.Text = GetText("quality"); qualityTitleLabel.Position = new Vector2(0, 92); //qualityTitleLabel.ShadowPosition = Vector2.zero; qualityTitleLabel.HorizontalAlignment = HorizontalAlignment.Center; resolutionPanel.Components.Add(qualityTitleLabel); // Add quality picker qualityList.BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.5f); qualityList.TextColor = unselectedTextColor; qualityList.SelectedTextColor = selectedTextColor; qualityList.ShadowPosition = Vector2.zero; qualityList.HorizontalAlignment = HorizontalAlignment.Center; qualityList.RowsDisplayed = 6; qualityList.RowAlignment = HorizontalAlignment.Center; qualityList.Position = new Vector2(0, 102); qualityList.Size = new Vector2(85, 46); qualityList.SelectedShadowPosition = DaggerfallUI.DaggerfallDefaultShadowPos; qualityList.SelectedShadowColor = Color.black; qualityList.OnMouseClick += QualityList_OnMouseClick; resolutionPanel.Components.Add(qualityList); foreach (var name in QualitySettings.names) { qualityList.AddItem(name); } qualityList.SelectedIndex = DaggerfallUnity.Settings.QualityLevel; // Test/confirm button testText = GetText("testText"); okText = GetText("okText"); testOrConfirmButton.Position = new Vector2(0, 160); testOrConfirmButton.Size = new Vector2(40, 12); testOrConfirmButton.Outline.Enabled = true; testOrConfirmButton.Label.Text = testText; testOrConfirmButton.BackgroundColor = new Color(0.0f, 0.5f, 0.0f, 0.4f); testOrConfirmButton.HorizontalAlignment = HorizontalAlignment.Center; testOrConfirmButton.OnMouseClick += ResolutionTestOrConfirmButton_OnMouseClick; resolutionPanel.Components.Add(testOrConfirmButton); }
protected override void Setup() { base.Setup(); ParentPanel.BackgroundColor = Color.clear; pickerPanel = new Panel(); pickerPanel.Size = new Vector2(600, 250); pickerPanel.HorizontalAlignment = HorizontalAlignment.Center; pickerPanel.VerticalAlignment = VerticalAlignment.Middle; pickerPanel.BackgroundColor = new Color(0, 0, 0, 0.7f); pickerPanel.Outline.Enabled = true; ParentPanel.Components.Add(pickerPanel); var hexSymbol = new TextLabel(); hexSymbol.Text = "#"; hexSymbol.Position = new Vector2(20, 140); pickerPanel.Components.Add(hexSymbol); hexColor = new TextBox(); hexColor.Position = new Vector2(20 + hexSymbol.Size.x, 140); hexColor.MaxCharacters = 8; hexColor.OnType += HexColor_OnType; pickerPanel.Components.Add(hexColor); rgbaColor = new TextLabel(); rgbaColor.Position = new Vector2(20, 150); pickerPanel.Components.Add(rgbaColor); hsvColor = new TextLabel(); hsvColor.Position = new Vector2(20, 160); pickerPanel.Components.Add(hsvColor); colorPreview = new Panel(); colorPreview.Size = new Vector2(colorPreviewWidth, colorPreviewHeight); colorPreview.HorizontalAlignment = HorizontalAlignment.Right; colorPreview.Position = new Vector2(0, 1); pickerPanel.Components.Add(colorPreview); var crosshairTex = Resources.Load <Texture2D>("Crosshair"); crosshair = new Panel(); crosshair.BackgroundTexture = crosshairTex; crosshair.Size = new Vector2(crosshairTex.width, crosshairTex.height); colorPreview.Components.Add(crosshair); slider = new HorizontalSlider(); slider.HorizontalAlignment = HorizontalAlignment.Right; slider.Position = new Vector2(0, 220); slider.Size = new Vector2(400.0f, 10.0f); slider.DisplayUnits = 50; slider.TotalUnits = slider.DisplayUnits + colors.Length - 1; slider.BackgroundTexture = GetSliderBackground(colors); slider.BackgroundTextureLayout = BackgroundLayout.StretchToFill; slider.TintColor = new Color(1, 1, 1, 0.7f); slider.OnScroll += Slider_OnScroll; pickerPanel.Components.Add(slider); if (sender != null) { SetColor(sender.BackgroundColor); } else { SetColor(Color.white); } }
private void BtnService_ClickEvent(object sender, Button.ClickEventArgs e) { Window window = NUIApplication.GetDefaultWindow(); Shell.QuickPanelService.Types type = Shell.QuickPanelService.Types.AppsMenu; window.Remove(BtnService); window.Remove(BtnClient); window.Remove(BtnSoftkeyService); window.Remove(BtnSoftkeyClient); qpService = new Shell.QuickPanelService(tzShell, window, type); //if ((type == Shell.QuickPanelService.Types.ContextMenu) || (type == Shell.QuickPanelService.Types.AppsMenu)) //window.AddAuxiliaryHint("wm.policy.win.user.geometry", "1"); TextLabel textServiceType = new TextLabel($"Type: {qpService.ServiceType}"); textServiceType.Position = new Position(0, -300); textServiceType.HorizontalAlignment = HorizontalAlignment.Center; textServiceType.VerticalAlignment = VerticalAlignment.Center; textServiceType.TextColor = Color.Blue; textServiceType.PointSize = 12.0f; textServiceType.HeightResizePolicy = ResizePolicyType.FillToParent; textServiceType.WidthResizePolicy = ResizePolicyType.FillToParent; window.Add(textServiceType); Button BtnShow = new Button() { Text = "Show", Size = new Size(200, 100), Position = new Position(50, 500), Margin = 10, }; Button BtnHide = new Button() { Text = "Hide", Size = new Size(200, 100), Position = new Position(410, 500), Margin = 10, }; Button BtnEffectSwipe = new Button() { Text = "EffectSwipe", Size = new Size(400, 80), Position = new Position(50, 700), Margin = 10, }; Button BtnEffectMove = new Button() { Text = "EffectMove", Size = new Size(400, 80), Position = new Position(50, 800), Margin = 10, }; Button BtnEffectAppCustom = new Button() { Text = "EffectAppCustom", Size = new Size(400, 80), Position = new Position(50, 900), Margin = 10, }; Button BtnLockTrue = new Button() { Text = "LockTrue", Size = new Size(300, 80), Position = new Position(50, 1000), Margin = 10, }; Button BtnLockFalse = new Button() { Text = "LockFalse", Size = new Size(300, 80), Position = new Position(400, 1000), Margin = 10, }; Button BtnTimerStop = new Button() { Text = "TimerStop", Size = new Size(300, 80), Position = new Position(50, 50), Margin = 10, }; BtnShow.ClickEvent += BtnServiceShow_ClickEvent; BtnHide.ClickEvent += BtnServiceHide_ClickEvent; BtnEffectSwipe.ClickEvent += BtnEffectSwipe_ClickEvent; BtnEffectMove.ClickEvent += BtnEffectMove_ClickEvent; BtnEffectAppCustom.ClickEvent += BtnEffectAppCustom_ClickEvent; BtnLockTrue.ClickEvent += BtnLockTrue_ClickEvent; BtnLockFalse.ClickEvent += BtnLockFalse_ClickEvent; BtnTimerStop.ClickEvent += BtnTimerStop_ClickEvent; window.Add(BtnShow); window.Add(BtnHide); window.Add(BtnEffectSwipe); window.Add(BtnEffectMove); window.Add(BtnEffectAppCustom); window.Add(BtnLockTrue); window.Add(BtnLockFalse); window.Add(BtnTimerStop); qpRegion = new Shell.TizenRegion(tzShell); qpRegion.Add(window.WindowPosition.X, window.WindowPosition.Y, window.WindowSize.Width, window.WindowSize.Height - 50); qpService.SetContentRegion(0, qpRegion); qpRegion.Dispose(); qpRegion = new Shell.TizenRegion(tzShell); qpRegion.Add(window.WindowPosition.X, window.WindowPosition.Y + window.WindowSize.Height - 50, window.WindowSize.Width, 50); qpService.SetHandlerRegion(0, qpRegion); qpRegion.Dispose(); _timer = new Timer(2000); _timer.Tick += Timer_Tick; _timer.Start(); }
public bool IsOver(TextLabel label) { return (Engine.Singleton.GetFloatFromPxWidth(Engine.Singleton.Mysz.X.abs) >= label.TextArea.Left && Engine.Singleton.GetFloatFromPxWidth(Engine.Singleton.Mysz.X.abs) <= label.GetTextWidth() + label.TextArea.Left && Engine.Singleton.GetFloatFromPxHeight(Engine.Singleton.Mysz.Y.abs) >= label.TextArea.Top && Engine.Singleton.GetFloatFromPxHeight(Engine.Singleton.Mysz.Y.abs) <= (label.TextArea.CharHeight + label.TextArea.Top)); }
public MaterialEditorViewModel(Material material) { Material = material; DisplayName = material.Name; DisplayDebugText = true; Nodes = new ObservableCollection <NodeViewModel>(); material.Nodes.ForEach(n => Nodes.Add(new NodeViewModel(n))); _viewportGui = new ScreenGui { Name = "MaterialViewportGui" }; _character = new Character { Parent = _canvas }; _debugLabel = new TextLabel { TextColour = Colour.DebugForeground, BorderThickness = 0, BackgroundColour = Colour.DebugBackground, TextAlignmentX = AlignmentX.Left, TextAlignmentY = AlignmentY.Top, FontSize = 14, Parent = _viewportGui }; var previewStack = new Stack { Parent = _viewportGui, Position = new UDim2(0, 4, 0, 4), Size = new UDim2(0, 26 * 5, 0, 26), Offset = new Vector2(4, 4), Orientation = FlowDirection.Horizontal, BackgroundColour = Colour.Transparent, AlignmentY = AlignmentY.Bottom, AlignmentX = AlignmentX.Right }; var previewStackButton = new Button { Size = new UDim2(0, 26, 0, 26), BackgroundColour = new Colour(0, 0, 0, 0.4f), BorderThickness = 0 }; using (previewStackButton) { var cylinderButton = MakePreviewButton(PreviewShape.Cylinder, "Toolbar/CylinderPreview"); cylinderButton.FrameIndex = 0; cylinderButton.Parent = previewStack; var sphereButton = MakePreviewButton(PreviewShape.Sphere, "Toolbar/SpherePreview"); sphereButton.FrameIndex = 1; sphereButton.Parent = previewStack; var planeButton = MakePreviewButton(PreviewShape.Plane, "Toolbar/PlanePreview"); planeButton.FrameIndex = 2; planeButton.Parent = previewStack; var cubeButton = MakePreviewButton(PreviewShape.Cube, "Toolbar/CubePreview"); cubeButton.FrameIndex = 3; cubeButton.Parent = previewStack; var meshButton = MakePreviewButton(PreviewShape.Mesh, "Toolbar/TeapotPreview"); meshButton.FrameIndex = 4; meshButton.Parent = previewStack; } RunService.Service.Heartbeat.Event += UpdateDebugText; }
public void Initialize() { Window window = Window.Instance; window.BackgroundColor = Color.White; TextLabel pixelLabel = new TextLabel("Test Pixel Size 32.0f"); pixelLabel.Position2D = new Position2D(10, 10); pixelLabel.PixelSize = 32.0f; pixelLabel.BackgroundColor = Color.Magenta; window.Add(pixelLabel); _pointLabel = new TextLabel("Test Point Size 32.0f"); _pointLabel.Position2D = new Position2D(10, 100); _pointLabel.PointSize = 32.0f; _pointLabel.BackgroundColor = Color.Red; //_pointLabel.TextColorAnimatable = Color.Green; // Set initial text color using animatable property _pointLabel.TouchEvent += LabelTouched; _colorToggle = true; window.Add(_pointLabel); TextLabel ellipsis = new TextLabel("Ellipsis of TextLabel is enabled."); ellipsis.Size2D = new Size2D(100, 80); ellipsis.Position2D = new Position2D(10, 200); ellipsis.PointSize = 20.0f; ellipsis.Ellipsis = true; ellipsis.BackgroundColor = Color.Cyan; window.Add(ellipsis); TextLabel autoScrollStopMode = new TextLabel("AutoScrollStopMode is finish-loop."); autoScrollStopMode.Size2D = new Size2D(400, 50); autoScrollStopMode.Position2D = new Position2D(10, 300); autoScrollStopMode.PointSize = 15.0f; autoScrollStopMode.BackgroundColor = Color.Green; autoScrollStopMode.AutoScrollStopMode = AutoScrollStopMode.FinishLoop; autoScrollStopMode.EnableAutoScroll = true; window.Add(autoScrollStopMode); TextField field = new TextField(); field.Size2D = new Size2D(400, 100); field.Position2D = new Position2D(10, 400); field.BackgroundColor = Color.Cyan; field.PlaceholderText = "input someth..."; field.PlaceholderTextFocused = "input someth... focused"; field.Focusable = true; PropertyMap hiddenMap = new PropertyMap(); hiddenMap.Add(HiddenInputProperty.Mode, new PropertyValue((int)HiddenInputModeType.ShowLastCharacter)); hiddenMap.Add(HiddenInputProperty.ShowLastCharacterDuration, new PropertyValue(2)); hiddenMap.Add(HiddenInputProperty.SubstituteCount, new PropertyValue(4)); hiddenMap.Add(HiddenInputProperty.SubstituteCharacter, new PropertyValue(0x23)); field.HiddenInputSettings = hiddenMap; field.EnableSelection = true; field.EnableShiftSelection = false; window.Add(field); InputMethod inputMethod = new InputMethod(); inputMethod.PanelLayout = InputMethod.PanelLayoutType.Number; inputMethod.ActionButton = InputMethod.ActionButtonTitleType.Go; inputMethod.AutoCapital = InputMethod.AutoCapitalType.Word; inputMethod.Variation = 1; field.InputMethodSettings = inputMethod.OutputMap; PropertyMap propertyMap = new PropertyMap(); propertyMap.Add("placeholderText", new PropertyValue("Placeholder Text")); propertyMap.Add("placeholderTextFocused", new PropertyValue("Placeholder Text Focused")); propertyMap.Add("placeholderColor", new PropertyValue(Color.Red)); propertyMap.Add("placeholderPointSize", new PropertyValue(15.0f)); PropertyMap fontStyleMap = new PropertyMap(); fontStyleMap.Add("weight", new PropertyValue("bold")); fontStyleMap.Add("width", new PropertyValue("condensed")); fontStyleMap.Add("slant", new PropertyValue("italic")); propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap)); TextEditor editor = new TextEditor(); editor.Size2D = new Size2D(400, 100); editor.Position2D = new Position2D(10, 550); editor.BackgroundColor = Color.Magenta; editor.EnableScrollBar = true; editor.EnableSelection = true; editor.Focusable = true; editor.Placeholder = propertyMap; editor.MaxLength = 10; window.Add(editor); editor.TextChanged += (obj, e) => { Tizen.Log.Debug("NUI", "editor line count: " + e.TextEditor.LineCount); }; editor.ScrollStateChanged += (obj, e) => { Tizen.Log.Debug("NUI", "editor scroll state:" + e.ScrollState); }; editor.MaxLengthReached += (obj, e) => { Tizen.Log.Debug("NUI", "editor max length: " + e.TextEditor.MaxLength); }; Tizen.Log.Debug("NUI", "editor id: " + editor.ID); FocusManager.Instance.SetCurrentFocusView(editor); editor.UpFocusableView = field; field.DownFocusableView = editor; NUILog.Debug($"### field.EnableShiftSelection={field.EnableShiftSelection}, editor.EnableShiftSelection={editor.EnableShiftSelection}"); }
public TLColShape(Client client, string text_label) { ColShape = NAPI.ColShape.CreateCylinderColShape(client.Position.Subtract(new Vector3(0, 0, 1)), 5, 5); Marker = NAPI.Marker.CreateMarker(1, client.Position.Subtract(new Vector3(0, 0, 1)), new Vector3(), new Vector3(), 2f, new Color(255, 255, 255, 100)); TextLabel = NAPI.TextLabel.CreateTextLabel(text_label, client.Position, 5, 1f, 4, new Color(255, 255, 255, 255)); }
public Style(TextLabel label) { mLabel = label; mStyle = StyleFromLabelImplementation(label, ""); }
public void Deactivate() { if (mEditButton != null) { mToolBarLayer.Remove(mEditButton); mEditButton.Dispose(); mEditButton = null; } if (mTitle != null) { mToolBarLayer.Remove(mTitle); mTitle.Dispose(); mTitle = null; } if (mLayoutButton != null) { mToolBarLayer.Remove(mLayoutButton); mLayoutButton.Dispose(); mLayoutButton = null; } if (mToolBarLayer != null) { mRootView.Remove(mToolBarLayer); mToolBarLayer.Dispose(); mToolBarLayer = null; } if (mReplaceButton != null) { mReplaceButton.GetParent().Remove(mReplaceButton); mReplaceButton.Dispose(); mReplaceButton = null; } if (mInsertButton != null) { mInsertButton.GetParent().Remove(mInsertButton); mInsertButton.Dispose(); mInsertButton = null; } if (mDeleteButton != null) { mDeleteButton.GetParent().Remove(mDeleteButton); mDeleteButton.Dispose(); mDeleteButton = null; } if (mItemView != null) { mContentView.Remove(mItemView); mItemView.Dispose(); mItemView = null; } if (mContentView != null) { mRootView.Remove(mContentView); mContentView.Dispose(); mContentView = null; } if (mRootView != null) { mDefaultLayer.Remove(mRootView); mRootView.Dispose(); mRootView = null; } NUIApplication.GetDefaultWindow().GetDefaultLayer().Behavior = Layer.LayerBehavior.LayerUI; }