- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
Latest commit
53 lines (49 loc) · 1.46 KB
/
Copy pathProgram.cs
File metadata and controls
53 lines (49 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
usingSystem;
usingTransitionsLibrary;
usingstaticTransitionsLibrary.Models.Functions.Easings;
namespaceSimpleConsoleExample
{
classProgram
{
staticTransitionTypes.ValueTransitionTransition;
staticvoidMain(string[]args)
{
Console.ForegroundColor=ConsoleColor.Yellow;
Transition=newControlValueTransition
(
startValue:0,
endValue:70,
duration:4000,
onValueChanged:OnValueChanged,
easingFunction:Elastic.InOut,
targetControl:null,
fps:25
);
Transition.OnTransitionStart=OnStart;
Transition.OnTransitionEnd=OnEnd;
Transition.Start();
}
staticvoidOnStart()
{
Console.Clear();
Console.WriteLine("Transition initialized. Press any key to start");
Console.ReadLine();
}
staticvoidOnEnd()
{
Console.WriteLine("Transition ends");
Console.ReadLine();
Transition.Start();
}
staticvoidOnValueChanged(floatvalue,objectcontrol)
{
Console.Clear();
stringa=$"Value: {value} ({(value*100)/Transition.EndValue}%)\n";
for(inti=0;i<value;i++)
{
a+="#";
}
Console.WriteLine(a);
}
}
}