//private Texture2D weaponBackgroundTexture; public UIShortcutButton( int width, int height, Vector2 position, int key ) : base(width, height, position) { Key = key; weaponTexture = Main.ContentManager.Load<Texture2D>( "images/items/item_1" ); //weaponTexture = LoadedRenderer.GetStatic("S_Item_" + weapon.TypeId).Texture; //weapon.Renderer.Draw(spriteBatch, new UILocation(new Rectangle(0,0,10,10)); //weaponBackgroundTexture = Main.ContentManager.Load<Texture2D>( "images/gui/inventar/shortcut_weapon" ); weaponPanel = new UIWeaponPanel( height, new Vector2( ( int ) height, 0 ) ); Add(weaponPanel); }
private void InitComponents() { var shortCutTitel = new UIButton(initWidth, 40, new Vector2(0, 0), "Konstruktor"); weaponPanel = new UIWeaponPanel(100, new Vector2(0, 40)); nameButton = new UIButton(initWidth, 30, new Vector2(0, 140), "Name der Waffe"); antriebButton = new UIButton(DEFAULT_HEIGHT, DEFAULT_HEIGHT, new Vector2(0, 180), ""); stabilisatorButton = new UIButton(DEFAULT_HEIGHT, DEFAULT_HEIGHT, new Vector2(0, 230), ""); visierButton = new UIButton(DEFAULT_HEIGHT, DEFAULT_HEIGHT, new Vector2(0, 280), ""); demageButton = new UIButton(120, DEFAULT_HEIGHT, new Vector2(50, 180), "Schaden : 5"); rateOfFireButton = new UIButton(120, DEFAULT_HEIGHT, new Vector2(50, 230), "Feuerate : 10"); accuracyButton = new UIButton(120, DEFAULT_HEIGHT, new Vector2(50, 280), "Genauigkeit : 13"); player.Liquids = new Vector3(14, 11, 22); bar1 = new UIVerticalProgressBar(40, 140, new Vector2(175, 180), 100, player.Liquids.X) {BackgroundColor = Color.Blue}; bar2 = new UIVerticalProgressBar(40, 140, new Vector2(215, 180), 100, player.Liquids.Y) {BackgroundColor = Color.Green}; bar3 = new UIVerticalProgressBar(40, 140, new Vector2(255, 180), 100, player.Liquids.Z) {BackgroundColor = Color.Red}; var okButtonTexture = Main.ContentManager.Load<Texture2D>("images/gui/inventar/craft_button"); var okButtonHoverTexture = Main.ContentManager.Load<Texture2D>("images/gui/inventar/craft_button_h"); okButton = new UIButton(initWidth, 30, new Vector2(0, 330), okButtonTexture, okButtonHoverTexture, ""); var pixelWhite = Main.ContentManager.Load<Texture2D>("images/pixelWhite"); nameButtonActiveTextur = Main.ContentManager.Load<Texture2D>("images/gui/inventar/name_button_a"); nameButtonTextur = Main.ContentManager.Load<Texture2D>("images/gui/inventar/name_button"); okButton.AddActionListener(listener); nameButton.AddActionListener(this); Add(shortCutTitel); Add(nameButton); Add(weaponPanel); Add(antriebButton); Add(stabilisatorButton); Add(visierButton); Add(demageButton); Add(rateOfFireButton); Add(accuracyButton); Add(bar1); Add(bar2); Add(bar3); Add(okButton); }