예제 #1
0
        /// <summary>
        /// Creates a new StandardForm and passes by value (not as efficient)
        /// </summary>
        /// <param name="name">Name of form</param>
        /// <returns>Value of form</returns>
        public StandardForm CreateStandardForm(string name)
        {
            var sf = new StandardForm(InternalWindows, _spriteBatch, _content, name);

            sf.Initialize(_spriteBatch, _content); // Important because UI elements store references to both.
            return(sf);
        }
예제 #2
0
 /// <summary>
 /// Creates a new StandardForm and passes by reference (efficient)
 /// </summary>
 /// <param name="sf">Form to assign value</param>
 /// <param name="name">Name of form</param>
 public void CreateStandardForm(ref StandardForm sf, string name)
 {
     sf = new StandardForm(InternalWindows, _spriteBatch, _content, name);
     sf.Initialize(_spriteBatch, _content); // Important because UI elements store references to both.
 }