Example #1
0
    void Start ()
	{
        //Dependency "PlayerVariables", "GridVariables"
		playerVar = GetComponent<PlayerVariables> ();
        gridVar = GetComponent<GridVariables>();

        //Dependency "Player Sprite"
        playerAnimation = playerSprite.GetComponent<JensAnimationController>();
        playerSize = playerSprite.GetComponent<SpriteSize>();

        audioManager = GetComponent<AudioManager>();

        aud = GetComponent<AudioSource>();
        playerCollider = GetComponent<Collider2D>();
	}
        public static Vector2 GetSpriteSize(SpriteSize spriteSize)
        {
            switch (spriteSize)
            {
            case SpriteSize.OBJ_SIZE_16X16:
                return(new Vector2(16f, 16f));

            case SpriteSize.OBJ_SIZE_32X32:
                return(new Vector2(32f, 32f));

            case SpriteSize.OBJ_SIZE_64X64:
                return(new Vector2(64f, 64f));

            default:
                return(new Vector2(32f, 32f));
            }
        }
 internal BitmapBlockBase(BinaryReader binaryReader)
 {
     this.type                    = (Type)binaryReader.ReadInt16();
     this.format                  = (Format)binaryReader.ReadInt16();
     this.usage                   = (Usage)binaryReader.ReadInt16();
     this.flags                   = (Flags)binaryReader.ReadInt16();
     this.detailFadeFactor01      = binaryReader.ReadSingle();
     this.sharpenAmount01         = binaryReader.ReadSingle();
     this.bumpHeightRepeats       = binaryReader.ReadSingle();
     this.spriteSize              = (SpriteSize)binaryReader.ReadInt16();
     this.eMPTYSTRING             = binaryReader.ReadInt16();
     this.colorPlateWidthPixels   = binaryReader.ReadInt16();
     this.colorPlateHeightPixels  = binaryReader.ReadInt16();
     this.data                    = binaryReader.ReadBytes(8);
     this.data0                   = binaryReader.ReadBytes(8);
     this.blurFilterSize010Pixels = binaryReader.ReadSingle();
     this.alphaBias11             = binaryReader.ReadSingle();
     this.mipmapCountLevels       = binaryReader.ReadInt16();
     this.spriteUsage             = (SpriteUsage)binaryReader.ReadInt16();
     this.spriteSpacing           = binaryReader.ReadInt16();
     this.forceFormat             = (ForceFormat)binaryReader.ReadInt16();
     this.sequences               = ReadBitmapGroupSequenceBlockArray(binaryReader);
     this.bitmaps                 = ReadBitmapDataBlockArray(binaryReader);
 }
Example #4
0
 public SpriteSizeAttribute(SpriteSize spriteSize)
 {
     this.size = (int)spriteSize;
 }
Example #5
0
 public override void OnDraw(SpriteBatch sprite, GameTime gameTime)
 {
     if (SpriteSize == Vector2.Zero)
     {
         sprite.Draw(Texture, AbsolutePosition, null, Color, 0, Vector2.Zero, Scale, SpriteEffects.None, 0);
         return;
     }
     sprite.Draw(Texture, AbsolutePosition, new Rectangle(SpriteOrigin.ToPoint(), SpriteSize.ToPoint()), Color, 0, Vector2.Zero, Scale, SpriteEffects.None, 0);
 }