'Artefact.Animation.GetterSetterData' does not contain a definition for 'EaseValue'

Nov 24, 2010 at 12:56 AM

I am trying to use the GetterSetter to animate a Double variable

in declaring the GetterSetter in my constructor I get this error:

 

'Artefact.Animation.GetterSetterData' does not contain a definition for 'EaseValue'

 

 

code

var screenValueGetterSetter = new GetterSetter
            {
                Getter = (obj, data) => obj,
                Setter = (obj, data, per) =>
                {
                    var c = GetterSetterData.EaseValue((Double)data.ValueStart, (Double)data.ValueEnd, per);
                    var o = (Double)obj;
                    o = c;
                }
            };

 

thanks

 

 

Nov 24, 2010 at 1:48 AM

Ok - I found the answer - I will also add the comment on the page where i got the example from:

http://artefactanimator.codeplex.com/wikipage?title=gettersetter&version=2

 

first I declare a field in my class to hold the value I want to animate:

 

private Double testValue = 5;

 

then I declare the const string as in the example

public const string screenValue = "screenValue";

now in my constructor of the class I do the rest:

var screenValueGetterSetter = new GetterSetter
            {
                Getter = (obj, data) => obj,
                Setter = (obj, data, per) =>
                {
                  //this was from the example
                  //GetterSetterData.EaseValue throws an error
                  //var c = GetterSetterData.EaseValue((Double)data.ValueStart, (Double)data.ValueEnd, per);
                  //EaseHelper.EaseValue works!!!!!!
                  var c = EaseHelper.EaseValue((Double)data.ValueStart, (Double)data.ValueEnd, per);
                  Console.WriteLine("testing values obj{0}, data{1}, per{2}, c{3}", obj, data, per, c);
                  //the following line from the example does nothing
                  var o = (Double)obj;
                  //setting the value directly works
                  testValue = c;
                }
            };

//now to test the function
            AnimationTypes.RegisterGetterSetter("screenValue", screenValueGetterSetter);
            ArtefactAnimator.AddEase(testValue, "screenValue", 50, 5).OnUpdate((eo, p) => Console.WriteLine("updating test: {0}",testValue));

thanks for a great Library - I come from Director/Flash - and I am an Interaction Designer - not a Software Engineer