public BookShelveConstructionProvider() { drawables = new SimpleDrawableComponent[] { new SimpleDrawableComponent( 0, new TextureDrawable( CustomTextureManager.GetFromAssemblyResource( Assembly.GetExecutingAssembly(), "Faark.Gnomoria.Mods.Resources.sprite.png" ), new Rectangle(0, 32, 32, 32), new Vector2(0, -12) ) ) }; }
public static void On_Skin_Init(Skin self) { if ((graphicsTex == null) || (graphicsTex.GraphicsDevice != GnomanEmpire.Instance.GraphicsDevice) || graphicsTex.IsDisposed) { graphicsTex = CustomTextureManager.GetFromAssemblyResource(Assembly.GetExecutingAssembly(), "Faark.Gnomoria.Mods.Resources.maxButtons.png"); //Texture2D.FromStream(GnomanEmpire.Instance.GraphicsDevice, Assembly.GetExecutingAssembly().GetManifestResourceStream( "Faark.Gnomoria.Mods.Resources.maxButtons.png")); } var maxImg = new SkinImage(); maxImg.Resource = graphicsTex; // warning have to load it here! maxImg.Name = "Window.MaximizeButton"; self.Images.Add(maxImg); var mySkinLayer = new SkinLayer(); mySkinLayer.Name = "Control"; mySkinLayer.Alignment = Alignment.MiddleLeft; mySkinLayer.ContentMargins = new Margins(6); mySkinLayer.SizingMargins = new Margins(6); mySkinLayer.Image = maxImg; mySkinLayer.Height = 28; mySkinLayer.Width = 28; mySkinLayer.States.Disabled.Index = 2; mySkinLayer.States.Enabled.Index = 2; mySkinLayer.States.Focused.Index = 0; mySkinLayer.States.Hovered.Index = 0; mySkinLayer.States.Pressed.Index = 2; mySkinLayer.Text = new SkinText(self.Controls["Window.CloseButton"].Layers[0].Text); var mySkinControl = new SkinControl(); mySkinControl.Inherits = "Button"; mySkinControl.ResizerSize = 4; mySkinControl.DefaultSize = new Size(28, 28); mySkinControl.Name = "Window.MaximizeButton"; mySkinControl.Layers.Add(mySkinLayer); self.Controls.Add(mySkinControl); }