예제 #1
0
        public Bullet(Vector2 pos)
        {
            sprite = new SpriteUV();

            if (texInfo == null)
            {
                texInfo = new TextureInfo ("/Application/assets/bubble.png");
                //texInfo = new TextureInfo(AssetManager.GetTexture("bubble"), new Vector2i(4,1),TRS.Quad0_1);
            }

            if (spriteList == null)
            {
                spriteList = new SpriteList(texInfo);
                spriteList.Position = new Vector2(0.0f,0.0f);
            }

            spriteList.AddChild(sprite);
            sprite.Quad.S = texInfo.TextureSizef; // map 1:1 on screen -- necessary? !!!\
            sprite.RunAction(new ScaleTo(new Vector2(0.15f,0.15f),0.0f));

            sprite.GetContentWorldBounds(ref boundingBox);
            boundingBox = new Bounds2(pos, new Vector2(38,38));
            //sprite.CenterSprite();
            sprite.Position = pos;
            sprite.Schedule((dt) => Update());
        }