本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.Texture类的典型用法代码示例。如果您正苦于以下问题:C# Texture类的具体用法?C# Texture怎么用?C# Texture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Texture类属于Microsoft.Xna.Framework.Graphics命名空间,在下文中一共展示了Texture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RenderTargetBinding
public RenderTargetBinding(RenderTarget2D renderTarget)
{
if (renderTarget == null)
throw new ArgumentNullException("renderTarget");
this._renderTarget = (Texture) renderTarget;
this.isTargetCube = false;
}
开发者ID:tanis2000,项目名称:FEZ,代码行数:7,代码来源:RenderTargetBinding.cs
示例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;
}
开发者ID:DuckDefense,项目名称:duck,代码行数:7,代码来源:ContentLoader.cs
示例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);
}
开发者ID:Gaopest,项目名称:fightclub,代码行数:7,代码来源:SceneObjTexBlock.cs
示例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));
}
开发者ID:tanis2000,项目名称:FEZ,代码行数:30,代码来源:ScreenFade.cs
示例5: RenderTargetBinding
public RenderTargetBinding(RenderTarget2D renderTarget)
{
if (renderTarget == null)
throw new ArgumentNullException("renderTarget");
this._renderTarget = (Texture) renderTarget;
this._cubeMapFace = CubeMapFace.PositiveX;
}
开发者ID:Zeludon,项目名称:FEZ,代码行数:7,代码来源:RenderTargetBinding.cs
示例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");
}
开发者ID:doanhtdpl,项目名称:naughty-invaders,代码行数:30,代码来源:Player.cs
示例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;
}
开发者ID:Jh87S,项目名称:TLN,代码行数:7,代码来源:Munitions.cs
示例8: GUIElement
public GUIElement(Vector2 min, Vector2 max, Texture image, Vector4 color)
{
Color = color;
ScaleOffset = Vector4.Zero;
Image = image;
SetDimensions(min, max);
}
开发者ID:MattVitelli,项目名称:IslandAdventure,代码行数:7,代码来源:GUIElementManager.cs
示例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;
}
开发者ID:Gaopest,项目名称:fightclub,代码行数:8,代码来源:SceneObjTex.cs
示例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);
}
开发者ID:MattVitelli,项目名称:Nosferatu,代码行数:8,代码来源:GUIElementManager.cs
示例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);
}
开发者ID:jalgamestudios,项目名称:FataMirage,代码行数:8,代码来源:ParticleHost.cs
示例12: LoadContent
public void LoadContent()
{
if (!String.IsNullOrEmpty(_fileName))
{
_baseTexture = EngineManager.Game.Content.Load<Texture>(_fileName);
_readyToRender = true;
}
}
开发者ID:trew,项目名称:PoorJetX,代码行数:8,代码来源:PoorTexture.cs
示例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);
}
开发者ID:MattVitelli,项目名称:IslandAdventure,代码行数:8,代码来源:GUIElementManager.cs
示例14: BillboardRenderComponent
public BillboardRenderComponent(Actor owner)
: base(owner)
{
Effect = null;
mDepthOnlyEffect = null;
mTexture = null;
mGeometry = null;
mCurrentTime = 0.0f;
}
开发者ID:Tengato,项目名称:Mechadrone1,代码行数:9,代码来源:BillboardRenderComponent.cs
示例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;
}
开发者ID:tanis2000,项目名称:FEZ,代码行数:14,代码来源:ScreenFade.cs
示例16: Initialize
public void Initialize(Player player, Texture2D textura, Texture texturaFrameProyectil, float daño, Vector2 pos, Vector2 incremento, Colision colision)
{
_player = player;
_textura = textura;
_daño = (int)daño;
_pos = pos;
_colision = colision;
_incremento = incremento;
//Datos de color de la textura
_texturaFrame = textura;
textureData = new Color[_texturaFrame.Width * _texturaFrame.Height];
_texturaFrame.GetData(textureData);
}
开发者ID:shadowlink,项目名称:BattleTank,代码行数:14,代码来源:Proyectil.cs
示例17: Initialize
public override void Initialize(ContentManager contentLoader, ComponentManifest manifest)
{
Effect genericEffect = contentLoader.Load<Effect>("shaders\\PhongShadow");
// If we have several of these objects, the content manager will return
// a single shared effect instance to them all. But we want to preconfigure
// the effect with parameters that are specific to this particular
// object. By cloning the effect, we prevent one
// from stomping over the parameter settings of another.
Effect = genericEffect.Clone();
mTexture = contentLoader.Load<Texture>((string)(manifest.Properties[ManifestKeys.TEXTURE]));
base.Initialize(contentLoader, manifest);
}
开发者ID:Tengato,项目名称:Mechadrone1,代码行数:15,代码来源:ShapeRenderComponent.cs
示例18: QuadTree
public QuadTree(Game game, Vector3 position, Matrix view, Matrix projection)
{
this.graphicsDevice = game.GraphicsDevice;
this.position = position;
effect = game.Content.Load<Effect>("Multitexture");
sand = game.Content.Load<Texture>("Dirt cracked 00 seamless");
grass = game.Content.Load<Texture>("grass0026_1_l2");
rock = game.Content.Load<Texture>("Tileable stone texture (2)");
snow = game.Content.Load<Texture>("snow");
View = view;
Projection = projection;
InitializeEffect();
}
开发者ID:elkorn,项目名称:Tanks3DFPP,代码行数:15,代码来源:QuadTree.cs
示例19: DrawVertices
public override void DrawVertices(VerticesMode mode, VertexPositionColorTextured[] vertices)
{
CheckCreatePositionColorTextureBuffer();
positionColorUvVertexBuffer.SetData(vertices, 0, vertices.Length, SetDataOptions.Discard);
BindVertexBuffer(positionColorUvVertexBuffer);
if (lastTexture != device.NativeDevice.Textures[0])
{
ApplyEffect(true);
lastTexture = device.NativeDevice.Textures[0];
}
if (lastIndicesCount == -1)
DoDraw(mode, vertices.Length);
else
DoDrawIndexed(mode, vertices.Length, lastIndicesCount);
}
开发者ID:hillwhite,项目名称:DeltaEngine,代码行数:15,代码来源:XnaDrawing.cs
示例20: Run
/// <summary>
/// This is called after the scene has been rendered to actually perform the post processing effect.
/// The base implementation simply calls SceneRenderer.RenderManager.RenderQuad, passing it the
/// material, position, and size to use for rendering.
/// </summary>
/// <param name="texture">The texture containing the rendered scene.</param>
/// <param name="position">The position on the screen to render at.</param>
/// <param name="size">The size of the quad to render.</param>
public virtual void Run(Texture texture, Vector2 position, Vector2 size)
{
if (_material == null)
{
TorqueConsole.Warn("\nPostProcessor.Run - Cannot perform post processing. No material.");
return;
}
GFXDevice.Instance.Device.RenderState.AlphaBlendEnable = false;
_material.Texture = texture;
SceneRenderer.RenderManager.RenderQuad(_material, position, size);
GFXDevice.Instance.Device.RenderState.AlphaBlendEnable = true;
}
开发者ID:andrewstrauch,项目名称:The-Scarab-Gauntlet,代码行数:23,代码来源:PostProcessor.cs
注:本文中的Microsoft.Xna.Framework.Graphics.Texture类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论