public void refresh() { Texture2D refreshTexture = createImageNinepatch(); if (refreshTexture == null) { return; } curNinepatch.LoadFromTexture(refreshTexture); }
public void LoadContent(bool reload) { Texture2D textFieldDefault = ConversionManager.BitmapToTexture(Resource1.textfield_default_9, this.main.GraphicsDevice); Texture2D textFieldSelected = ConversionManager.BitmapToTexture(Resource1.textfield_selected_9, this.main.GraphicsDevice); Texture2D textFieldRight = ConversionManager.BitmapToTexture(Resource1.textfield_selected_right_9, this.main.GraphicsDevice); Texture2D textFieldWrong = ConversionManager.BitmapToTexture(Resource1.textfield_selected_wrong_9, this.main.GraphicsDevice); Texture2D windowSelected = ConversionManager.BitmapToTexture(Resource1.window_selected_9, this.main.GraphicsDevice); Texture2D windowUnselected = ConversionManager.BitmapToTexture(Resource1.window_unselected_9, this.main.GraphicsDevice); Texture2D panelSelected = ConversionManager.BitmapToTexture(Resource1.panel_selected_9, this.main.GraphicsDevice); Texture2D panelUnselected = ConversionManager.BitmapToTexture(Resource1.panel_unselected_9, this.main.GraphicsDevice); Texture2D dropdown = ConversionManager.BitmapToTexture(Resource1.dropdown, this.main.GraphicsDevice); Texture2D btnDefault = ConversionManager.BitmapToTexture(Resource1.btn_default_9, this.main.GraphicsDevice); Texture2D btnClicked = ConversionManager.BitmapToTexture(Resource1.btn_clicked_9, this.main.GraphicsDevice); Texture2D btnHover = ConversionManager.BitmapToTexture(Resource1.btn_hover_9, this.main.GraphicsDevice); Texture2D sliderRange = ConversionManager.BitmapToTexture(Resource1.sliderRange_9, this.main.GraphicsDevice); TextureSliderDefault = ConversionManager.BitmapToTexture(Resource1.slider, this.main.GraphicsDevice); TextureSliderSelected = ConversionManager.BitmapToTexture(Resource1.sliderSelected, this.main.GraphicsDevice); NinePatchSliderRange.LoadFromTexture(sliderRange); TextureCheckBoxDefault = ConversionManager.BitmapToTexture(Resource1.checkbox_default, this.main.GraphicsDevice); TextureCheckBoxSelected = ConversionManager.BitmapToTexture(Resource1.checkbox_default_selected, this.main.GraphicsDevice); TextureCheckBoxDefaultChecked = ConversionManager.BitmapToTexture(Resource1.checkbox_checked, this.main.GraphicsDevice); TextureCheckBoxSelectedChecked = ConversionManager.BitmapToTexture(Resource1.checkbox_checked_selected, this.main.GraphicsDevice); NinePatchTextFieldDefault.LoadFromTexture(textFieldDefault); NinePatchTextFieldSelected.LoadFromTexture(textFieldSelected); NinePatchTextFieldRight.LoadFromTexture(textFieldRight); NinePatchTextFieldWrong.LoadFromTexture(textFieldWrong); NinePatchWindowSelected.LoadFromTexture(windowSelected); NinePatchWindowUnselected.LoadFromTexture(windowUnselected); NinePatchPanelUnselected.LoadFromTexture(panelUnselected); NinePatchPanelSelected.LoadFromTexture(panelSelected); NinePatchDropDown.LoadFromTexture(dropdown); NinePatchBtnDefault.LoadFromTexture(btnDefault); NinePatchBtnClicked.LoadFromTexture(btnClicked); NinePatchBtnHover.LoadFromTexture(btnHover); NinePatchTabDefault.LoadFromTexture(btnDefault); NinePatchTabSelected.LoadFromTexture(btnHover); foreach (View v in this.GetAllViews(this.RootView)) { v.LoadContent(reload); } White = new Texture2D(this.main.GraphicsDevice, 1, 1); White.SetData(new Color[] { Color.White }); }
public void LoadFromTextureTest() { NinePatch target = new NinePatch(); // TODO: Initialize to an appropriate value Texture2D texture = null; // TODO: Initialize to an appropriate value target.LoadFromTexture(texture); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public static void YogUI_LoadContent(Game game) { content = new ResourceContentManager(game.Services, Resource1.ResourceManager); white = new Texture2D(game.GraphicsDevice, 1, 1); white.SetData <Color>(new Color[] { Color.White }); circleShader = content.Load <Effect>("CircleShader"); btn_hover.LoadFromTexture(content.Load <Texture2D>("btn_default_focused_holo_9")); btn_normal.LoadFromTexture(content.Load <Texture2D>("btn_default_normal_holo_9")); textField_normal.LoadFromTexture(content.Load <Texture2D>("textfield_default_9")); textField_selected.LoadFromTexture(content.Load <Texture2D>("textfield_selected_9")); textField_selected_right.LoadFromTexture(content.Load <Texture2D>("textfield_selected_right_9")); textField_selected_wrong.LoadFromTexture(content.Load <Texture2D>("textfield_selected_wrong_9")); //Texture2D test = content.Load<Texture2D>("ninepatchtest"); // bool isPatch = textField_normal.isAlreadyNinepatch(textField_normal.texture); inputManager = new InputManager(); theGame = game; }