File: tweeny.h

package info (click to toggle)
tweeny 3-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 340 kB
  • sloc: cpp: 406; xml: 182; ansic: 171; makefile: 6
file content (103 lines) | stat: -rw-r--r-- 3,873 bytes parent folder | download | duplicates (3)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
 This file is part of the Tweeny library.

 Copyright (c) 2016-2018 Leonardo G. Lucena de Freitas
 Copyright (c) 2016 Guilherme R. Costa

 Permission is hereby granted, free of charge, to any person obtaining a copy of
 this software and associated documentation files (the "Software"), to deal in
 the Software without restriction, including without limitation the rights to
 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 the Software, and to permit persons to whom the Software is furnished to do so,
 subject to the following conditions:

 The above copyright notice and this permission notice shall be included in all
 copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/**
 * @file tweeny.h
 * This file is the main header file for Tweeny. You should not need to include anything else.
 */

/**
 * @mainpage Tweeny
 *
 * Tweeny is an inbetweening library designed for the creation of complex animations for games and other beautiful
 * interactive software. It leverages features of modern C++ to empower developers with an intuitive API for
 * declaring tweenings of any type of value, as long as they support arithmetic operations.
 *
 * This document contains Tweeny's API reference. The most interesting parts are:
 *
 * * The Fine @ref manual
 * * The tweeny::from global function, to start a new tween.
 * * The tweeny::tween class itself, that has all the interesting methods for a tween.
 * * The <a href="modules.html">modules page</a> has a list of type of easings.
 *
 * This is how the API looks like:
 *
 * @code
 *
 * #include "tweeny.h"
 *
 * using tweeny::easing;
 *
 * int main() {
 *  // steps 1% each iteration
 *  auto tween = tweeny::from(0).to(100).during(100).via(easing::linear);
 *  while (tween.progress() < 1.0f) tween.step(0.01f);
 *
 *  // a tween with multiple values
 *  auto tween2 = tweeny::from(0, 1.0f).to(1200, 7.0f).during(1000).via(easing::backInOut, easing::linear);
 *
 *  // a tween with multiple points, different easings and durations
 *  auto tween3 = tweeny::from(0, 0)
 *                  .to(100, 100).during(100).via(easing::backOut, easing::backOut)
 *                  .to(200, 200).during(500).via(easing::linear);
 *  return 0;
 * }
 *
 * @endcode
 *
 * **Examples**
 *
 * * Check <a href="http://github.com/mobius3/tweeny-demos">tweeny-demos</a> repository to see demonstration code
 *
 * **Useful links and references**
 * * <a href="http://www.timotheegroleau.com/Flash/experiments/easing_function_generator.htm">Tim Groleau's easing function generator (requires flash)</a>
 * * <a href="http://easings.net/">Easing cheat sheet (contains graphics!)</a>
 */

#ifndef TWEENY_H
#define TWEENY_H

#include "tween.h"
#include "tween.h"
#include "easing.h"

/**
 * @brief The tweeny namespace contains all symbols and names for the Tweeny library.
 */
namespace tweeny {
  /**
   * @brief Creates a tween starting from the values defined in the arguments.
   *
   * Starting values can have heterogeneous types, even user-defined types, provided they implement the
   * four arithmetic operators (+, -, * and /). The types used will also define the type of each next step, the type
   * of the callback and the type of arguments the passed easing functions must have.
   *
   * @sa tweeny::tween
   */
    template<typename... Ts> tween<Ts...> from(Ts... vs);
}

#include "tweeny.tcc"

#endif //TWEENY_TWEENY_H