예제 #1
0
파일: Icon.cs 프로젝트: TRushton95/Frames
        /// <summary>
        /// Builds the components.
        /// </summary>
        private void BuildComponents()
        {
            this.defaultImageGraphics = new ImageGraphics(this.Texture, PositionFactory.Center());
            this.defaultImageGraphics.Initialise(this.GetBounds());

            if (this.HoverTexture != null)
            {
                this.hoverImageGraphics = new ImageGraphics(this.HoverTexture, PositionFactory.Center());
                this.hoverImageGraphics.Initialise(this.GetBounds());
            }

            this.imageGraphics = this.defaultImageGraphics;
        }
예제 #2
0
        /// <summary>
        /// Builds the components.
        /// </summary>
        private void BuildComponents()
        {
            int textMaxWidth = this.Width - (Gutter * 2);

            if (this.Border != null && this.Border.Width > 0)
            {
                textMaxWidth -= this.Border.Width * 2;
            }

            this.frame = new Frame(this.Width, this.Height, Color.Cyan, PositionFactory.Center(), this.Border);
            this.frame.Initialise(this.GetBounds());
            this.textGraphics = new TextGraphics(this.Text, this.Font, Color.Yellow, textMaxWidth, FontFlow.Wrap, PositionFactory.TopCenter());
            this.textGraphics.Initialise(this.GetContentBounds());
        }
예제 #3
0
 /// <summary>
 /// Builds the components.
 /// </summary>
 private void BuildComponents()
 {
     this.frame = new Frame(this.Width, this.Height, this.Color, PositionFactory.Center(), this.Border);
     this.frame.Initialise(this.GetBounds());
 }
예제 #4
0
        /// <summary>
        /// Converts the jObject to a container blocker.
        /// </summary>
        /// <remarks>
        /// A blocker is just a transparent container that matches the window bounds in order to prevent interaction with the rest of the ui.
        /// </remarks>
        private Container ConvertToBlocker(JObject jObject, JsonSerializer serializer)
        {
            string             name     = jObject["Name"].Value <string>();
            Color              color    = jObject["Color"].ToObject <Color>(serializer);
            List <BaseElement> children = jObject["Children"].ToObject <List <BaseElement> >(serializer);

            Container result = new Container(name, Resources.Instance.Screen.Width, Resources.Instance.Screen.Height, Border.None, color, PositionFactory.Center(), children);

            result.Visible = jObject["Visible"] == null ? true : jObject["Visible"].Value <bool>();

            return(result);
        }
예제 #5
0
파일: Button.cs 프로젝트: TRushton95/Frames
 /// <summary>
 /// Builds the components.
 /// </summary>
 private void BuildComponents()
 {
     this.frame = new Frame(this.Width, this.Height, this.FrameColor, PositionFactory.Center(), this.Border);
     this.frame.Initialise(this.GetBounds());
     this.textGraphics = new TextGraphics(this.Text, this.Font, this.TextColor, this.Width - (Gutter * 2), FontFlow.Scale, PositionFactory.Center());
     this.textGraphics.Initialise(this.GetContentBounds());
 }