Beispiel #1
0
        public override DataObject Copy(Sprite parent)
        {
            SetCostumeBrick newBrick = new SetCostumeBrick(parent);
              if (costumeReference != null)
            newBrick.costumeReference = costumeReference.Copy(parent) as CostumeReference;

              return newBrick;
        }
        private void initCurrentProject()
        {
            var project = new Project
                {
                    ApplicationVersionCode = 1,
                    ApplicationVersionName = "Version 1",
                    DeviceName = "Device1",
                    ProjectName = "Project1",
                    ScreenHeight = 800,
                    ScreenWidth = 480,
                    PlatformVersion = "7.1.1",
                    Platform = "Windows Phone 7.5"
                };

            // TODO: implement other design data here

            var sprites = new SpriteList(project);
            var sprite = new Sprite(project);
            sprite.Name = "Object 1";

            sprite.Costumes = new CostumeList(sprite);
            var costume = new Costume("Cat", sprite);
            var image = new byte[0]; //new BitmapImage(new Uri(costume.FileName, UriKind.Relative)); // TODO: fix me
            //costume.Image = image;
            sprite.Costumes.Costumes.Add(costume);

            sprite.Sounds = new SoundList(sprite);
            var sound = new Sound("Miau_Sound", sprite);
            sprite.Sounds.Sounds.Add(sound);

            sprite.Scripts = new ScriptList(sprite);
            Script startScript = new StartScript(sprite);

            startScript.Bricks = new BrickList(sprite);
            var setCostumeBrick = new SetCostumeBrick(sprite);
            var costumeRef = new CostumeReference(sprite);
            costumeRef.Costume = costume;
            //setCostumeBrick.Costume = costumeRef;

            //TODO: Add more Bricks if you need them

            sprites.Sprites.Add(sprite);

            currentProject = project;
        }