C# Class FontEffectsLib.SpriteTypes.TexturePanel

A Panel which contains a texture.
Inheritance: Panel
显示文件 Open project: GreatMindsRobotics/FontEffectsLib Class Usage Examples

Protected Properties

Property Type Description
_useTintColorInDraw bool

Public Methods

Method Description
Draw ( SpriteBatch spriteBatch ) : void

Draws this TexturePanel to the specified spriteBatch.

SetTextureWithBackground ( Microsoft.Xna.Framework.Graphics.Texture2D image ) : void

Sets the image of this panel to be the specified image rendered on top of a solid background of the tint color.

SetTextureWithBackground ( Microsoft.Xna.Framework.Graphics.Texture2D image, Color background ) : void

Sets the image of this panel to be the specified image rendered on top of a solid background of the specified color.

SetTextureWithBackground ( Microsoft.Xna.Framework.Graphics.Texture2D image, Color backgroundColor, Vector2 imagePos, float imageRotation, Vector2 imageOrigin, Vector2 imageScale, Color imageTintColor ) : void

Sets the image of this panel to be the specified image rendered on top of a solid background of the specified color.

This method is expensive and should be called only when neccesary, such as during load time.

SetTextureWithBackground ( Microsoft.Xna.Framework.Graphics.Texture2D image, Color backgroundColor, bool centerImage ) : void

Sets the image of this panel to be the specified image rendered on top of a solid background of the specified color.

SetTextureWithBackground ( Microsoft.Xna.Framework.Graphics.Texture2D image, bool centerImage ) : void

Sets the image of this panel to be the specified image rendered on top of a solid background of the specified color.

TexturePanel ( Microsoft.Xna.Framework.Graphics.Texture2D image, Vector2 speed, Vector2 position, Color color ) : System

Creates a new panel housing a texture. Panel is the same size as the texture.

TexturePanel ( Microsoft.Xna.Framework.Graphics.Texture2D image, Vector2 size, Vector2 speed, Vector2 position, Color color ) : System

Creates a new panel housing a texture. Panel can be larger than the texture. Texture will be centered on the panel.

Method Details

Draw() public method

Draws this TexturePanel to the specified spriteBatch.
public Draw ( SpriteBatch spriteBatch ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch object to draw to.
return void

SetTextureWithBackground() public method

Sets the image of this panel to be the specified image rendered on top of a solid background of the tint color.
public SetTextureWithBackground ( Microsoft.Xna.Framework.Graphics.Texture2D image ) : void
image Microsoft.Xna.Framework.Graphics.Texture2D The new image.
return void

SetTextureWithBackground() public method

Sets the image of this panel to be the specified image rendered on top of a solid background of the specified color.
public SetTextureWithBackground ( Microsoft.Xna.Framework.Graphics.Texture2D image, Color background ) : void
image Microsoft.Xna.Framework.Graphics.Texture2D The new image.
background Color The background color behind the image.
return void

SetTextureWithBackground() public method

Sets the image of this panel to be the specified image rendered on top of a solid background of the specified color.
This method is expensive and should be called only when neccesary, such as during load time.
public SetTextureWithBackground ( Microsoft.Xna.Framework.Graphics.Texture2D image, Color backgroundColor, Vector2 imagePos, float imageRotation, Vector2 imageOrigin, Vector2 imageScale, Color imageTintColor ) : void
image Microsoft.Xna.Framework.Graphics.Texture2D The new image.
backgroundColor Color The background color behind the image.
imagePos Vector2 The position of the image relative to the background.
imageRotation float The rotation of the image.
imageOrigin Vector2 The origin point of the image.
imageScale Vector2 The scale of the image.
imageTintColor Color The tint color to apply to the image.
return void

SetTextureWithBackground() public method

Sets the image of this panel to be the specified image rendered on top of a solid background of the specified color.
public SetTextureWithBackground ( Microsoft.Xna.Framework.Graphics.Texture2D image, Color backgroundColor, bool centerImage ) : void
image Microsoft.Xna.Framework.Graphics.Texture2D The new image.
backgroundColor Color The background color behind the image.
centerImage bool true to center image on the ; false to set it at Vector2.Zero
return void

SetTextureWithBackground() public method

Sets the image of this panel to be the specified image rendered on top of a solid background of the specified color.
public SetTextureWithBackground ( Microsoft.Xna.Framework.Graphics.Texture2D image, bool centerImage ) : void
image Microsoft.Xna.Framework.Graphics.Texture2D The new image.
centerImage bool true to center image on the ; false to set it at Vector2.Zero
return void

TexturePanel() public method

Creates a new panel housing a texture. Panel is the same size as the texture.
public TexturePanel ( Microsoft.Xna.Framework.Graphics.Texture2D image, Vector2 speed, Vector2 position, Color color ) : System
image Microsoft.Xna.Framework.Graphics.Texture2D The image to display within the panel.
speed Vector2 The speed of expansion and collapsing.
position Vector2 The position of the center of the panel. The panel expands/collapses from/to this point.
color Color The tint color of the panel.
return System

TexturePanel() public method

Creates a new panel housing a texture. Panel can be larger than the texture. Texture will be centered on the panel.
public TexturePanel ( Microsoft.Xna.Framework.Graphics.Texture2D image, Vector2 size, Vector2 speed, Vector2 position, Color color ) : System
image Microsoft.Xna.Framework.Graphics.Texture2D The image to display within the panel.
size Vector2 Panel size. Must be same size or larger than the texture it is housing.
speed Vector2 The speed of expansion and collapsing.
position Vector2 The position of the center of the panel. The panel expands/collapses from/to this point.
color Color The tint color of the panel.
return System

Property Details

_useTintColorInDraw protected_oe property

If SetTextureWithBackground method is called, then Draw method should not use the specified TintColor, to avoid "double-tinting"
protected bool _useTintColorInDraw
return bool