示例#1
0
 public MyController(MyTank tank)
 {
     this.tank = tank;
     this.TargetMarker = null;
     this.noise = new SoundClip("Noise");
     noise.AddTrack(new SoundEffectTrack("media/Sound-LoopNoise.wav"));
 }
示例#2
0
        public static Node Create(Vector3 pos)
        {
            var cmp = new MyComponent ();

            var spr = new Sprite (480, 300);
            spr.AddTexture (new Texture ("media/Vanity.jpg"));
            spr.AddTexture (new Texture ("media/Tanks.png"));
            spr.AddTexture (new Texture ("media/TatamiRoom.png"));
            spr.AutoScale = true;

            Console.WriteLine ("tex = " + spr.GetTexture (0));
            Console.WriteLine ("spr = " + spr);

            var col = new CollisionObject();
            col.Shape  = new BoxShape(spr.Width/2, spr.Height/2, 100);
            col.SetOffset (spr.Width/2, spr.Height/2, 0);

            var ctr = new AnimationController ();

            var node = new Node ();
            node.Attach (cmp);
            node.Attach (spr);
            node.Attach (col);
            node.Attach (ctr);

            node.Translation = pos;

            var clip = new SoundClip ("Sound");
            clip.AddTrack (new SoundEffectTrack ("media/PinPon.wav"));

            node.UserData.Add (clip.Name, clip);

            return node;
        }
示例#3
0
        public static Node Create(Vector3 pos)
        {
            var name = "GameClear";
            var cmp = new MyGameClear ();

            var spr = new Sprite (200, 160);
            spr.AddTexture (new Texture ("media/GameClear.png"));

            var clip = new SoundClip ("SoundClip");
            clip.AddTrack (new SoundEffectTrack ("media/Announce.ogg"));
            clip.Volume = 0.3f;

            var mbox = new MailBox (name);

            var node = new Node (name);
            node.Attach (cmp);
            node.Attach (spr);
            node.Attach(mbox);
            node.UserData.Add (clip.Name, clip);

            node.Drawable = false;
            node.Translation = pos;

            return node;
        }
示例#4
0
文件: MyBGM.cs 项目: weimingtom/erica
        public static Node Create()
        {
            var clip = new SoundClip ("BattleScene");
            clip.AddTrack(new MusicTrack("media/BGM-BattleScene.ogg"));
            clip.Play ();
            clip.Volume = 0.5f;

            var ply = new SoundPlayer ();
            ply.AddClip (clip);

            var node = new Node ("BGM");
            node.Attach (ply);

            return node;
        }
示例#5
0
        public static World Create()
        {
            var cmp = new MyWorld ();

            var spr = new Sprite (new Texture ("media/DarkGalaxy.jpg"));

            var clip = new SoundClip ();
            clip.AddTrack (new MusicTrack ("media/BGM(Field04).ogg"));
            clip.Play ();
            clip.Volume = 0.3f;

            var wld = new World ("First Script");
            wld.Attach (cmp);
            wld.Attach (spr);
            wld.UserData.Add (clip.Name, clip);

            wld.DrawPriority = 127;

            return wld;
        }
示例#6
0
        public static Node Create(string name, Vector3 pos)
        {
            var cmp = new MyCharacterButton (name);

            var spr = new Sprite (128, 64);
            spr.AddTexture (Resource.GetDefaultTexture ());

            var label1 = new Label ();
            label1.Text = cmp.dbCharacter.FullName;
            label1.SetOffset (10, 10);
            label1.Color = Color.Black;

            var label2 = new Label ();
            label2.Text = cmp.dbCharacter.FullNameYomi;
            label2.SetOffset (10, 30);
            label2.Color = Color.Black;

            var col = new CollisionObject ();
            col.Shape = new BoxShape (64, 32, 100);
            col.SetOffset (64, 32, 0);

            var snd = new SoundEffectTrack ("media/PinPon.wav");
            var clip = new SoundClip ("クリック音");
            clip.AddTrack (snd);

            var node = new Node ("Button(" + name + ")");
            node.Attach (cmp);
            node.Attach (spr);
            node.Attach (label1);
            node.Attach (label2);
            node.Attach (col);

            node.UserData.Add (clip.Name, clip);

            node.Translation = pos;
            node.DrawPriority = -1;

            return node;
        }