示例#1
0
        public AnimationsPage()
        {
            InitializeComponent();

            AnimationExtensionButton.Clicked += async(sender, args) =>
            {
                await AnimationBox.Animate(new HeartAnimation());
            };
        }
示例#2
0
        public XamanimationPage()
        {
            InitializeComponent();

            AnimationExtensionButton.Clicked += (sender, args) =>
            {
                AnimationBox.Animate(new HeartAnimation());
            };
        }
示例#3
0
    public void addAnimationToList(GameObject prefab)
    {
        Vector3      pos = new Vector3(0, 0, 0);
        GameObject   go  = new GameObject("AnimationBox");
        AnimationBox box = go.AddComponent <AnimationBox>();

        box.init(prefab, pos);
        _bdElemList.Add(go);
    }
示例#4
0
    public void addActionAnimationToList(int charNumber, int actionId, int sucessId, string textAssociated = "")
    {
        Vector3      pos = new Vector3(0, 0, 0);
        GameObject   go  = new GameObject("ActionAnimation-" + charNumber + "-" + actionId + "-" + sucessId);
        AnimationBox box = go.AddComponent <AnimationBox>();

        box.initAction(charNumber, actionId, sucessId, pos, textAssociated);
        _bdElemList.Add(go);
    }
示例#5
0
    public void addIntroAnimationToList(int partId)
    {
        Vector3      pos = new Vector3(0, 0, 0);
        GameObject   go  = new GameObject("Intro" + partId);
        AnimationBox box = go.AddComponent <AnimationBox>();

        box.allowCameraMovement = false; //unactive parallax
        box.initIntro(partId, pos);
        _bdElemList.Add(go);
    }
示例#6
0
    //@param success : E: echec - ET : echec total - S : succes - ST : succes total
    public void addScenarFinalAnimationToList(int sceneId, string success, string textAssociated = "")
    {
        Vector3      pos = new Vector3(0, 0, 0);
        GameObject   go  = new GameObject("FinalScenarAnimation");
        AnimationBox box = go.AddComponent <AnimationBox>();

        box.allowCameraMovement = false; //unactive parallax
        box.initScenarFinal(sceneId, success, pos, textAssociated);
        _bdElemList.Add(go);
    }
示例#7
0
    public void addScenarAnimationToList(int sceneId, int partId)
    {
        Vector3      pos = new Vector3(0, 0, 0);
        GameObject   go  = new GameObject("ScenarAnimation");
        AnimationBox box = go.AddComponent <AnimationBox>();

        box.allowCameraMovement = false; //unactive parallax
        box.initScenar(sceneId, partId, pos);
        _bdElemList.Add(go);
    }
示例#8
0
 protected void AttackAnimation()
 {
     if (AnimationBox.Contains(attackAnimaton))
     {
         animation.Load(attackAnimaton, -attackAnimatonTime);
         animation.Play(-1);
     }
     else
     {
         Debug.LogWarning("No attack animation: " + attackAnimaton);
     }
 }
示例#9
0
 public void addTrapAnimationToList(int trapId, string textAssociated = "")
 {
     if (trapId != GameManager.noItemId)
     {
         Vector3      pos = new Vector3(0, 0, 0);
         GameObject   go  = new GameObject("TrapAnimation-" + trapId);
         AnimationBox box = go.AddComponent <AnimationBox>();
         box.allowCameraMovement = false; //unactive parallax
         box.initTrap(trapId, pos, textAssociated);
         _bdElemList.Add(go);
     }
 }
        protected override void Load(EntityGUI.GUIFactory factory)
        {
            //Note: Animations currently have no associated file format so
            //we build them manually in code.


            //Loads two atlases that will be the basis for our animations.
            var webIconsAtlas = this.Resourses.LoadAsset <TextureAtlas>("Atlases\\WebIcons.atlas");
            var osIconsAtlas  = this.Resourses.LoadAsset <TextureAtlas>("Atlases\\OsIcons.atlas");

            //Converts the atlases to arrays of frames.
            var anim0Frames = webIconsAtlas.Select((x) => x.Value).ToArray();
            var anim1Frames = osIconsAtlas.Select((x) => x.Value).ToArray();


            //Creates two animations from the animation frames.
            Animation anim0 = new Animation(anim0Frames, 5);
            Animation anim1 = new Animation(anim1Frames, 3);

            //Creates an animationbox with the anim0 animation.
            AnimationBox box0 = new AnimationBox(anim0);

            box0.Position        = new OpenTK.Vector2(50, 50);
            box0.Size            = new OpenTK.Vector2(256, 256);
            box0.BackgroundColor = Color.Purple * 0.1f;

            this.Panel.AddControl(box0);

            //Creates a second animationbox with the anim0 animation.
            //It should be noted that the animationbox clones the animation
            //so you can use the same animation on multiple boxes.
            AnimationBox box1 = new AnimationBox(anim0);

            box1.Position        = new OpenTK.Vector2(50, box0.Bounds.Bottom + 50);
            box1.Size            = new OpenTK.Vector2(256, 256);
            box1.BackgroundColor = Color.Yellow * 0.1f;

            this.Panel.AddControl(box1);


            AnimationBox box2 = new AnimationBox(anim1);

            box2.Position        = new OpenTK.Vector2(this.Width - 50, 50);
            box2.Size            = new OpenTK.Vector2(256, 256);
            box2.BackgroundColor = Color.Green * 0.1f;

            //Put the origin to the right to simplify placement.
            box2.Origin = Origin.TopRight;

            this.Panel.AddControl(box2);
        }
        protected override void Load(EntityGUI.GUIFactory factory)
        {
            //Note: Animations currently have no associated file format so
            //we build them manually in code.

            //Loads two atlases that will be the basis for our animations.
            var webIconsAtlas = this.Resourses.LoadAsset<TextureAtlas>("Atlases\\WebIcons.atlas");
            var osIconsAtlas = this.Resourses.LoadAsset<TextureAtlas>("Atlases\\OsIcons.atlas");

            //Converts the atlases to arrays of frames.
            var anim0Frames = webIconsAtlas.Select((x) => x.Value).ToArray();
            var anim1Frames = osIconsAtlas.Select((x) => x.Value).ToArray();

            //Creates two animations from the animation frames.
            Animation anim0 = new Animation(anim0Frames, 5);
            Animation anim1 = new Animation(anim1Frames, 3);

            //Creates an animationbox with the anim0 animation.
            AnimationBox box0 = new AnimationBox(anim0);
            box0.Position = new OpenTK.Vector2(50, 50);
            box0.Size = new OpenTK.Vector2(256, 256);
            box0.BackgroundColor = Color.Purple * 0.1f;

            this.Panel.AddControl(box0);

            //Creates a second animationbox with the anim0 animation.
            //It should be noted that the animationbox clones the animation
            //so you can use the same animation on multiple boxes.
            AnimationBox box1 = new AnimationBox(anim0);
            box1.Position = new OpenTK.Vector2(50, box0.Bounds.Bottom + 50);
            box1.Size = new OpenTK.Vector2(256, 256);
            box1.BackgroundColor = Color.Yellow * 0.1f;

            this.Panel.AddControl(box1);

            AnimationBox box2 = new AnimationBox(anim1);
            box2.Position = new OpenTK.Vector2(this.Width - 50, 50);
            box2.Size = new OpenTK.Vector2(256, 256);
            box2.BackgroundColor = Color.Green * 0.1f;

            //Put the origin to the right to simplify placement.
            box2.Origin = Origin.TopRight;

            this.Panel.AddControl(box2);
        }
示例#12
0
    public void Load(string _name, float _FPS = 16)
    {
        if (AnimationBox.GetAnimation(_name) != null)
        {
            textures = AnimationBox.GetAnimation(_name).textures;
        }
        else
        {
            Debug.LogWarning("No animation '" + _name + "'");
        }

        if (_FPS < 0)
        {
            FPS = -textures.Count / _FPS;
        }
        else
        {
            FPS = _FPS;
        }
    }