コード例 #1
0
 public Donuroid(
     float xpos,
     float ypos,
     SpriteMap image,
     int frame,
     Depth depth,
     float scale)
 {
     this._image    = image;
     this._frame    = frame;
     this._depth    = depth;
     this._scale    = scale;
     this._position = new Vec2(xpos, ypos);
     this._sin      = Rando.Float(8f);
 }
コード例 #2
0
        public override void Draw(float x, float y, Depth depth)
        {
            if (this._team == null)
            {
                return;
            }
            y -= 9f;
            float x1 = x;
            float y1 = y + 8f;

            this._persona.sprite.depth = depth;
            this._persona.sprite.color = Color.White;
            DuckGame.Graphics.Draw(this._persona.sprite, 0, x1, y1);
            this._persona.armSprite.frame = this._persona.sprite.imageIndex;
            this._persona.armSprite.scale = new Vec2(1f, 1f);
            this._persona.armSprite.depth = depth + 4;
            DuckGame.Graphics.Draw((Sprite)this._persona.armSprite, x1 - 3f, y1 + 6f);
            Vec2 hatPoint = DuckRig.GetHatPoint(this._persona.sprite.imageIndex);

            this._team.hat.depth  = depth + 2;
            this._team.hat.center = new Vec2(16f, 16f) + this._team.hatOffset;
            DuckGame.Graphics.Draw(this._team.hat, this._team.hat.frame, x1 + hatPoint.x, y1 + hatPoint.y);
            if (this._team.hat.texture.textureName == "hats/devhat" && this._cape == null)
            {
                this._hat  = new TeamHat(x1 + hatPoint.x, (float)((double)y1 + (double)hatPoint.y + 5.0), Teams.GetTeam("CAPTAIN"));
                this._cape = new Cape(x1 + hatPoint.x, y1 + hatPoint.y, (PhysicsObject)this._hat);
            }
            if (this._team.hat.texture.textureName == "hats/moonwalker" && this._cape == null)
            {
                this._hat  = new TeamHat(x1 + hatPoint.x, (float)((double)y1 + (double)hatPoint.y + 5.0), Teams.GetTeam("MOONWALK"));
                this._cape = new Cape(x1 + hatPoint.x, y1 + hatPoint.y, (PhysicsObject)this._hat);
                this._cape.SetCapeTexture((Texture2D)Content.Load <Tex2D>("hats/moonCape"));
            }
            if (this._team.hat.texture.textureName == "hats/royalty" && this._cape == null)
            {
                this._hat  = new TeamHat(x1 + hatPoint.x, (float)((double)y1 + (double)hatPoint.y + 5.0), Teams.GetTeam("MAJESTY"));
                this._cape = new Cape(x1 + hatPoint.x, y1 + hatPoint.y, (PhysicsObject)this._hat);
                this._cape.SetCapeTexture((Texture2D)Content.Load <Tex2D>("hats/royalCape"));
            }
            if (this._cape == null)
            {
                return;
            }
            this._hat.position = new Vec2(x1 + hatPoint.x, (float)((double)y1 + (double)hatPoint.y + 5.0));
            this._cape.depth   = depth + 2;
            this._cape.Update();
            this._cape.Draw();
        }
コード例 #3
0
 public virtual void Draw(float xpos, float ypos, Depth depth)
 {
 }
コード例 #4
0
ファイル: Sword.cs プロジェクト: Andresian/DuckStuff
        // Token: 0x06000CCB RID: 3275
        public override void Draw()
        {
            Sword._playedShing = false;
            if (this._swordSwing.speed > 0f)
            {
                if (base.duck != null)
                {
                    this._swordSwing.flipH = (base.duck.offDir <= 0);
                }
                this._swordSwing.alpha    = 0.4f;
                this._swordSwing.position = this.position;
                this._swordSwing.depth    = base.depth + 1;
                this._swordSwing.Draw();
            }
            base.alpha = 1f;
            Vec2  pos = this.position;
            Depth d   = base.depth;

            this.graphic.color = Color.White;
            if ((this.owner == null && base.velocity.length > 1f) || this._swing != 0f)
            {
                float rlAngle = this.angle;
                this._drawing = true;
                float a = this._angle;
                this.angle = rlAngle;
                for (int i = 0; i < 7; i++)
                {
                    base.Draw();
                    if (this._lastAngles.Count > i)
                    {
                        this._angle = this._lastAngles[i];
                    }
                    if (this._lastPositions.Count <= i)
                    {
                        break;
                    }
                    this.position = this._lastPositions[i];
                    if (this.owner != null)
                    {
                        this.position += this.owner.velocity;
                    }
                    base.depth        -= 2;
                    base.alpha        -= 0.15f;
                    this.graphic.color = Color.Red;
                }
                this.position = pos;
                base.depth    = d;
                base.alpha    = 1f;
                this._angle   = a;
                base.xscale   = 1f;
                this._drawing = false;
            }
            else
            {
                base.Draw();
            }
            this._lastAngles.Insert(0, this.angle);
            this._lastPositions.Insert(0, this.position);
            if (this._lastAngles.Count > 2)
            {
                this._lastAngles.Insert(0, (this._lastAngles[0] + this._lastAngles[2]) / 2f);
                this._lastPositions.Insert(0, (this._lastPositions[0] + this._lastPositions[2]) / 2f);
            }
            if (this._lastAngles.Count > 8)
            {
                this._lastAngles.RemoveAt(this._lastAngles.Count - 1);
            }
            if (this._lastPositions.Count > 8)
            {
                this._lastPositions.RemoveAt(this._lastPositions.Count - 1);
            }
        }
コード例 #5
0
 public override void Draw(float x, float y, Depth depth)
 {
 }
コード例 #6
0
        public void Draw(
            Vec2 pos,
            Depth depth,
            int variation    = 0,
            ulong seed       = 0,
            bool affectScale = false,
            bool halfscale   = false,
            float angle      = 0.0f)
        {
            if (seed == 0UL && Profiles.experienceProfile != null)
            {
                seed = Profiles.experienceProfile.steamID;
            }
            SpriteMap spriteMap = this.sprite;

            if (this.icon != null)
            {
                spriteMap = this.icon;
            }
            if (spriteMap != null && this.neverFlip)
            {
                spriteMap.flipH = false;
            }
            if (this.name == "EGG")
            {
                VariatingSprite sprite = this.GetSprite(seed, variation, VSType.Egg);
                if (sprite != null)
                {
                    if (sprite.sprite.texture != null)
                    {
                        sprite.sprite.depth = depth + 6;
                        sprite.sprite.scale = this.sprite.scale;
                        DuckGame.Graphics.Draw(sprite.sprite, pos.x - 8f * sprite.sprite.xscale, pos.y - 12f * sprite.sprite.yscale);
                        spriteMap.frame = 0;
                    }
                    if ((sprite.sprite.renderTexture.nativeObject as Microsoft.Xna.Framework.Graphics.RenderTarget2D).IsContentLost)
                    {
                        this._eggSprites.Remove(sprite);
                    }
                }
            }
            else if (this.name == "PHOTO")
            {
                if (this._photoSprite == null)
                {
                    this._photoSprite = new SpriteMap("littleMan", 16, 16);
                }
                this._photoSprite.frame = UILevelBox.LittleManFrame(variation, 7, seed);
                this._photoSprite.depth = depth + 6;
                this._photoSprite.scale = this.sprite.scale;
                DuckGame.Graphics.Draw((Sprite)this._photoSprite, pos.x - 6f * this._photoSprite.xscale, pos.y - 4f * this._photoSprite.yscale, new Rectangle(2f, 0.0f, 12f, 10f));
                DuckGame.Graphics.DrawRect(pos + new Vec2(-6f * this._photoSprite.xscale, -6f * this._photoSprite.yscale), pos + new Vec2(6f * this._photoSprite.xscale, 6f * this._photoSprite.yscale), Colors.DGBlue, depth - 4);
                spriteMap.frame = 0;
            }
            else if (this.name == "EASEL")
            {
                VariatingSprite sprite = this.GetSprite(seed, variation, VSType.Portrait);
                if (sprite != null)
                {
                    sprite.sprite.depth = depth + 6;
                    sprite.sprite.scale = this.sprite.scale;
                    DuckGame.Graphics.Draw(sprite.sprite, pos.x - 9f * sprite.sprite.xscale, pos.y - 8f * sprite.sprite.yscale);
                    spriteMap.frame = 0;
                    if ((sprite.sprite.renderTexture.nativeObject as Microsoft.Xna.Framework.Graphics.RenderTarget2D).IsContentLost)
                    {
                        this._eggSprites.Remove(sprite);
                    }
                }
            }
            else
            {
                spriteMap.frame = variation;
            }
            if (this.font != null && this.sprite == null)
            {
                this.font.scale = new Vec2(1f, 1f);
                this.font.Draw("F", pos + new Vec2(-3.5f, -3f), Color.Black, depth + 8);
            }
            if (affectScale)
            {
                if (halfscale && (spriteMap.width > 30 || spriteMap.height > 30))
                {
                    spriteMap.scale = new Vec2(0.5f);
                }
                else
                {
                    spriteMap.scale = new Vec2(1f);
                }
            }
            spriteMap.depth = depth;
            spriteMap.angle = angle;
            DuckGame.Graphics.Draw((Sprite)spriteMap, pos.x, pos.y);
        }