当前位置: 首页>>代码示例>>C#>>正文


C# Graphics.Texture类代码示例

本文整理汇总了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;
 }
开发者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


注:本文中的Microsoft.Xna.Framework.Graphics.Texture类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。