示例#1
0
 /// <summary>
 /// Renders this control.
 /// </summary>
 /// <param name="offsetX">The X offset.</param>
 /// <param name="offsetY">The Y offset.</param>
 public override void RenderControl(int offsetX, int offsetY)
 {
     if (this.FaceId.HasValue)
     {
         GuiFace face = Game.GuiManager.GetFace(this.FaceId.Value);
         face.Render(offsetX + X.GetValueOrDefault(0), offsetY + Y.GetValueOrDefault(0));
     }
 }
示例#2
0
        /// <summary>
        /// Renders the IRenderable to the specified surface.
        /// </summary>
        /// <param name="surface">The target surface.</param>
        public virtual void Render()
        {
            GuiFace face = Game.GuiManager.GetFace(FaceId);

            if (face != null)
            {
                face.Render(0, 0);
            }
        }
示例#3
0
        /// <summary>
        /// Renders this control.
        /// </summary>
        /// <param name="offsetX">The X offset.</param>
        /// <param name="offsetY">The Y offset.</param>
        public override void RenderControl(int offsetX, int offsetY)
        {
            if (this.FaceId.HasValue && this.DataSource.HasValue)
            {
                GuiFace face = Game.GuiManager.GetFace(this.FaceId.Value);

                DataIndex = 0;

                foreach (var dataItem in this.DataSource.Value)
                {
                    DataItem = dataItem;

                    // Note that ChildOffsetX is usually a data bound and would be called with a different DataItem each time - exactly the way we want it.
                    face.Render(offsetX + X.GetValueOrDefault(0) + ChildOffsetX.GetValueOrDefault(0), offsetY + Y.GetValueOrDefault(0) + ChildOffsetY.GetValueOrDefault(0));

                    DataIndex++;
                }

                DataItem = null;
            }
        }