private void setFrame(int width, int height, Color c) { frame = new Frame(); frame.texture = SpriteObject.CreateTexture(width, height, c); frame.LoadContent(); frame.origin = Vector2.Zero; frame.layer = 0; frame.parent = this; frame.hlColor = frame.hlOverColor; frame.state = Frame.STATE_ACTIVE; }
public void setBorders(int width, int inset, Texture2D texture, Color c) { //good inset values are between 0 and -width borderTop = new Block(); borderTop.texture = SpriteObject.CreateTexture( (int)(this.texture.Width - inset * 2), (int)width, texture, TextureStyle.Tile); borderTop.LoadContent(); borderTop.origin = Vector2.Zero; borderTop.parent = this; borderTop.position.X = 0 + inset; borderTop.position.Y = 0 + inset; borderTop.state = Block.STATE_ACTIVE; borderTop.layer = .1f; borderTop.color = c; borderBottom = new Block(); borderBottom.texture = SpriteObject.CreateTexture( (int)(this.texture.Width - inset * 2), (int)width, texture, TextureStyle.Tile); borderBottom.LoadContent(); borderBottom.origin = Vector2.Zero; borderBottom.parent = this; borderBottom.position.X = 0 + inset; borderBottom.position.Y = this.texture.Height - width - inset; borderBottom.state = Block.STATE_ACTIVE; borderBottom.layer = .1f; borderBottom.color = c; borderLeft = new Block(); borderLeft.texture = SpriteObject.CreateTexture( (int)width, (int)(this.texture.Height - inset * 2), texture, TextureStyle.Tile); borderLeft.LoadContent(); borderLeft.origin = Vector2.Zero; borderLeft.parent = this; borderLeft.position.X = 0 + inset; borderLeft.position.Y = 0 + inset; borderLeft.state = Block.STATE_ACTIVE; borderLeft.layer = .1f; borderLeft.color = c; borderRight = new Block(); borderRight.texture = SpriteObject.CreateTexture( (int)width, (int)(this.texture.Height - inset * 2), texture, TextureStyle.Tile); borderRight.LoadContent(); borderRight.origin = Vector2.Zero; borderRight.parent = this; borderRight.position.X = this.texture.Width - width - inset; borderRight.position.Y = 0 + inset; borderRight.state = Block.STATE_ACTIVE; borderRight.layer = .1f; borderRight.color = c; }