Exemple #1
0
        public void SetAgent(string name, bool initialAnimation)
        {
            Agent = new Agent(name)
            {
                Sound = PropertySettings.AudioEnabled
            };
            agentView.ConfigureAgent(Agent);

            if (initialAnimation)
            {
                Agent.Animate();
            }
        }
Exemple #2
0
        static void AgentPopupButton_Activated(object sender, System.EventArgs e)
        {
            var agentName = agentPopupButton.TitleOfSelectedItem;
            var agent     = new Agent(agentName);

            agentView.ConfigureAgent(agent);

            agent.Animate();

            animationPopupButton.RemoveAllItems();
            foreach (var animation in agent.GetAnimations())
            {
                //fill with all animation
                animationPopupButton.AddItem(animation);
            }
        }
Exemple #3
0
        void ItemChanged()
        {
            if (model != null)
            {
                model.CustomSelectionChanged -= Model_SelectedChanged;
            }

            var title = segmentedControl.TitleAt(segmentedControl.SelectedSegment);

            currentAgent = new Agent(title);
            agentView.ConfigureAgent(currentAgent);
            currentAgent.Animate();

            animations       = currentAgent.GetAnimations();
            model            = new AnimationsModel(animations);
            pickerView.Model = model;
            pickerView.ReloadAllComponents();
            model.CustomSelectionChanged += Model_SelectedChanged;
        }
Exemple #4
0
        public MainPage()
        {
            InitializeComponent();
            var soundPlayer   = DependencyService.Get <ISoundPlayer> ();
            var agentDelegate = DependencyService.Get <IAgentDelegate> ();

            AgentEnvirontment.Current.Initialize(agentDelegate, soundPlayer);

            var agentView = new AgentView();

            agentView.WidthRequest  = 200;
            agentView.HeightRequest = 200;

            var agent = new Agent("clippy");

            agentView.ConfigureAgent(agent);

            agent.Animate();

            container.Children.Add(agentView);
        }