本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.Texture类的典型用法代码示例。如果您正苦于以下问题:C# Texture类的具体用法?C# Texture怎么用?C# Texture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Texture类属于Microsoft.Xna.Framework.Graphics命名空间,在下文中一共展示了Texture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderTargetBinding
public RenderTargetBinding(RenderTarget2D renderTarget)
{
if (renderTarget == null)
throw new ArgumentNullException("renderTarget");
this._renderTarget = (Texture) renderTarget;
this.isTargetCube = false;
}
示例2: GetIdFromCharacterWorldTexture
public static int GetIdFromCharacterWorldTexture(Texture tex)
{
if (tex == MCGirlWorld) return 1;
if (tex == MCBoyWorld) return 2;
if (tex == ChristmanWorld) return 3;
return 0;
}
示例3: InitWithTextureBlock
public void InitWithTextureBlock(Texture.TexturePacket.TextureBlock tb)
{
block = tb;
seedsize.X = (float)tb.parent.texture.Width * tb.uv.Width;
seedsize.Y = (float)tb.parent.texture.Height * tb.uv.Height;
seedorient = new Vector2(0, 0);
}
示例4: Draw
public override void Draw(GameTime gameTime)
{
if (this.RtHandle != null && this.TargetRenderer.IsHooked(this.RtHandle.Target))
{
this.TargetRenderer.Resolve(this.RtHandle.Target, false);
this.capturedScreen = (Texture) this.RtHandle.Target;
if (this.ScreenCaptured != null)
this.ScreenCaptured();
}
GraphicsDeviceExtensions.PrepareStencilRead(this.GraphicsDevice, CompareFunction.Always, StencilMask.None);
if (this.capturedScreen != null)
{
SettingsManager.SetupViewport(this.GraphicsDevice, false);
this.TargetRenderer.DrawFullscreen(this.capturedScreen);
}
this.Elapsed += gameTime.ElapsedGameTime;
float num = (float) this.Elapsed.TotalSeconds / this.Duration;
float amount = FezMath.Saturate(this.EaseOut ? Easing.EaseOut((double) num, this.EasingType) : Easing.EaseIn((double) num, this.EasingType));
if ((double) amount == 1.0 && (this.WaitUntil == null || this.WaitUntil()))
{
if (this.Faded != null)
{
this.Faded();
this.Faded = (Action) null;
}
this.WaitUntil = (Func<bool>) null;
ServiceHelper.RemoveComponent<ScreenFade>(this);
}
this.TargetRenderer.DrawFullscreen(Color.Lerp(this.FromColor, this.ToColor, amount));
}
示例5: RenderTargetBinding
public RenderTargetBinding(RenderTarget2D renderTarget)
{
if (renderTarget == null)
throw new ArgumentNullException("renderTarget");
this._renderTarget = (Texture) renderTarget;
this._cubeMapFace = CubeMapFace.PositiveX;
}
示例6: Player
public Player( GamerEntity owner, string entityName, Vector3 position, float orientation)
: base("characters", entityName, position, orientation, Color.White, 0)
{
this.owner = owner;
entityState = tEntityState.Active;
setCollisions();
// life stuff
initializeLifeStuff();
// actions stuff
fastShotCooldownTime = 0.0f;
dashCooldownTime = 0.0f;
dashVelocity = Vector2.Zero;
dashParticleTimer = 0.0f;
bigShotChargeTimer = 0.0f;
bigShotCharging = false;
bigShotCooldownTime = 0.0f;
mode = tMode.Arcade;
if (bigShotBall == null) bigShotBall = TextureManager.Instance.getTexture("projectiles/bigShotPlayer");
if (starXP == null) starXP = TextureManager.Instance.getTexture("GUI/menu/starXP");
if (garlicGunTexture == null) garlicGunTexture = TextureManager.Instance.getTexture("characters/garlicGun");
if (garlicGunBandTexture == null) garlicGunBandTexture = TextureManager.Instance.getTexture("characters/garlicGunBand");
if (wishLife == null) wishLife = TextureManager.Instance.getTexture("GUI/ingame/wishLife");
if (wishLifePortion == null) wishLifePortion = TextureManager.Instance.getTexture("GUI/ingame/wishLifePortion");
if (wishLifePortionEmpty == null) wishLifePortionEmpty = TextureManager.Instance.getTexture("GUI/ingame/wishLifePortionEmpty");
}
示例7: Munitions
public Munitions(Rectangle position, Texture2D texture, Direction direction, int spriteWidth, int spriteHeigth)
: base(PlayerType.Munition, spriteWidth, spriteHeigth)
{
this.Hitbox = position;
this.texture = texture;
this.Direction = direction;
}
示例8: GUIElement
public GUIElement(Vector2 min, Vector2 max, Texture image, Vector4 color)
{
Color = color;
ScaleOffset = Vector4.Zero;
Image = image;
SetDimensions(min, max);
}
示例9: InitWithSeed
public void InitWithSeed(Seed seed, Texture.TextureMgr tmgr)
{
var block = tmgr.GetTexture(seed.texname);
tex = block.parent.texture;
srcuv = block.uv;
seedsize = seed.size;
seedorient = seed.orient;
}
示例10: GUIElement
public GUIElement(Vector2 min, Vector2 max, Texture image, Vector3 color)
{
Color = new Vector4(color,1.0f);
ScaleOffset = Vector4.Zero;
Image = image;
UseAlphaOnly = false;
SetDimensions(min, max);
}
示例11: Init
public static void Init()
{
Color[] colors = new Color[1];
colors[0] = new Color(255, 255, 255, 255);
Texture2D tempTexture = new Texture2D(Stator.device, 1, 1, false, SurfaceFormat.Color);
tempTexture.SetData(colors);
particleTexture = new Graphics.Texture("#ParticleTexture", tempTexture);
}
示例12: LoadContent
public void LoadContent()
{
if (!String.IsNullOrEmpty(_fileName))
{
_baseTexture = EngineManager.Game.Content.Load<Texture>(_fileName);
_readyToRender = true;
}
}
示例13: GUIElementTC
public GUIElementTC(Vector2 min, Vector2 max, Texture image, Vector2 minTC, Vector2 maxTC)
{
Color = Vector4.One;
ScaleOffset = Vector4.Zero;
TCMinMax = new Vector4(minTC.X, minTC.Y, maxTC.X, maxTC.Y);
Image = image;
SetDimensions(min, max);
}
示例14: BillboardRenderComponent
public BillboardRenderComponent(Actor owner)
: base(owner)
{
Effect = null;
mDepthOnlyEffect = null;
mTexture = null;
mGeometry = null;
mCurrentTime = 0.0f;
}
示例15: Dispose
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (this.RtHandle != null)
{
this.TargetRenderer.ReturnTarget(this.RtHandle);
this.RtHandle = (RenderTargetHandle) null;
}
this.Faded = (Action) null;
this.ScreenCaptured = (Action) null;
this.WaitUntil = (Func<bool>) null;
this.capturedScreen = (Texture) null;
this.IsDisposed = true;
}