コード例 #1
0
        /// <summary>
        /// Creates a basic container with no initial effects.
        /// </summary>
        /// <param name="fontAsset">The name of the SpriteFont file used to load the font.</param>
        public TextContainer(string fontAsset)
        {
            asset = fontAsset;

            text    = new List <TextType>();
            effects = new StoryboardType();
        }
コード例 #2
0
        public GraphicsContainer(string graphicAsset)
        {
            asset = graphicAsset;

            graphics = new List <GraphicType>();
            effects  = new StoryboardType();
        }
コード例 #3
0
        public GraphicType(string textureAsset, Vector2 location, bool draw)
        {
            asset       = textureAsset;
            position    = location;
            drawGraphic = draw;

            effects  = new StoryboardType();
            color    = Color.White;
            origin   = new Vector2();
            scale    = 1f;
            rotation = 0f;
        }
コード例 #4
0
        public GraphicType(Texture2D texture, Vector2 location, Color tint, StoryboardType newEffects)
        {
            graphic  = texture;
            position = location;
            color    = tint;
            effects  = newEffects;

            drawGraphic = true;
            origin      = new Vector2();
            scale       = 1f;
            rotation    = 0f;
        }
コード例 #5
0
        public GraphicsContainer(GraphicsDevice graphicsDevice, int textureWidth, int textureHeight, Color textureColor, IEffect effect)
        {
            effects = new StoryboardType();

            effects.addEffect(effect);

            color = textureColor;
            array = new Color[textureWidth * textureHeight];

            graphic  = new Texture2D(graphicsDevice, textureWidth, textureHeight);
            graphics = new List <GraphicType>();
        }
コード例 #6
0
ファイル: TextType.cs プロジェクト: romeguarin/XNAZuneGames
        /// <summary>
        /// Creates a text-based object to display as part of the HUD.
        /// </summary>
        /// <param name="fontAsset">The name of the SpriteFont file to load the font from.</param>
        /// <param name="displayText">The text to display.</param>
        /// <param name="textVector">The position within the HUD to display from.</param>
        /// <param name="textColor">The text's color.</param>
        /// <param name="isVisibleConstantly">Allows the object to be visible even when the effects are not running.  Otherwise,
        /// the object will only be visible when the effects are running.</param>
        public TextType(string fontAsset, string displayText, Vector2 textVector, Color textColor, bool isVisibleConstantly)
        {
            asset    = fontAsset;
            text     = displayText;
            vector   = textVector;
            color    = textColor;
            effects  = new StoryboardType();
            drawText = isVisibleConstantly;

            rotation = 0;
            scale    = 1;
            origin   = new Vector2();
        }
コード例 #7
0
        public GraphicType(GraphicsDevice graphics, int textureWidth, int textureHeight, Vector2 location, Color textureColor, bool draw)
        {
            width       = textureWidth;
            height      = textureHeight;
            position    = location;
            color       = textureColor;
            drawGraphic = draw;

            graphic  = new Texture2D(graphics, width, height);
            effects  = new StoryboardType();
            origin   = new Vector2();
            scale    = 1f;
            rotation = 0f;
        }
コード例 #8
0
ファイル: TextType.cs プロジェクト: romeguarin/XNAZuneGames
 /// <summary>
 /// Creates a text-based object to display as part of the HUD.
 /// </summary>
 /// <param name="font">The SpriteFont to draw the text with.</param>
 /// <param name="displayText">The text to display.</param>
 /// <param name="textVector">The position within the HUD to display from.</param>
 /// <param name="textColor">The text's color.</param>
 /// <param name="timeline">The storyboard of effects to run.</param>
 public TextType(SpriteFont textFont, string displayText, Vector2 textVector, Color textColor, StoryboardType timeline)
     : this("", displayText, textVector, textColor, true)
 {
     effects = timeline;
     font    = textFont;
 }