├── startServer.hxml ├── exportHxml.hxml ├── tools ├── CustumEasing │ ├── startJekyll.bat │ ├── src │ │ ├── import.hx │ │ ├── core │ │ │ ├── storage │ │ │ │ ├── StorageKey.hx │ │ │ │ └── StorageManager.hx │ │ │ ├── localize │ │ │ │ ├── LocaleKind.hx │ │ │ │ ├── ResourceKey.hx │ │ │ │ ├── LocalizeResource.hx │ │ │ │ └── resource │ │ │ │ │ └── EnglishResource.hx │ │ │ ├── output │ │ │ │ └── OutputMode.hx │ │ │ ├── animation │ │ │ │ ├── Animation.hx │ │ │ │ └── AnimationManager.hx │ │ │ ├── drag │ │ │ │ ├── DragStateKind.hx │ │ │ │ └── DragState.hx │ │ │ ├── focus │ │ │ │ ├── FocusState.hx │ │ │ │ └── FocusManager.hx │ │ │ ├── easing │ │ │ │ └── EasingCommand.hx │ │ │ ├── RootCommand.hx │ │ │ └── history │ │ │ │ └── HistoryManager.hx │ │ ├── component │ │ │ ├── basic │ │ │ │ ├── NumberInputId.hx │ │ │ │ ├── GraphLine.hx │ │ │ │ ├── GraphColor.hx │ │ │ │ ├── RateId.hx │ │ │ │ ├── DropdownButtonView.hx │ │ │ │ ├── NumberInputFocus.hx │ │ │ │ └── NumberSliderDrag.hx │ │ │ ├── binary │ │ │ │ ├── CompositeView.hx │ │ │ │ └── MultiplyView.hx │ │ │ ├── complex │ │ │ │ ├── ComplexEasingSelectItemId.hx │ │ │ │ ├── ComplexEasingSelectFocus.hx │ │ │ │ ├── ComplexEasingDrag.hx │ │ │ │ └── ComplexEasingCreateContext.hx │ │ │ ├── output │ │ │ │ ├── OutputView.hx │ │ │ │ └── OutputModeSelectView.hx │ │ │ ├── unary │ │ │ │ ├── RoundTripView.hx │ │ │ │ └── RepeatView.hx │ │ │ ├── menu │ │ │ │ ├── LocaleView.hx │ │ │ │ └── MenuView.hx │ │ │ └── simple │ │ │ │ ├── SimpleEasingView.hx │ │ │ │ └── StandardEasingView.hx │ │ ├── react │ │ │ └── ReactTools.hx │ │ └── Application.hx │ ├── build.hxml │ └── CustomEasing.hxproj ├── ChainMaker │ ├── Run.bat │ ├── src │ │ └── mtt │ │ │ ├── func1.mtt │ │ │ ├── func2.mtt │ │ │ ├── top.mtt │ │ │ └── func3.mtt │ └── ChainMaker.hxproj ├── doc │ ├── build_xml.hxml │ ├── Import.hx │ └── build.bat └── chain │ ├── Run.hxml │ ├── src │ └── mtt │ │ ├── func1.mtt │ │ ├── func2.mtt │ │ ├── top.mtt │ │ └── func3.mtt │ └── ChainMaker.hxproj ├── website ├── .gitignore ├── css │ ├── tile.png │ └── reset.css ├── icon │ ├── In.png │ ├── Mix.png │ ├── Out.png │ ├── Back.png │ ├── Bezier.png │ ├── Bounce.png │ ├── Circ.png │ ├── Clamp.png │ ├── Cubic.png │ ├── Expo.png │ ├── InOut.png │ ├── Lerp.png │ ├── Linear.png │ ├── OneTwo.png │ ├── OutIn.png │ ├── Quad.png │ ├── Quart.png │ ├── Quint.png │ ├── Repeat.png │ ├── Sine.png │ ├── Warp.png │ ├── Yoyo.png │ ├── Zigzag.png │ ├── Connect.png │ ├── Elastic.png │ ├── Multiply.png │ ├── Polyline.png │ ├── Composite.png │ ├── Crossfade.png │ └── UniformQuadraticBSpline.png ├── _includes │ ├── repogitory_url.txt │ ├── sample.asciidoc │ └── tweenxsample.asciidoc ├── core │ ├── api │ │ ├── favicon.ico │ │ ├── triangle-closed.png │ │ ├── triangle-opened.png │ │ ├── bootstrap │ │ │ └── img │ │ │ │ ├── glyphicons-halflings.png │ │ │ │ └── glyphicons-halflings-white.png │ │ ├── highlighter.css │ │ └── highlighter.js │ └── custom │ │ └── index.html ├── images │ ├── benchmark.png │ ├── character.png │ ├── overview.png │ ├── benchmark1.png │ ├── easing_editor.png │ └── easing_editor_ja.png ├── sample │ ├── swf │ │ ├── Quake.swf │ │ ├── Bezier.swf │ │ ├── Default.swf │ │ ├── Easing.swf │ │ ├── ArrayTween.swf │ │ ├── AutoFrom.swf │ │ ├── BenchMark.swf │ │ ├── ColorTween.swf │ │ ├── GroupEase.swf │ │ ├── GroupTween.swf │ │ ├── LagTween.swf │ │ ├── TweenXDemo.swf │ │ ├── EventHandle.swf │ │ ├── MethodChain.swf │ │ ├── RepeatTween.swf │ │ ├── SerialTween.swf │ │ ├── WaitAndSkip.swf │ │ ├── ParallelTween.swf │ │ ├── RelativeTween.swf │ │ ├── SimplestTween.swf │ │ ├── TimelineTween.swf │ │ └── TweenFunction.swf │ ├── bench │ │ ├── ActuateBench.swf │ │ ├── Tween24Bench.swf │ │ ├── TweenXBench.swf │ │ ├── TweenerBench.swf │ │ ├── TweensyBench.swf │ │ └── BetweenAS3Bench.swf │ ├── bench1 │ │ ├── ActuateBench.swf │ │ ├── DeltaBench.swf │ │ ├── TweenXBench.swf │ │ ├── TweenerBench.swf │ │ ├── TweensyBench.swf │ │ ├── BetweenAS3Bench.swf │ │ └── TweenXCoreBench.swf │ └── TweenXDemoHaxe3 │ │ ├── img │ │ ├── back.png │ │ ├── bar.png │ │ ├── play.png │ │ ├── pause.png │ │ ├── forward.png │ │ ├── bar_disable.png │ │ └── animation │ │ │ ├── walk0.png │ │ │ ├── walk1.png │ │ │ └── walk2.png │ │ └── index.html ├── .htaccess ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── Gemfile ├── .jekyll-cache │ └── Jekyll │ │ └── Cache │ │ └── Jekyll--Cache │ │ └── b7 │ │ └── 9606fb3afea5bd1609ed40b622142f1c98125abcfe89a76a661b0e8e343910 ├── _config.yml ├── feed.xml └── _layouts │ ├── default.html │ └── tool.html ├── .gitignore ├── sample ├── tweenx │ ├── 800_BenchMark │ │ ├── graph.ods │ │ ├── bin │ │ │ ├── ActuateBench.swf │ │ │ ├── DeltaBench.swf │ │ │ ├── TweenXBench.swf │ │ │ ├── TweenerBench.swf │ │ │ ├── TweensyBench.swf │ │ │ ├── BetweenAS3Bench.swf │ │ │ └── TweenXCoreBench.swf │ │ ├── lib │ │ │ ├── tweener_1_33_74_as3.swc │ │ │ ├── BetweenAS3-Alpha-r3022-fp10.swc │ │ │ └── Tweensy_0_2_22_OriginalCS4.swc │ │ ├── result.txt │ │ ├── build.hxml │ │ └── BenchMark.hxproj │ ├── 014_TimelineTween │ │ └── assets │ │ │ ├── walk0.png │ │ │ ├── walk1.png │ │ │ └── walk2.png │ ├── 016_EventHandle │ │ ├── assets │ │ │ └── img │ │ │ │ ├── bar.png │ │ │ │ ├── back.png │ │ │ │ ├── pause.png │ │ │ │ ├── play.png │ │ │ │ ├── forward.png │ │ │ │ ├── bar_disable.png │ │ │ │ └── animation │ │ │ │ ├── walk0.png │ │ │ │ ├── walk1.png │ │ │ │ └── walk2.png │ │ └── Main.hx │ ├── 900_TweenXDemo │ │ └── assets │ │ │ ├── img │ │ │ ├── back.png │ │ │ ├── bar.png │ │ │ ├── play.png │ │ │ ├── pause.png │ │ │ ├── forward.png │ │ │ ├── bar_disable.png │ │ │ └── animation │ │ │ │ ├── walk0.png │ │ │ │ ├── walk1.png │ │ │ │ └── walk2.png │ │ │ └── font │ │ │ └── Pixcell.ttf │ ├── 012_TweenFunction │ │ └── Main.hx │ ├── 001_SimplestTween │ │ └── Main.hx │ ├── 019_GroupEase │ │ └── Main.hx │ ├── 017_Quake │ │ └── Main.hx │ ├── 003_MethodChain │ │ └── Main.hx │ ├── 002_GroupTween │ │ └── Main.hx │ ├── 013_ColorTween │ │ └── Main.hx │ ├── 011_AutoFrom │ │ └── Main.hx │ ├── 006_ParallelTween │ │ └── Main.hx │ ├── 007_LagTween │ │ └── Main.hx │ ├── 005_SerialTween │ │ └── Main.hx │ ├── 009_RepeatTween │ │ └── Main.hx │ └── 018_RelativeTween │ │ └── Main.hx ├── build.hxml ├── js │ └── sample │ │ ├── context │ │ ├── Drawable.hx │ │ ├── Updatable.hx │ │ └── DrawContext.hx │ │ ├── player │ │ └── Player.hx │ │ ├── Sprite.hx │ │ └── Square.hx ├── flash │ └── sample │ │ ├── SampleSuport.hx │ │ ├── Square.hx │ │ ├── main │ │ └── DirectMain.hx │ │ └── component │ │ ├── PlayButtonShadow.hx │ │ ├── PlayButton.hx │ │ └── SamplePlayer.hx ├── tweenxcore │ ├── SimplestSample.hx │ ├── EasingSample.hx │ ├── YoyoSample.hx │ ├── CrossOverSample.hx │ ├── ZigzagSample.hx │ ├── CompositeSample.hx │ ├── MixSample.hx │ ├── OneTwoSample.hx │ ├── ConnectSample.hx │ ├── CrossfadeSample.hx │ ├── RepeatSample.hx │ ├── BezierSample.hx │ ├── XySample.hx │ ├── FloatChangePartSample.hx │ ├── MouseSample.hx │ ├── EntranceExitSample.hx │ ├── HsvSample.hx │ ├── ShakeSample.hx │ ├── TimelinePartSample.hx │ ├── MatrixSample.hx │ ├── PolarSample.hx │ └── ImageSample.hx ├── common │ └── Style.hx └── Sample.hxproj ├── test ├── test.hxml ├── test_swf.hxml ├── test_cs.hxml ├── test_cpp.hxml ├── test_js.hxml ├── test_hl.hxml ├── test_neko.hxml ├── test_java.hxml ├── test_objc.hxml ├── src │ └── TestMain.hx ├── benchmark.md └── TweenXCoreTest.hxproj ├── src ├── tweenxcore │ ├── tweenxcore │ │ ├── geom │ │ │ ├── Point.hx │ │ │ ├── Matrix.hx │ │ │ └── PolarPoint.hx │ │ ├── expr │ │ │ ├── RoundTripKind.hx │ │ │ ├── InOutKind.hx │ │ │ ├── TernaryOpKind.hx │ │ │ ├── LineKind.hx │ │ │ ├── ComplexEasingKind.hx │ │ │ ├── SimpleEasingKind.hx │ │ │ ├── UnaryOpKind.hx │ │ │ ├── BinaryOpKind.hx │ │ │ ├── StandardEasingKind.hx │ │ │ └── ExprMaker.hx │ │ ├── structure │ │ │ ├── BoundaryMode.hx │ │ │ ├── Direction.hx │ │ │ ├── FloatChangePart.hx │ │ │ ├── TimelineSearchResult.hx │ │ │ ├── FloatChangeTimelinePart.hx │ │ │ └── FloatChangeRepeatPart.hx │ │ └── color │ │ │ ├── ITransparentColor.hx │ │ │ ├── IColor.hx │ │ │ ├── AhsvColor.hx │ │ │ └── ArgbColor.hx │ └── haxelib.json └── tweenx │ ├── tweenx909 │ ├── EaseX.hx │ ├── advanced │ │ ├── CommandTypeX.hx │ │ ├── UpdateModeX.hx │ │ ├── TweenTypeX.hx │ │ ├── CommandX.hx │ │ └── GroupX.hx │ ├── rule │ │ ├── RuleX.hx │ │ ├── QuakeX.hx │ │ ├── BoolRuleX.hx │ │ ├── HsvRuleX.hx │ │ ├── RgbRuleX.hx │ │ ├── ArgbRuleX.hx │ │ ├── AhsvRuleX.hx │ │ ├── QuakeRuleX.hx │ │ └── TimelineRuleX.hx │ └── EventX.hx │ └── haxelib.json ├── hxml ├── 004.hxml ├── 017.hxml ├── Easing.hxml ├── 002.hxml ├── 007.hxml ├── 010.hxml ├── 011.hxml ├── 013.hxml ├── 015.hxml ├── 019.hxml ├── 020.hxml ├── 800.hxml ├── 900.hxml ├── Bezier.hxml ├── Quake.hxml ├── 001.hxml ├── 003.hxml ├── 005.hxml ├── 006.hxml ├── 008.hxml ├── 009.hxml ├── 012.hxml ├── 014.hxml ├── 016.hxml ├── 018.hxml ├── AutoFrom.hxml ├── BenchMark.hxml ├── Default.hxml ├── GroupEase.hxml ├── LagTween.hxml ├── ArrayTween.hxml ├── ColorTween.hxml ├── EventHandle.hxml ├── GroupTween.hxml ├── MethodChain.hxml ├── RepeatTween.hxml ├── SerialTween.hxml ├── TweenXDemo.hxml ├── WaitAndSkip.hxml ├── ParallelTween.hxml ├── RelativeTween.hxml ├── SimplestTween.hxml ├── TimelineTween.hxml └── TweenFunction.hxml ├── Dox.hxml ├── README.md └── TweenX.hxproj /startServer.hxml: -------------------------------------------------------------------------------- 1 | --wait 6000 -------------------------------------------------------------------------------- /exportHxml.hxml: -------------------------------------------------------------------------------- 1 | --macro Project.exportHxml() 2 | -------------------------------------------------------------------------------- /tools/CustumEasing/startJekyll.bat: -------------------------------------------------------------------------------- 1 | cd ../../website 2 | jekyll s -------------------------------------------------------------------------------- /website/.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | .sass-cache 3 | .jekyll-metadata 4 | -------------------------------------------------------------------------------- /tools/ChainMaker/Run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd bin 3 | neko ChainMaker.n 4 | pause 5 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/import.hx: -------------------------------------------------------------------------------- 1 | using react.ReactTools; 2 | using tweenxcore.Tools; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /obj/* 2 | /archive/* 3 | **/bin/**/* 4 | /xml/* 5 | 6 | !**/bin/**/*.swf 7 | -------------------------------------------------------------------------------- /website/css/tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/css/tile.png -------------------------------------------------------------------------------- /website/icon/In.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/In.png -------------------------------------------------------------------------------- /website/icon/Mix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Mix.png -------------------------------------------------------------------------------- /website/icon/Out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Out.png -------------------------------------------------------------------------------- /website/icon/Back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Back.png -------------------------------------------------------------------------------- /website/icon/Bezier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Bezier.png -------------------------------------------------------------------------------- /website/icon/Bounce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Bounce.png -------------------------------------------------------------------------------- /website/icon/Circ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Circ.png -------------------------------------------------------------------------------- /website/icon/Clamp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Clamp.png -------------------------------------------------------------------------------- /website/icon/Cubic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Cubic.png -------------------------------------------------------------------------------- /website/icon/Expo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Expo.png -------------------------------------------------------------------------------- /website/icon/InOut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/InOut.png -------------------------------------------------------------------------------- /website/icon/Lerp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Lerp.png -------------------------------------------------------------------------------- /website/icon/Linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Linear.png -------------------------------------------------------------------------------- /website/icon/OneTwo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/OneTwo.png -------------------------------------------------------------------------------- /website/icon/OutIn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/OutIn.png -------------------------------------------------------------------------------- /website/icon/Quad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Quad.png -------------------------------------------------------------------------------- /website/icon/Quart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Quart.png -------------------------------------------------------------------------------- /website/icon/Quint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Quint.png -------------------------------------------------------------------------------- /website/icon/Repeat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Repeat.png -------------------------------------------------------------------------------- /website/icon/Sine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Sine.png -------------------------------------------------------------------------------- /website/icon/Warp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Warp.png -------------------------------------------------------------------------------- /website/icon/Yoyo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Yoyo.png -------------------------------------------------------------------------------- /website/icon/Zigzag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Zigzag.png -------------------------------------------------------------------------------- /website/_includes/repogitory_url.txt: -------------------------------------------------------------------------------- 1 | https://github.com/shohei909/tweenx/blob/develop/{{include.file}} -------------------------------------------------------------------------------- /website/icon/Connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Connect.png -------------------------------------------------------------------------------- /website/icon/Elastic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Elastic.png -------------------------------------------------------------------------------- /website/icon/Multiply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Multiply.png -------------------------------------------------------------------------------- /website/icon/Polyline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Polyline.png -------------------------------------------------------------------------------- /website/core/api/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/core/api/favicon.ico -------------------------------------------------------------------------------- /website/icon/Composite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Composite.png -------------------------------------------------------------------------------- /website/icon/Crossfade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/Crossfade.png -------------------------------------------------------------------------------- /website/images/benchmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/images/benchmark.png -------------------------------------------------------------------------------- /website/images/character.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/images/character.png -------------------------------------------------------------------------------- /website/images/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/images/overview.png -------------------------------------------------------------------------------- /website/sample/swf/Quake.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/Quake.swf -------------------------------------------------------------------------------- /website/images/benchmark1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/images/benchmark1.png -------------------------------------------------------------------------------- /website/sample/swf/Bezier.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/Bezier.swf -------------------------------------------------------------------------------- /website/sample/swf/Default.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/Default.swf -------------------------------------------------------------------------------- /website/sample/swf/Easing.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/Easing.swf -------------------------------------------------------------------------------- /website/images/easing_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/images/easing_editor.png -------------------------------------------------------------------------------- /website/sample/swf/ArrayTween.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/ArrayTween.swf -------------------------------------------------------------------------------- /website/sample/swf/AutoFrom.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/AutoFrom.swf -------------------------------------------------------------------------------- /website/sample/swf/BenchMark.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/BenchMark.swf -------------------------------------------------------------------------------- /website/sample/swf/ColorTween.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/ColorTween.swf -------------------------------------------------------------------------------- /website/sample/swf/GroupEase.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/GroupEase.swf -------------------------------------------------------------------------------- /website/sample/swf/GroupTween.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/GroupTween.swf -------------------------------------------------------------------------------- /website/sample/swf/LagTween.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/LagTween.swf -------------------------------------------------------------------------------- /website/sample/swf/TweenXDemo.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/TweenXDemo.swf -------------------------------------------------------------------------------- /website/images/easing_editor_ja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/images/easing_editor_ja.png -------------------------------------------------------------------------------- /website/sample/swf/EventHandle.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/EventHandle.swf -------------------------------------------------------------------------------- /website/sample/swf/MethodChain.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/MethodChain.swf -------------------------------------------------------------------------------- /website/sample/swf/RepeatTween.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/RepeatTween.swf -------------------------------------------------------------------------------- /website/sample/swf/SerialTween.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/SerialTween.swf -------------------------------------------------------------------------------- /website/sample/swf/WaitAndSkip.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/WaitAndSkip.swf -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/graph.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/graph.ods -------------------------------------------------------------------------------- /website/core/api/triangle-closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/core/api/triangle-closed.png -------------------------------------------------------------------------------- /website/core/api/triangle-opened.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/core/api/triangle-opened.png -------------------------------------------------------------------------------- /website/sample/bench/ActuateBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench/ActuateBench.swf -------------------------------------------------------------------------------- /website/sample/bench/Tween24Bench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench/Tween24Bench.swf -------------------------------------------------------------------------------- /website/sample/bench/TweenXBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench/TweenXBench.swf -------------------------------------------------------------------------------- /website/sample/bench/TweenerBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench/TweenerBench.swf -------------------------------------------------------------------------------- /website/sample/bench/TweensyBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench/TweensyBench.swf -------------------------------------------------------------------------------- /website/sample/bench1/ActuateBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench1/ActuateBench.swf -------------------------------------------------------------------------------- /website/sample/bench1/DeltaBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench1/DeltaBench.swf -------------------------------------------------------------------------------- /website/sample/bench1/TweenXBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench1/TweenXBench.swf -------------------------------------------------------------------------------- /website/sample/bench1/TweenerBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench1/TweenerBench.swf -------------------------------------------------------------------------------- /website/sample/bench1/TweensyBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench1/TweensyBench.swf -------------------------------------------------------------------------------- /website/sample/swf/ParallelTween.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/ParallelTween.swf -------------------------------------------------------------------------------- /website/sample/swf/RelativeTween.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/RelativeTween.swf -------------------------------------------------------------------------------- /website/sample/swf/SimplestTween.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/SimplestTween.swf -------------------------------------------------------------------------------- /website/sample/swf/TimelineTween.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/TimelineTween.swf -------------------------------------------------------------------------------- /website/sample/swf/TweenFunction.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/swf/TweenFunction.swf -------------------------------------------------------------------------------- /test/test.hxml: -------------------------------------------------------------------------------- 1 | test_hl.hxml 2 | test_js.hxml 3 | test_java.hxml 4 | test_cs.hxml 5 | test_neko.hxml 6 | test_cpp.hxml 7 | --times 8 | -------------------------------------------------------------------------------- /test/test_swf.hxml: -------------------------------------------------------------------------------- 1 | #1. compile 2 | -main TestMain 3 | -swf bin/test.swf 4 | -lib nanotest 5 | -cp ../src/tweenxcore 6 | -cp src 7 | -------------------------------------------------------------------------------- /website/icon/UniformQuadraticBSpline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/icon/UniformQuadraticBSpline.png -------------------------------------------------------------------------------- /website/sample/bench/BetweenAS3Bench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench/BetweenAS3Bench.swf -------------------------------------------------------------------------------- /sample/build.hxml: -------------------------------------------------------------------------------- 1 | -js ../website/js/Sample.js 2 | -cp tweenxcore 3 | -cp ../src/tweenxcore 4 | -cp js 5 | -cp common 6 | -main Main 7 | -------------------------------------------------------------------------------- /website/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | RewriteRule ^en\.html$ index\.html [R=302,L] 4 | 5 | -------------------------------------------------------------------------------- /website/sample/TweenXDemoHaxe3/img/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/TweenXDemoHaxe3/img/back.png -------------------------------------------------------------------------------- /website/sample/TweenXDemoHaxe3/img/bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/TweenXDemoHaxe3/img/bar.png -------------------------------------------------------------------------------- /website/sample/TweenXDemoHaxe3/img/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/TweenXDemoHaxe3/img/play.png -------------------------------------------------------------------------------- /website/sample/bench1/BetweenAS3Bench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench1/BetweenAS3Bench.swf -------------------------------------------------------------------------------- /website/sample/bench1/TweenXCoreBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/bench1/TweenXCoreBench.swf -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/geom/Point.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.geom; 2 | 3 | typedef Point = { 4 | var x:Float; 5 | var y:Float; 6 | } 7 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/storage/StorageKey.hx: -------------------------------------------------------------------------------- 1 | package core.storage; 2 | 3 | enum StorageKey 4 | { 5 | Locale; 6 | Output; 7 | } -------------------------------------------------------------------------------- /tools/doc/build_xml.hxml: -------------------------------------------------------------------------------- 1 | -cp ../../ 2 | --no-output 3 | -swf _.swf 4 | -xml ../../haxedoc/output.xml 5 | -D doc_gen 6 | --macro Import.run() -------------------------------------------------------------------------------- /website/sample/TweenXDemoHaxe3/img/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/TweenXDemoHaxe3/img/pause.png -------------------------------------------------------------------------------- /sample/tweenx/014_TimelineTween/assets/walk0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/014_TimelineTween/assets/walk0.png -------------------------------------------------------------------------------- /sample/tweenx/014_TimelineTween/assets/walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/014_TimelineTween/assets/walk1.png -------------------------------------------------------------------------------- /sample/tweenx/014_TimelineTween/assets/walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/014_TimelineTween/assets/walk2.png -------------------------------------------------------------------------------- /sample/tweenx/016_EventHandle/assets/img/bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/016_EventHandle/assets/img/bar.png -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/bin/ActuateBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/bin/ActuateBench.swf -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/bin/DeltaBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/bin/DeltaBench.swf -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/bin/TweenXBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/bin/TweenXBench.swf -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/bin/TweenerBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/bin/TweenerBench.swf -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/bin/TweensyBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/bin/TweensyBench.swf -------------------------------------------------------------------------------- /sample/tweenx/900_TweenXDemo/assets/img/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/900_TweenXDemo/assets/img/back.png -------------------------------------------------------------------------------- /sample/tweenx/900_TweenXDemo/assets/img/bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/900_TweenXDemo/assets/img/bar.png -------------------------------------------------------------------------------- /sample/tweenx/900_TweenXDemo/assets/img/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/900_TweenXDemo/assets/img/play.png -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/expr/RoundTripKind.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.expr; 2 | 3 | enum RoundTripKind 4 | { 5 | Yoyo; 6 | Zigzag; 7 | } 8 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/localize/LocaleKind.hx: -------------------------------------------------------------------------------- 1 | package core.localize; 2 | 3 | enum LocaleKind 4 | { 5 | English; 6 | Japanese; 7 | } -------------------------------------------------------------------------------- /website/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /website/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /website/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /website/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /website/sample/TweenXDemoHaxe3/img/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/TweenXDemoHaxe3/img/forward.png -------------------------------------------------------------------------------- /sample/tweenx/016_EventHandle/assets/img/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/016_EventHandle/assets/img/back.png -------------------------------------------------------------------------------- /sample/tweenx/016_EventHandle/assets/img/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/016_EventHandle/assets/img/pause.png -------------------------------------------------------------------------------- /sample/tweenx/016_EventHandle/assets/img/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/016_EventHandle/assets/img/play.png -------------------------------------------------------------------------------- /sample/tweenx/900_TweenXDemo/assets/img/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/900_TweenXDemo/assets/img/pause.png -------------------------------------------------------------------------------- /website/sample/TweenXDemoHaxe3/img/bar_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/TweenXDemoHaxe3/img/bar_disable.png -------------------------------------------------------------------------------- /sample/tweenx/016_EventHandle/assets/img/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/016_EventHandle/assets/img/forward.png -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/bin/BetweenAS3Bench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/bin/BetweenAS3Bench.swf -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/bin/TweenXCoreBench.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/bin/TweenXCoreBench.swf -------------------------------------------------------------------------------- /sample/tweenx/900_TweenXDemo/assets/font/Pixcell.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/900_TweenXDemo/assets/font/Pixcell.ttf -------------------------------------------------------------------------------- /sample/tweenx/900_TweenXDemo/assets/img/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/900_TweenXDemo/assets/img/forward.png -------------------------------------------------------------------------------- /sample/js/sample/context/Drawable.hx: -------------------------------------------------------------------------------- 1 | package sample.context; 2 | 3 | interface Drawable 4 | { 5 | public function draw(context:DrawContext):Void; 6 | } -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/lib/tweener_1_33_74_as3.swc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/lib/tweener_1_33_74_as3.swc -------------------------------------------------------------------------------- /sample/tweenx/900_TweenXDemo/assets/img/bar_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/900_TweenXDemo/assets/img/bar_disable.png -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/expr/InOutKind.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.expr; 2 | 3 | enum InOutKind 4 | { 5 | In; 6 | Out; 7 | InOut; 8 | OutIn; 9 | } -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/expr/TernaryOpKind.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.expr; 2 | 3 | enum TernaryOpKind 4 | { 5 | Crossfade(start:Float, end:Float); 6 | } 7 | -------------------------------------------------------------------------------- /website/core/api/bootstrap/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/core/api/bootstrap/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /website/sample/TweenXDemoHaxe3/img/animation/walk0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/TweenXDemoHaxe3/img/animation/walk0.png -------------------------------------------------------------------------------- /website/sample/TweenXDemoHaxe3/img/animation/walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/TweenXDemoHaxe3/img/animation/walk1.png -------------------------------------------------------------------------------- /website/sample/TweenXDemoHaxe3/img/animation/walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/sample/TweenXDemoHaxe3/img/animation/walk2.png -------------------------------------------------------------------------------- /sample/tweenx/016_EventHandle/assets/img/bar_disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/016_EventHandle/assets/img/bar_disable.png -------------------------------------------------------------------------------- /sample/tweenx/016_EventHandle/assets/img/animation/walk0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/016_EventHandle/assets/img/animation/walk0.png -------------------------------------------------------------------------------- /sample/tweenx/016_EventHandle/assets/img/animation/walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/016_EventHandle/assets/img/animation/walk1.png -------------------------------------------------------------------------------- /sample/tweenx/016_EventHandle/assets/img/animation/walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/016_EventHandle/assets/img/animation/walk2.png -------------------------------------------------------------------------------- /sample/tweenx/900_TweenXDemo/assets/img/animation/walk0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/900_TweenXDemo/assets/img/animation/walk0.png -------------------------------------------------------------------------------- /sample/tweenx/900_TweenXDemo/assets/img/animation/walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/900_TweenXDemo/assets/img/animation/walk1.png -------------------------------------------------------------------------------- /sample/tweenx/900_TweenXDemo/assets/img/animation/walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/900_TweenXDemo/assets/img/animation/walk2.png -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/expr/LineKind.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.expr; 2 | 3 | enum LineKind 4 | { 5 | Bezier; 6 | Polyline; 7 | UniformQuadraticBSpline; 8 | } -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/lib/BetweenAS3-Alpha-r3022-fp10.swc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/lib/BetweenAS3-Alpha-r3022-fp10.swc -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/lib/Tweensy_0_2_22_OriginalCS4.swc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/sample/tweenx/800_BenchMark/lib/Tweensy_0_2_22_OriginalCS4.swc -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/structure/BoundaryMode.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.structure; 2 | 3 | enum abstract BoundaryMode(Int) { 4 | var Low = 0; 5 | var High = 1; 6 | } 7 | -------------------------------------------------------------------------------- /tools/CustumEasing/build.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -cp ../../src/tweenxcore 3 | -lib react:0.3.0 4 | -js ../../website/core/custom/main.js 5 | -main Application 6 | -D react_global 7 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/basic/NumberInputId.hx: -------------------------------------------------------------------------------- 1 | package component.basic; 2 | 3 | enum NumberInputId 4 | { 5 | EasingRate(id:RateId); 6 | AnimationTime; 7 | } -------------------------------------------------------------------------------- /website/core/api/bootstrap/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/core/api/bootstrap/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/output/OutputMode.hx: -------------------------------------------------------------------------------- 1 | package core.output; 2 | 3 | enum OutputMode 4 | { 5 | Haxe; 6 | Json; 7 | Array; 8 | Enum; 9 | Unity; 10 | } -------------------------------------------------------------------------------- /hxml/004.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 750:500:60:FFFFFF 2 | -cp sample/tweenx/004_Easing 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D endless 8 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/EaseX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909; 2 | import tweenxcore.Tools.Easing; 3 | 4 | /** 5 | * for backward compatibility 6 | */ 7 | @:noCompletion 8 | typedef EaseX = Easing; 9 | -------------------------------------------------------------------------------- /tools/chain/Run.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -resource mtt/top.mtt@top 3 | -resource mtt/func1.mtt@func1 4 | -resource mtt/func2.mtt@func2 5 | -resource mtt/func3.mtt@func3 6 | -main Main 7 | --interp 8 | -------------------------------------------------------------------------------- /hxml/017.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/017_Quake 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/Easing.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 750:500:60:FFFFFF 2 | -cp sample/tweenx/004_Easing 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D endless 8 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/advanced/CommandTypeX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.advanced; 2 | import tweenx909.TweenX; 3 | 4 | enum CommandTypeX{ 5 | TWEEN(tween:TweenX); 6 | WAIT(delay:Float); 7 | } 8 | -------------------------------------------------------------------------------- /hxml/002.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/002_GroupTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/007.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/007_LagTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/010.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/010_Default 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/011.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/011_AutoFrom 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/013.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/013_ColorTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/015.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/015_ArrayTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/019.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/019_GroupEase 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/020.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/020_Bezier 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/800.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/800_BenchMark 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/900.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/900_TweenXDemo 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/Bezier.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/020_Bezier 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/Quake.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/017_Quake 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/structure/Direction.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.structure; 2 | 3 | enum abstract Direction(Int) { 4 | var Backward = -1; 5 | var Stopped = 0; 6 | var Forward = 1; 7 | } 8 | -------------------------------------------------------------------------------- /hxml/001.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/001_SimplestTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/003.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/003_MethodChain 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/005.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/005_SerialTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/006.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/006_ParallelTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/008.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/008_WaitAndSkip 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/009.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/009_RepeatTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/012.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/012_TweenFunction 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/014.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/014_TimelineTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/016.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/016_EventHandle 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/018.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/018_RelativeTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/AutoFrom.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/011_AutoFrom 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/BenchMark.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/800_BenchMark 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/Default.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/010_Default 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/GroupEase.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/019_GroupEase 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/LagTween.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/007_LagTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/animation/Animation.hx: -------------------------------------------------------------------------------- 1 | package core.animation; 2 | 3 | interface Animation 4 | { 5 | public function onFrame(time:Float):Void; 6 | public function isDead():Bool; 7 | } -------------------------------------------------------------------------------- /tools/doc/Import.hx: -------------------------------------------------------------------------------- 1 | import haxe.macro.Context; 2 | import tweenx909.*; 3 | 4 | class Import { 5 | public static function run (?path) { 6 | Context.getModule("tweenx909.ChainX"); 7 | } 8 | } -------------------------------------------------------------------------------- /tools/doc/build.bat: -------------------------------------------------------------------------------- 1 | mkdir ..\..\haxedoc 2 | haxe build_xml.hxml 3 | copy template.xml ..\..\haxedoc\template.xml 4 | cd ..\..\haxedoc 5 | haxedoc output.xml -f tweenx909 6 | rm template.xml 7 | rm output.xml -------------------------------------------------------------------------------- /hxml/ArrayTween.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/015_ArrayTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/ColorTween.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/013_ColorTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/EventHandle.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/016_EventHandle 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/GroupTween.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/002_GroupTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/MethodChain.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/003_MethodChain 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/RepeatTween.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/009_RepeatTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/SerialTween.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/005_SerialTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/TweenXDemo.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/900_TweenXDemo 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/WaitAndSkip.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/008_WaitAndSkip 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/ParallelTween.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/006_ParallelTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/RelativeTween.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/018_RelativeTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/SimplestTween.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/001_SimplestTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/TimelineTween.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/014_TimelineTween 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /hxml/TweenFunction.hxml: -------------------------------------------------------------------------------- 1 | -swf-header 401:401:60:FFFFFF 2 | -cp sample/tweenx/012_TweenFunction 3 | -cp src/tweenx 4 | -cp src/tweenxcore 5 | -cp sample/flash 6 | -main sample.main.DirectMain 7 | -D grid_background 8 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/basic/GraphLine.hx: -------------------------------------------------------------------------------- 1 | package component.basic; 2 | import tweenxcore.expr.ComplexEasingKind; 3 | 4 | typedef GraphLine = 5 | { 6 | color: GraphColor, 7 | easing: Float->Float, 8 | } 9 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/expr/ComplexEasingKind.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.expr; 2 | 3 | enum ComplexEasingKind 4 | { 5 | Simple(kind:SimpleEasingKind); 6 | Op(easing:ComplexEasingKind, operation:UnaryOpKind); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/geom/Matrix.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.geom; 2 | 3 | typedef Matrix = { 4 | var a:Float; 5 | var b:Float; 6 | var c:Float; 7 | var d:Float; 8 | var tx:Float; 9 | var ty:Float; 10 | } 11 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/expr/SimpleEasingKind.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.expr; 2 | 3 | enum SimpleEasingKind 4 | { 5 | Linear; 6 | Standard(easing:StandardEasingKind, inOut:InOutKind); 7 | Line(kind:LineKind, controls:Array); 8 | } 9 | -------------------------------------------------------------------------------- /sample/js/sample/player/Player.hx: -------------------------------------------------------------------------------- 1 | package sample.player; 2 | import js.html.MouseEvent; 3 | 4 | interface Player { 5 | public function update():Void; 6 | public function onClick():Void; 7 | public function onMouseMove(event:MouseEvent):Void; 8 | } -------------------------------------------------------------------------------- /src/tweenx/tweenx909/advanced/UpdateModeX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.advanced; 2 | 3 | /** 4 | * ... 5 | * @author shohei909 6 | */ 7 | enum UpdateModeX{ 8 | MANUAL; 9 | TIME(frameRate:Float); 10 | #if (flash) 11 | FRAME; 12 | #end 13 | } 14 | -------------------------------------------------------------------------------- /website/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'jekyll', '4.1.1' 4 | gem 'asciidoctor' 5 | gem 'redcarpet' 6 | gem 'rouge' 7 | 8 | group :jekyll_plugins do 9 | gem 'jekyll-asciidoc' 10 | end 11 | 12 | gem 'wdm', '~> 0.1.0' if Gem.win_platform? 13 | -------------------------------------------------------------------------------- /website/.jekyll-cache/Jekyll/Cache/Jekyll--Cache/b7/9606fb3afea5bd1609ed40b622142f1c98125abcfe89a76a661b0e8e343910: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shohei909/tweenx/HEAD/website/.jekyll-cache/Jekyll/Cache/Jekyll--Cache/b7/9606fb3afea5bd1609ed40b622142f1c98125abcfe89a76a661b0e8e343910 -------------------------------------------------------------------------------- /website/_includes/sample.asciidoc: -------------------------------------------------------------------------------- 1 | ++++ 2 |
3 | ++++ 4 | {sampleLink}tweenxcore/{{include.id}}Sample.hx[[{% if include.lang == "en" %}View sample code {% else %}サンプルコードを見る{% endif %}({{include.id}}Sample)\]] 5 | -------------------------------------------------------------------------------- /website/core/custom/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: tool 3 | title: Easing Editor | TweenXCore 4 | logo: TweenXCore 5 | --- 6 | 7 |
8 | 9 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/drag/DragStateKind.hx: -------------------------------------------------------------------------------- 1 | package core.drag; 2 | import component.basic.NumberSliderDrag; 3 | import component.complex.ComplexEasingDrag; 4 | 5 | enum DragStateKind 6 | { 7 | NumberSlider(detail:NumberSliderDrag); 8 | ComplexEasing(detail:ComplexEasingDrag); 9 | } -------------------------------------------------------------------------------- /sample/js/sample/context/Updatable.hx: -------------------------------------------------------------------------------- 1 | package sample.context; 2 | import js.html.MouseEvent; 3 | 4 | typedef SampleSprite = 5 | { 6 | public function update():Void; 7 | public function draw(context:DrawContext):Void; 8 | public function onMouseMove(e:MouseEvent):Void; 9 | } 10 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/expr/UnaryOpKind.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.expr; 2 | 3 | enum UnaryOpKind 4 | { 5 | Repeat(repeat:Float); 6 | Lerp(from:Float, to:Float); 7 | Clamp(min:Float, max:Float); 8 | RoundTrip(kind:RoundTripKind); 9 | Op(easing:ComplexEasingKind, operation:BinaryOpKind); 10 | } 11 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/expr/BinaryOpKind.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.expr; 2 | 3 | enum BinaryOpKind 4 | { 5 | Composite; 6 | Multiply; 7 | Mix(strength:Float); 8 | Connect(switchTime:Float, switchValue:Float); 9 | OneTwo(switchTime:Float); 10 | Op(easing:ComplexEasingKind, operation:TernaryOpKind); 11 | } 12 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/expr/StandardEasingKind.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.expr; 2 | import tweenxcore.expr.ComplexEasingKind; 3 | 4 | enum StandardEasingKind 5 | { 6 | Quad; 7 | Cubic; 8 | Quart; 9 | Quint; 10 | Sine; 11 | Circ; 12 | Expo; 13 | Back; 14 | Bounce; 15 | Elastic; 16 | Warp; 17 | } -------------------------------------------------------------------------------- /website/_includes/tweenxsample.asciidoc: -------------------------------------------------------------------------------- 1 | +++[{%if page.lang=="ja"%}サンプルを再生{% else %}Play sample{% endif %}]+++ -------------------------------------------------------------------------------- /test/test_cs.hxml: -------------------------------------------------------------------------------- 1 | #1. compile 2 | -main TestMain 3 | -cs bin/cs 4 | -lib nanotest 5 | -cp ../src/tweenxcore 6 | -cp src 7 | 8 | #2. exec 9 | --next 10 | -cmd ""bin/cs/bin/TestMain.exe"" 1>bin/report_cs.txt 11 | 12 | #3. read 13 | --next 14 | -lib nanotest 15 | --macro nanotest.NanoTestRunner.readResult('bin/report_cs.txt', ['test', 'src'], 'C#') 16 | -------------------------------------------------------------------------------- /test/test_cpp.hxml: -------------------------------------------------------------------------------- 1 | #1. compile 2 | -main TestMain 3 | -cpp bin/cpp 4 | -lib nanotest 5 | -cp ../src/tweenxcore 6 | -cp src 7 | 8 | #2. exec 9 | --next 10 | -cmd ""bin/cpp/TestMain.exe"" 1>bin/report_cpp.txt 11 | 12 | #3. read 13 | --next 14 | -lib nanotest 15 | --macro nanotest.NanoTestRunner.readResult('bin/report_cpp.txt', ['test', 'src'], 'C++') 16 | -------------------------------------------------------------------------------- /test/test_js.hxml: -------------------------------------------------------------------------------- 1 | #1. compile 2 | -main TestMain 3 | -js bin/test.js 4 | -lib nanotest 5 | -cp ../src/tweenxcore 6 | -cp src 7 | 8 | 9 | #2. exec 10 | --next 11 | -cmd node "bin/test.js" 1>bin/report_js.txt 12 | 13 | #3. read 14 | --next 15 | -lib nanotest 16 | --macro nanotest.NanoTestRunner.readResult('bin/report_js.txt', ['test', 'src'], 'JS') 17 | -------------------------------------------------------------------------------- /test/test_hl.hxml: -------------------------------------------------------------------------------- 1 | #1. compile 2 | -main TestMain 3 | -hl bin/test.hl 4 | -lib nanotest 5 | -cp ../src/tweenxcore 6 | -cp src 7 | -debug 8 | 9 | #2. execute 10 | --next 11 | -cmd hl "bin/test.hl" 1>bin/report_hl.txt 12 | 13 | #3. read 14 | --next 15 | -lib nanotest 16 | --macro nanotest.NanoTestRunner.readResult('bin/report_hl.txt', ['test', 'src'], 'HL') 17 | -------------------------------------------------------------------------------- /test/test_neko.hxml: -------------------------------------------------------------------------------- 1 | #1. compile 2 | -main TestMain 3 | -neko bin/test.n 4 | -lib nanotest 5 | -cp ../src/tweenxcore 6 | -cp src 7 | 8 | #2. execute 9 | --next 10 | -cmd neko "bin/test.n" 1>bin/report_neko.txt 11 | 12 | #3. read 13 | --next 14 | -lib nanotest 15 | --macro nanotest.NanoTestRunner.readResult('bin/report_neko.txt', ['test', 'src'], 'Neko') 16 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/localize/ResourceKey.hx: -------------------------------------------------------------------------------- 1 | package core.localize; 2 | 3 | enum ResourceKey 4 | { 5 | Title; 6 | Min; 7 | Max; 8 | From; 9 | To; 10 | AnimationTime; 11 | SwitchTime; 12 | SwitchValue; 13 | Undo; 14 | Redo; 15 | Weight; 16 | Repeat; 17 | DropToMove; 18 | DropToDuplicate; 19 | } 20 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/basic/GraphColor.hx: -------------------------------------------------------------------------------- 1 | package component.basic; 2 | 3 | #if (haxe_ver < 4.3) @:enum #else enum #end 4 | abstract GraphColor(Int) to Int 5 | { 6 | var Theme = 0x0E5ABB; 7 | var Sub = 0xFF64B1; 8 | 9 | public function toColorString():String 10 | { 11 | return "#" + StringTools.hex(this, 6); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sample/flash/sample/SampleSuport.hx: -------------------------------------------------------------------------------- 1 | package sample; 2 | 3 | import flash.display.BlendMode; 4 | import flash.display.Graphics; 5 | import flash.display.Shape; 6 | import flash.display.Sprite; 7 | import flash.display.StageScaleMode; 8 | import flash.events.MouseEvent; 9 | import flash.Lib; 10 | import tweenxcore.color.HsvColor; 11 | using tweenxcore.Tools; 12 | 13 | -------------------------------------------------------------------------------- /test/test_java.hxml: -------------------------------------------------------------------------------- 1 | #1. compile 2 | -main TestMain 3 | -java bin/java 4 | -lib nanotest 5 | -cp ../src/tweenxcore 6 | -cp src 7 | 8 | #2. exec 9 | --next 10 | -cmd java -jar ""bin/java/TestMain.jar"" 1>bin/report_java.txt 11 | 12 | #3. read 13 | --next 14 | -lib nanotest 15 | --macro nanotest.NanoTestRunner.readResult('bin/report_java.txt', ['test', 'src'], 'Java') 16 | -------------------------------------------------------------------------------- /test/test_objc.hxml: -------------------------------------------------------------------------------- 1 | #1. compile 2 | -main TestMain 3 | -cpp bin/objc 4 | -D objc 5 | -lib nanotest 6 | -cp ../src/tweenxcore 7 | -cp src 8 | 9 | #2. exec 10 | --next 11 | -cmd ""bin/cpp/TestMain.exe"" 1>bin/report_cpp.txt 12 | 13 | #3. read 14 | --next 15 | -lib nanotest 16 | --macro nanotest.NanoTestRunner.readResult('bin/report_cpp.txt', ['test', 'src'], 'C++') 17 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/drag/DragState.hx: -------------------------------------------------------------------------------- 1 | package core.drag; 2 | import component.basic.NumberInputId; 3 | import component.basic.NumberSliderDrag; 4 | import js.html.MouseEvent; 5 | 6 | interface DragState 7 | { 8 | public var kind(default, null):DragStateKind; 9 | public function move(e:MouseEvent):Void; 10 | public function finish():Void; 11 | } 12 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/focus/FocusState.hx: -------------------------------------------------------------------------------- 1 | package core.focus; 2 | import component.basic.NumberInputFocus; 3 | import component.complex.ComplexEasingSelectFocus; 4 | import component.complex.ComplexEasingId; 5 | 6 | enum FocusState 7 | { 8 | ComplexEasingSelect(detail:ComplexEasingSelectFocus); 9 | NumberInput(detail:NumberInputFocus); 10 | None; 11 | } -------------------------------------------------------------------------------- /tools/chain/src/mtt/func1.mtt: -------------------------------------------------------------------------------- 1 | ::if !array::#if haxe3 ::end::static public function ::(prefix + name)::>(tween:T, ::name:::::class::):T { ::if !array::#else static public function ::(prefix + name)::(tween:StandardTweenX, ::name:::::class::) { #end ::end:: var t:IStandardTweenX = tween; t._::method::("::name::", ::name::); return tween; } -------------------------------------------------------------------------------- /tools/ChainMaker/src/mtt/func1.mtt: -------------------------------------------------------------------------------- 1 | ::if !array::#if haxe3 ::end::static public function ::(prefix + name)::>(tween:T, ::name:::::class::):T { ::if !array::#else static public function ::(prefix + name)::(tween:StandardTweenX, ::name:::::class::) { #end ::end:: var t:IStandardTweenX = tween; t._::method::("::name::", ::name::); return tween; } -------------------------------------------------------------------------------- /src/tweenx/tweenx909/rule/RuleX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.rule; 2 | import tweenx909.TweenX; 3 | 4 | /** 5 | * ... 6 | * @author shohei909 7 | */ 8 | typedef RuleX = { 9 | public var inputClass(default,null):Dynamic; 10 | public function calc(_from:T1, _to:T1, t1:Float, t2:Float,tween:TweenX):T2; 11 | public function defaultFrom(value:T2, _to:T1, tween:TweenX):T1; 12 | } 13 | -------------------------------------------------------------------------------- /test/src/TestMain.hx: -------------------------------------------------------------------------------- 1 | package; 2 | import cases.ExpoBenchCase; 3 | import cases.ExprTestCase; 4 | import nanotest.NanoTestRunner; 5 | 6 | class TestMain { 7 | 8 | public static function main() 9 | { 10 | var runner = new NanoTestRunner(); 11 | runner.add(new ExprTestCase()); 12 | runner.add(new ExpoBenchCase()); 13 | runner.run(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sample/flash/sample/Square.hx: -------------------------------------------------------------------------------- 1 | package sample; 2 | import flash.display.Shape; 3 | import sample.component.SamplePlayer; 4 | 5 | class Square extends Shape 6 | { 7 | public static inline var SIZE:Int = 30; 8 | 9 | public function new() { 10 | super(); 11 | graphics.beginFill(SamplePlayer.THEME_COLOR); 12 | graphics.drawRect( -SIZE / 2, -SIZE / 2, SIZE, SIZE); 13 | } 14 | } -------------------------------------------------------------------------------- /src/tweenx/haxelib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tweenx", 3 | "url" : "https://github.com/shohei909/tweenx", 4 | "license": "MIT", 5 | "tags": ["flash", "cpp", "js", "neko", "tween"], 6 | "description": "crossplatform tween library", 7 | "version": "1.0.1", 8 | "releasenote": "fix for Haxe 3.2.1", 9 | "contributors": ["shohei909"], 10 | "dependencies": { 11 | "tweenxcore": "1.0.1" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sample/flash/sample/main/DirectMain.hx: -------------------------------------------------------------------------------- 1 | package sample.main; 2 | 3 | import flash.display.StageAlign; 4 | import flash.display.StageScaleMode; 5 | import flash.Lib; 6 | 7 | class DirectMain { 8 | static function main() { 9 | var stage = Lib.current.stage; 10 | stage.scaleMode = StageScaleMode.NO_SCALE; 11 | stage.align = StageAlign.TOP_LEFT; 12 | Lib.current.addChild(new Main()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/tweenxcore/haxelib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tweenxcore", 3 | "url" : "https://github.com/shohei909/tweenx", 4 | "license": "MIT", 5 | "tags": ["flash", "js", "neko", "cs", "cpp", "java", "cross", "tween", "motion"], 6 | "description": "lightweight motion library for haxe", 7 | "version": "1.0.3", 8 | "releasenote": "minor improvement", 9 | "contributors": ["shohei909"], 10 | "dependencies": {} 11 | } 12 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/advanced/TweenTypeX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.advanced; 2 | 3 | /** 4 | * 5 | * @author shohei909 6 | */ 7 | enum TweenTypeX { 8 | GROUP(group:GroupX); 9 | ARRAY(targets:Iterable, _from:Array, _to:Array); 10 | FROM_TO(target:Dynamic, _from:Dynamic, _to:Dynamic); 11 | FUNC(func:Dynamic, _from:Array, _to:Array); 12 | CALL(func:Void->Void); 13 | } 14 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/color/ITransparentColor.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.color; 2 | 3 | interface ITransparentColor extends IColor { 4 | 5 | public function toArgb():ArgbColor; 6 | public function toAhsv():AhsvColor; 7 | 8 | public function getAlpha():Float; 9 | 10 | public function toArgbInt():Int; 11 | public function toArgbHexString():String; 12 | public function toRgbaCssString():String; 13 | } 14 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/advanced/CommandX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.advanced; 2 | import haxe.io.Error; 3 | import haxe.Log; 4 | import haxe.PosInfos; 5 | 6 | class CommandX { 7 | public var command (default, null):CommandTypeX; 8 | public var definedPosInfos(default, null):PosInfos; 9 | function new (command:CommandTypeX, ?posInfos:PosInfos) { 10 | this.command = command; this.definedPosInfos = posInfos; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Dox.hxml: -------------------------------------------------------------------------------- 1 | -cp src/tweenx 2 | -cp src/tweenxcore 3 | -D doc-gen 4 | --macro include('tweenxcore') 5 | --no-output 6 | -xml xml/flash.xml 7 | -swf dummy.swf 8 | 9 | --next 10 | -cmd haxelib run dox -i xml -o website/core/api/ -in tweenx --title "TweenXCore API" -D source-path https://github.com/shohei909/tweenx/tree/master/src/tweenxcore -D themeColor "0x8C0327" -D textColor 0xFFFFFF -D website "http://tweenx.spheresofa.net/core/en.html" -D version "1.0.0" 11 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/structure/FloatChangePart.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.structure; 2 | 3 | 4 | class FloatChangePart extends FloatChange { 5 | public inline function isEntrance():Bool { 6 | return (previous <= 0 && 0 < current) || (current < 1.0 && 1.0 <= previous); 7 | } 8 | 9 | public inline function isExit():Bool { 10 | return (current <= 0.0 && 0.0 < previous) || (previous < 1.0 && 1.0 <= current); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tools/chain/src/mtt/func2.mtt: -------------------------------------------------------------------------------- 1 | ::if !array::#if haxe3 ::end::static public function ::(prefix + name)::>( tween:T, ::name1:::::class::, ::name2:::::class:: ):T { ::if !array::#else static public function ::(prefix + name)::(tween:StandardTweenX, ::name1:::::class::, ::name2:::::class::) { #end ::end:: var t:IStandardTweenX = tween; t._::method::("::name1::", ::name1:: ); t._::method::("::name2::", ::name2:: ); return tween; } -------------------------------------------------------------------------------- /tools/ChainMaker/src/mtt/func2.mtt: -------------------------------------------------------------------------------- 1 | ::if !array::#if haxe3 ::end::static public function ::(prefix + name)::>( tween:T, ::name1:::::class::, ::name2:::::class:: ):T { ::if !array::#else static public function ::(prefix + name)::(tween:StandardTweenX, ::name1:::::class::, ::name2:::::class::) { #end ::end:: var t:IStandardTweenX = tween; t._::method::("::name1::", ::name1:: ); t._::method::("::name2::", ::name2:: ); return tween; } -------------------------------------------------------------------------------- /sample/js/sample/context/DrawContext.hx: -------------------------------------------------------------------------------- 1 | package sample.context; 2 | import js.html.CanvasRenderingContext2D; 3 | import js.html.CanvasElement; 4 | 5 | class DrawContext 6 | { 7 | public var context(default, null):CanvasRenderingContext2D; 8 | public var canvas(default, null):CanvasElement; 9 | 10 | public function new(canvas:CanvasElement, context:CanvasRenderingContext2D) 11 | { 12 | this.context = context; 13 | this.canvas = canvas; 14 | } 15 | } -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/easing/EasingCommand.hx: -------------------------------------------------------------------------------- 1 | package core.easing; 2 | import component.basic.RateId; 3 | import component.complex.ComplexEasingId; 4 | import tweenxcore.expr.ComplexEasingKind; 5 | import tweenxcore.expr.InOutKind; 6 | 7 | enum EasingCommand 8 | { 9 | Replace(easing:ComplexEasingKind); 10 | InOut(inOut:InOutKind); 11 | Rate(index:Int, rate:Float); 12 | AddRate(index:Int); 13 | RemoveRate(index:Int); 14 | Move(fromId:ComplexEasingId); 15 | Paste(fromId:ComplexEasingId); 16 | } -------------------------------------------------------------------------------- /src/tweenx/tweenx909/rule/QuakeX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.rule; 2 | using tweenxcore.Tools.Easing; 3 | 4 | /** 5 | * ... 6 | * @author shohei909 7 | */ 8 | class QuakeX 9 | { 10 | public var ease:Float->Float; 11 | public var value:Float; 12 | public var scale:Float; 13 | 14 | public function new(value:Float, scale:Float, ease:Float->Float = null) { 15 | this.value = value; 16 | this.scale = scale; 17 | if (ease == null) this.ease = Easing.warpOut; 18 | else this.ease = ease; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/localize/LocalizeResource.hx: -------------------------------------------------------------------------------- 1 | package core.localize; 2 | import component.complex.ComplexEasingSelectItemId; 3 | import core.output.OutputMode; 4 | import tweenxcore.expr.InOutKind; 5 | 6 | interface LocalizeResource 7 | { 8 | public function common(key:ResourceKey):String; 9 | public function easingItem(item:ComplexEasingSelectItemId):String; 10 | public function outputMode(mode:OutputMode):String; 11 | public function inOut(kind:InOutKind):String; 12 | public function getCode():String; 13 | } 14 | -------------------------------------------------------------------------------- /tools/chain/src/mtt/top.mtt: -------------------------------------------------------------------------------- 1 | package tweenx909; import tweenx909.advanced.StandardTweenX; import tweenx909.rule.TimelineX; class ChainX { ::content1::} #if (haxe3 || !doc_gen) class ArrayChainX { ::content2::} #end private typedef IntOrColor = Dynamic; private typedef IStandardTweenX = { private function _getTarget():T; private function checkInited():Void; private function _setTo( key:String, value:Dynamic ):Void; private function _setRelativeTo(key:String, value:Dynamic ):Void; private function _setRelativeTo2(key:String, value:Dynamic ):Void; } -------------------------------------------------------------------------------- /tools/ChainMaker/src/mtt/top.mtt: -------------------------------------------------------------------------------- 1 | package tweenx909; import tweenx909.advanced.StandardTweenX; import tweenx909.rule.TimelineX; class ChainX { ::content1::} #if (haxe3 || !doc_gen) class ArrayChainX { ::content2::} #end private typedef IntOrColor = Dynamic; private typedef IStandardTweenX = { private function _getTarget():T; private function checkInited():Void; private function _setTo( key:String, value:Dynamic ):Void; private function _setRelativeTo(key:String, value:Dynamic ):Void; private function _setRelativeTo2(key:String, value:Dynamic ):Void; } -------------------------------------------------------------------------------- /tools/chain/src/mtt/func3.mtt: -------------------------------------------------------------------------------- 1 | ::if !array::#if haxe3 ::end::static public function ::(prefix + name)::>( tween:T, ::name1:::::class::, ::name2:::::class::, ::name3:::::class:: ):T { ::if !array::#else static public function ::(prefix + name)::(tween:StandardTweenX, ::name1:::::class::, ::name2:::::class::, ::name3:::::class::) { #end ::end:: var t:IStandardTweenX = tween; t._::method::("::name1::", ::name1:: ); t._::method::("::name2::", ::name2:: ); t._::method::("::name3::", ::name3:: ); return tween; } -------------------------------------------------------------------------------- /tools/ChainMaker/src/mtt/func3.mtt: -------------------------------------------------------------------------------- 1 | ::if !array::#if haxe3 ::end::static public function ::(prefix + name)::>( tween:T, ::name1:::::class::, ::name2:::::class::, ::name3:::::class:: ):T { ::if !array::#else static public function ::(prefix + name)::(tween:StandardTweenX, ::name1:::::class::, ::name2:::::class::, ::name3:::::class::) { #end ::end:: var t:IStandardTweenX = tween; t._::method::("::name1::", ::name1:: ); t._::method::("::name2::", ::name2:: ); t._::method::("::name3::", ::name3:: ); return tween; } -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/RootCommand.hx: -------------------------------------------------------------------------------- 1 | package core; 2 | import component.basic.RateId; 3 | import component.complex.ComplexEasingId; 4 | import core.easing.EasingCommand; 5 | import core.localize.LocaleKind; 6 | import core.output.OutputMode; 7 | import tweenxcore.expr.ComplexEasingKind; 8 | import tweenxcore.expr.InOutKind; 9 | 10 | enum RootCommand 11 | { 12 | ChangeEasing(id:ComplexEasingId, command:EasingCommand); 13 | ChangeAnimationTime(rate:Float); 14 | ChangeOutputMode(mode:OutputMode); 15 | ChangeLocale(locale:LocaleKind); 16 | } 17 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/rule/BoolRuleX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.rule; 2 | import tweenx909.TweenX; 3 | 4 | /** 5 | * Bool値に対するルール。 6 | * falseを0,trueを1とみなしてトゥイーンした後、 7 | * 0以下の数値をfalse、その他の数値をtrueとみなしてターゲットに値を反映 8 | * @author shohei909 9 | */ 10 | 11 | class BoolRuleX{ 12 | public static var inputClass(default,null):Dynamic = Bool; 13 | public static function calc(_from:Bool, _to:Bool, t1:Float, t2:Float, tween:TweenX):Bool { 14 | return 0 < (_from?1:0) * t2 + (_to?1:0) * t1; 15 | } 16 | public static function defaultFrom(value:Bool, _to:Bool, tween:TweenX):Bool { return value; } 17 | } 18 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/EventX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909; 2 | 3 | /** 4 | * ... 5 | * @author shohei909 6 | */ 7 | 8 | class EventX { 9 | public static inline var PLAY = "play"; 10 | public static inline var DELAY = "delay"; 11 | public static inline var HEAD = "head"; 12 | public static inline var UPDATE = "update"; 13 | public static inline var FOOT = "foot"; 14 | public static inline var INTERVAL = "interval"; 15 | public static inline var REPEAT = "repeat"; 16 | public static inline var REST = "rest"; 17 | public static inline var FINISH = "finish"; 18 | public static inline var STOP = "stop"; 19 | } 20 | -------------------------------------------------------------------------------- /sample/tweenxcore/SimplestSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | using tweenxcore.Tools; 4 | 5 | class SimplestSample extends Sprite { 6 | public static var TOTAL_FRAME:Int = 20; 7 | private var square:Square; 8 | private var frameCount = 0; 9 | 10 | public function new() { 11 | super(); 12 | addChild(square = new Square()); 13 | square.y = Square.SIZE * 2; 14 | } 15 | 16 | public function update():Void { 17 | var rate = frameCount / TOTAL_FRAME; 18 | if (rate <= 1) { 19 | square.x = rate.quintOut().lerp(0, 450); 20 | } 21 | frameCount++; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/binary/CompositeView.hx: -------------------------------------------------------------------------------- 1 | package component.binary; 2 | import api.react.React; 3 | import api.react.ReactComponent; 4 | import api.react.ReactComponent.ReactComponentOfProps; 5 | import tweenxcore.expr.ComplexEasingKind; 6 | 7 | class CompositeView extends ReactComponentOfProps 8 | { 9 | public function new(props:CompositeProps) 10 | { 11 | super(props); 12 | } 13 | 14 | override public function render():ReactComponent 15 | { 16 | return null; 17 | } 18 | } 19 | 20 | typedef CompositeProps = 21 | { 22 | easing1: ComplexEasingKind, 23 | easing2: ComplexEasingKind, 24 | } 25 | -------------------------------------------------------------------------------- /sample/js/sample/Sprite.hx: -------------------------------------------------------------------------------- 1 | package sample; 2 | import js.html.MouseEvent; 3 | import sample.context.DrawContext; 4 | import sample.context.Drawable; 5 | 6 | class Sprite implements Drawable { 7 | private var children:Array; 8 | 9 | public function new() { 10 | children = []; 11 | } 12 | 13 | public function addChild(child:Drawable):Void { 14 | children.push(child); 15 | } 16 | 17 | public function draw(context:DrawContext):Void { 18 | for (child in children) { 19 | child.draw(context); 20 | } 21 | } 22 | 23 | public function onMouseMove(e:MouseEvent):Void { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/react/ReactTools.hx: -------------------------------------------------------------------------------- 1 | package react; 2 | import api.react.React; 3 | import api.react.ReactComponent; 4 | import api.react.ReactComponent.ReactComponentOfProps; 5 | 6 | class ReactTools 7 | { 8 | public static function createElement(type:Class>, ?attrs:TProps):ReactComponentOfProps 9 | { 10 | return cast React.createElement(type, attrs); 11 | } 12 | } 13 | 14 | class ReactStringTools 15 | { 16 | public static function createElement(type:String, attrs:Dynamic, ?children0:Dynamic):ReactComponent 17 | { 18 | return cast React.createElement(type, attrs, children0); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /sample/tweenxcore/EasingSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | using tweenxcore.Tools; 4 | 5 | class EasingSample extends Sprite { 6 | public static var TOTAL_FRAME:Int = 20; 7 | 8 | private var square:Square; 9 | private var frameCount:Int = 0; 10 | 11 | public function new() { 12 | super(); 13 | addChild(square = new Square()); 14 | square.y = Square.SIZE * 2; 15 | } 16 | 17 | 18 | public function update():Void { 19 | var rate = frameCount / TOTAL_FRAME; 20 | if (rate <= 1) { 21 | square.x = rate.cubicIn().lerp(0, 450); 22 | } 23 | frameCount++; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sample/tweenxcore/YoyoSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | using tweenxcore.Tools; 4 | 5 | class YoyoSample extends Sprite { 6 | public static var TOTAL_FRAME:Int = 40; 7 | 8 | private var square:Square; 9 | private var frameCount:Int = 0; 10 | 11 | public function new() { 12 | super(); 13 | addChild(square = new Square()); 14 | square.y = Square.SIZE * 2; 15 | } 16 | 17 | 18 | public function update():Void { 19 | var rate = frameCount / TOTAL_FRAME; 20 | if (rate <= 1) { 21 | square.x = rate.yoyo(Easing.quintOut).lerp(0, 450); 22 | } 23 | frameCount++; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/advanced/GroupX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.advanced; 2 | import tweenx909.TweenX; 3 | 4 | /** @private */ 5 | @:noCompletion 6 | class GroupX { 7 | public var current:Float = 0; 8 | public var tweens:Array; 9 | public var source:Iterable; 10 | public var type:GroupTypeX; 11 | public var defaults:DefaultsX; 12 | 13 | public function new(source:Iterable, type:GroupTypeX, defaults:DefaultsX) { 14 | this.source = source; 15 | this.type = type; 16 | if (defaults != null) this.defaults = defaults.clone(); 17 | } 18 | } 19 | 20 | private enum GroupTypeX { 21 | SERIAL; 22 | LAG(lag:Float); 23 | } 24 | -------------------------------------------------------------------------------- /sample/tweenxcore/CrossOverSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | import tweenxcore.structure.FloatChange; 4 | import tweenxcore.structure.FloatChangePart; 5 | using tweenxcore.Tools; 6 | 7 | class CrossOverSample extends Sprite { 8 | public static var TOTAL_FRAME:Int = 60; 9 | 10 | private var square:Square; 11 | private var frameCount:Int = 0; 12 | 13 | public function update():Void { 14 | var floatChange = new FloatChange(frameCount, frameCount += 1); 15 | if (floatChange.isCrossOver(30.0)) { 16 | addChild(square = new Square()); 17 | square.width = 481; 18 | square.height = 151; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sample/tweenxcore/ZigzagSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | using tweenxcore.Tools; 4 | 5 | class ZigzagSample extends Sprite { 6 | public static var TOTAL_FRAME:Int = 40; 7 | 8 | private var square:Square; 9 | private var frameCount:Int = 0; 10 | 11 | public function new() { 12 | super(); 13 | addChild(square = new Square()); 14 | square.y = Square.SIZE * 2; 15 | } 16 | 17 | 18 | public function update():Void { 19 | var rate = frameCount / TOTAL_FRAME; 20 | if (rate <= 1) { 21 | square.x = rate.zigzag(Easing.quintOut).lerp(0, 450); 22 | } 23 | frameCount++; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sample/tweenxcore/CompositeSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | using tweenxcore.Tools; 4 | 5 | class CompositeSample extends Sprite { 6 | public static var TOTAL_FRAME:Int = 40; 7 | 8 | private var square:Square; 9 | private var frameCount:Int = 0; 10 | 11 | public function new() { 12 | super(); 13 | addChild(square = new Square()); 14 | square.y = Square.SIZE * 2; 15 | } 16 | 17 | 18 | public function update():Void { 19 | var rate = frameCount / TOTAL_FRAME; 20 | if (rate <= 1) { 21 | square.x = rate.cubicIn().bounceOut().lerp(0, 450); 22 | } 23 | frameCount++; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sample/tweenxcore/MixSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | using tweenxcore.Tools; 4 | 5 | class MixSample extends Sprite { 6 | public static var TOTAL_FRAME:Int = 40; 7 | 8 | private var square:Square; 9 | private var frameCount:Int = 0; 10 | 11 | public function new() { 12 | super(); 13 | addChild(square = new Square()); 14 | square.y = Square.SIZE * 2; 15 | } 16 | 17 | 18 | public function update():Void { 19 | var rate = frameCount / TOTAL_FRAME; 20 | if (rate <= 1) { 21 | square.x = rate.mixEasing(Easing.expoOutIn, Easing.linear, 0.18).lerp(0, 450); 22 | } 23 | frameCount++; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/basic/RateId.hx: -------------------------------------------------------------------------------- 1 | package component.basic; 2 | import component.complex.ComplexEasingId; 3 | 4 | abstract RateId(String) 5 | { 6 | public function new (array:Array) 7 | { 8 | this = array.join("."); 9 | } 10 | 11 | public function rateIndex():Int 12 | { 13 | return Std.parseInt(this.split(".").pop()); 14 | } 15 | 16 | public function parent():ComplexEasingId 17 | { 18 | var arr = this.split("."); 19 | arr.pop(); 20 | 21 | return new ComplexEasingId([for (str in arr) Std.parseInt(str)]); 22 | } 23 | 24 | public function toString():String 25 | { 26 | return this; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sample/tweenxcore/OneTwoSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | using tweenxcore.Tools; 4 | 5 | class OneTwoSample extends Sprite { 6 | public static var TOTAL_FRAME:Int = 40; 7 | 8 | private var square:Square; 9 | private var frameCount:Int = 0; 10 | 11 | public function new() { 12 | super(); 13 | addChild(square = new Square()); 14 | square.y = Square.SIZE * 2; 15 | } 16 | 17 | 18 | public function update():Void { 19 | var rate = frameCount / TOTAL_FRAME; 20 | if (rate <= 1) { 21 | square.x = rate.oneTwoEasing(Easing.backIn, Easing.linear, 0.7).lerp(30, 420); 22 | } 23 | frameCount++; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sample/js/sample/Square.hx: -------------------------------------------------------------------------------- 1 | package sample; 2 | import sample.context.DrawContext; 3 | import sample.context.Drawable; 4 | import tweenxcore.color.IColor; 5 | 6 | class Square implements Drawable { 7 | public static inline var SIZE:Int = 30; 8 | public var x:Float = 0; 9 | public var y:Float = 0; 10 | public var width:Float = SIZE; 11 | public var height:Float = SIZE; 12 | public var color:IColor; 13 | 14 | public function new() 15 | { 16 | this.color = Style.THEME_COLOR; 17 | } 18 | 19 | public function draw(context:DrawContext):Void 20 | { 21 | context.context.fillStyle = color.toRgbCssString(); 22 | context.context.fillRect(x, y, width, height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample/tweenxcore/ConnectSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | using tweenxcore.Tools; 4 | 5 | class ConnectSample extends Sprite { 6 | public static var TOTAL_FRAME:Int = 40; 7 | 8 | private var square:Square; 9 | private var frameCount:Int = 0; 10 | 11 | public function new() { 12 | super(); 13 | addChild(square = new Square()); 14 | square.y = Square.SIZE * 2; 15 | } 16 | 17 | 18 | public function update():Void { 19 | var rate = frameCount / TOTAL_FRAME; 20 | if (rate <= 1) { 21 | square.x = rate.connectEasing(Easing.backOut, Easing.linear, 0.9, 0.4).lerp(0, 450); 22 | } 23 | frameCount++; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/rule/HsvRuleX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.rule; 2 | import tweenxcore.color.HsvColor; 3 | import tweenx909.TweenX; 4 | 5 | /** 6 | * ... 7 | * @author shohei909 8 | */ 9 | class HsvRuleX { 10 | public static var inputClass(default, null):Dynamic = HsvColor; 11 | 12 | public static function calc(_from:HsvColor, _to:HsvColor, t1:Float, t2:Float, tween:TweenX):Int { 13 | var h = _from.h * t2 + _to.h * t1; 14 | var s = _from.s * t2 + _to.s * t1; 15 | var v = _from.v * t2 + _to.v * t1; 16 | 17 | return HsvColor.hsvToRgbInt(h, s, v); 18 | } 19 | 20 | public static function defaultFrom(value:Int, _to:HsvColor, tween:TweenX) { 21 | return HsvColor.of(value); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/rule/RgbRuleX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.rule; 2 | import tweenxcore.color.RgbColor; 3 | import tweenx909.TweenX; 4 | 5 | /** 6 | * ... 7 | * @author shohei909 8 | */ 9 | class RgbRuleX { 10 | public static var inputClass(default, null):Dynamic = RgbColor; 11 | 12 | public static function calc(_from:RgbColor, _to:RgbColor, t1:Float, t2:Float, tween:TweenX):Int { 13 | var r = _from.r * t2 + _to.r * t1; 14 | var g = _from.g * t2 + _to.g * t1; 15 | var b = _from.b * t2 + _to.b * t1; 16 | return RgbColor.rgbToInt(r, g, b); 17 | } 18 | 19 | public static function defaultFrom(value:Int, _to:RgbColor, tween:TweenX):RgbColor { 20 | return RgbColor.of(value); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/color/IColor.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.color; 2 | 3 | interface IColor 4 | { 5 | public function getRed():Float; 6 | public function getGreen():Float; 7 | public function getBlue():Float; 8 | 9 | public function getHue():Float; 10 | public function getSaturation():Float; 11 | public function getBrightness():Float; 12 | 13 | public function toRgb():RgbColor; 14 | public function toHsv():HsvColor; 15 | public function toRgbWithAlpha(alpha:Float):ArgbColor; 16 | public function toHsvWithAlpha(alpha:Float):AhsvColor; 17 | 18 | public function toRgbInt():Int; 19 | public function toRgbHexString():String; 20 | public function toRgbCssString():String; 21 | } 22 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/structure/TimelineSearchResult.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.structure; 2 | using tweenxcore.Tools; 3 | 4 | class TimelineSearchResult{ 5 | public var data(default, null):T; 6 | public var index(default, null):Int; 7 | public var rangeLeft(default, null):Float; 8 | public var rangeRight(default, null):Float; 9 | 10 | public inline function new(data:T, index:Int, rangeLeft:Float, rangeRight:Float) { 11 | this.data = data; 12 | this.index = index; 13 | this.rangeLeft = rangeLeft; 14 | this.rangeRight = rangeRight; 15 | } 16 | 17 | public inline function innerRate(rate:Float) 18 | { 19 | return rate.inverseLerp(rangeLeft, rangeRight); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/binary/MultiplyView.hx: -------------------------------------------------------------------------------- 1 | package component.binary; 2 | import api.react.React; 3 | import api.react.ReactComponent; 4 | import api.react.ReactComponent.ReactComponentOfProps; 5 | import component.complex.ComplexEasingId; 6 | import core.RootContext; 7 | import tweenxcore.expr.ComplexEasingKind; 8 | 9 | class MultiplyView extends ReactComponentOfProps 10 | { 11 | public function new(props:MultiplyProps) 12 | { 13 | super(props); 14 | } 15 | 16 | override public function render():ReactComponent 17 | { 18 | return null; 19 | } 20 | } 21 | 22 | typedef MultiplyProps = 23 | { 24 | easing1: ComplexEasingKind, 25 | easing2: ComplexEasingKind 26 | } 27 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/complex/ComplexEasingSelectItemId.hx: -------------------------------------------------------------------------------- 1 | package component.complex; 2 | 3 | enum ComplexEasingSelectItemId 4 | { 5 | Linear; 6 | 7 | // Standard 8 | Quad; 9 | Cubic; 10 | Quart; 11 | Quint; 12 | Sine; 13 | Circ; 14 | Expo; 15 | Back; 16 | Bounce; 17 | Elastic; 18 | Warp; 19 | 20 | // Free line 21 | Polyline; 22 | Bezier; 23 | UniformQuadraticBSpline; 24 | 25 | // Unary Op 26 | Repeat; 27 | Lerp; 28 | Clamp; 29 | Yoyo; 30 | Zigzag; 31 | 32 | // Binary Op 33 | Composite; 34 | Multiply; 35 | Mix; 36 | Connect; 37 | OneTwo; 38 | 39 | // Ternary Op 40 | Crossfade; 41 | } 42 | -------------------------------------------------------------------------------- /sample/flash/sample/component/PlayButtonShadow.hx: -------------------------------------------------------------------------------- 1 | package sample.component; 2 | import flash.display.Sprite; 3 | import sample.component.SamplePlayer; 4 | import tweenxcore.color.HsvColor; 5 | using tweenxcore.Tools; 6 | 7 | class PlayButtonShadow extends Sprite 8 | { 9 | public function new() { 10 | super(); 11 | 12 | var color = HsvColor.of(SamplePlayer.THEME_COLOR); 13 | color.s = color.s.sineOut(); 14 | color.v = color.v.lerp(0.1, 0.3); 15 | 16 | graphics.beginFill(color.toRgbInt(), 0.4); 17 | var size = PlayButton.SIZE * 1.1; 18 | 19 | graphics.moveTo(0, -2); 20 | graphics.lineTo(-size, 0); 21 | graphics.lineTo(size, 0); 22 | 23 | graphics.endFill(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /website/sample/TweenXDemoHaxe3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | TweenXDemo 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/rule/ArgbRuleX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.rule; 2 | import tweenxcore.color.ArgbColor; 3 | import tweenx909.TweenX; 4 | 5 | /** 6 | * ... 7 | * @author shohei909 8 | */ 9 | class ArgbRuleX { 10 | public static var inputClass(default, null):Dynamic = ArgbColor; 11 | 12 | public static function calc(_from:ArgbColor, _to:ArgbColor, t1:Float, t2:Float, tween:TweenX):Int { 13 | var a = _from.a * t2 + _to.a * t1; 14 | var r = _from.r * t2 + _to.r * t1; 15 | var g = _from.g * t2 + _to.g * t1; 16 | var b = _from.b * t2 + _to.b * t1; 17 | 18 | return ArgbColor.argbToInt(a, r, g, b); 19 | } 20 | 21 | public static function defaultFrom(value:Int, _to:ArgbColor, tween:TweenX) { 22 | return ArgbColor.of(value); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /website/core/api/highlighter.css: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | Code Highlighting 4 | **/ 5 | 6 | html pre, html pre code { 7 | font-family: consolas, monospace; 8 | white-space: pre; 9 | overflow-x: auto; 10 | } 11 | pre { 12 | color: #333; 13 | margin: 15px 0; 14 | padding: 0.5em; 15 | } 16 | pre .type { 17 | color: #0086b3; 18 | } 19 | pre .kwd { 20 | color: #00a; 21 | } 22 | pre .val { 23 | color: #44a; 24 | } 25 | pre .str, div.pre .str, pre .str .kwd, pre .str .val, pre .str .type { 26 | color: #a00; 27 | } 28 | pre .cmt { 29 | color: #008800; 30 | color: #998; 31 | font-style: italic; 32 | } 33 | /* Make sure keywords inside comments are not highlighted*/ 34 | pre .cmt .kwd, pre .cmt .str, pre .cmt .val, pre .cmt .type { 35 | color: #998; 36 | } 37 | 38 | .last-modified { 39 | color:#999; 40 | } -------------------------------------------------------------------------------- /src/tweenx/tweenx909/rule/AhsvRuleX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.rule; 2 | import tweenxcore.color.AhsvColor; 3 | import tweenx909.TweenX; 4 | 5 | /** 6 | * ... 7 | * @author shohei909 8 | */ 9 | class AhsvRuleX { 10 | public static var inputClass(default, null):Dynamic = AhsvColor; 11 | 12 | public static function calc(_from:AhsvColor, _to:AhsvColor, t1:Float, t2:Float, tween:TweenX):Int { 13 | var a = _from.a * t2 + _to.a * t1; 14 | var h = _from.h * t2 + _to.h * t1; 15 | var s = _from.s * t2 + _to.s * t1; 16 | var v = _from.v * t2 + _to.v * t1; 17 | 18 | return AhsvColor.ahsvToArgbInt(a, h, s, v); 19 | } 20 | 21 | public static function defaultFrom(value:Int, _to:AhsvColor, tween:TweenX) { 22 | return AhsvColor.of(value); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/rule/QuakeRuleX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.rule; 2 | 3 | import tweenx909.EaseX; 4 | import tweenx909.TweenX; 5 | import tweenx909.rule.QuakeX; 6 | 7 | /** 8 | * ... 9 | * @author shohei909 10 | */ 11 | 12 | class QuakeRuleX { 13 | public static var inputClass(default,null):Dynamic = QuakeX; 14 | public static function calc(_from:QuakeX, _to:QuakeX, t1:Float, t2:Float, tween:TweenX):Float { 15 | var p:Float = 16 | if (t1 < 0.5) _from.ease(t1 * 2); 17 | else _to.ease(t2 * 2); 18 | return _from.value * t2 + _to.value * t1 + p * (Math.random() * 2 - 1) * (_from.scale * t2 + _to.scale * t1); 19 | } 20 | public static function defaultFrom(value:Float, _to:QuakeX, tween:TweenX):QuakeX { 21 | return new QuakeX(value, _to.scale, _to.ease); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/tweenx/tweenx909/rule/TimelineRuleX.hx: -------------------------------------------------------------------------------- 1 | package tweenx909.rule; 2 | import tweenx909.TweenX; 3 | import tweenxcore.structure.BoundaryMode; 4 | import tweenxcore.structure.Timeline; 5 | import tweenxcore.structure.TimelineSearchResult; 6 | 7 | /** 8 | * @author shohei909 9 | */ 10 | class TimelineRuleX { 11 | public static var inputClass(default, null):Dynamic = Timeline; 12 | 13 | public static function calc(_from:Searchable, _to:Searchable, t1:Float, t2:Float, tween:TweenX):Dynamic { 14 | return _to.search(t1).data; 15 | } 16 | 17 | public static function defaultFrom(value:Dynamic, _to:Timeline, tween:TweenX):Dynamic { return null; } 18 | } 19 | 20 | private typedef Searchable = { 21 | public function search(rate:Float, ?boundaryMode:BoundaryMode):TimelineSearchResult; 22 | } 23 | -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/result.txt: -------------------------------------------------------------------------------- 1 | = Chrome 2 | Chrome 54.0 3 | Flash Player: 23,0,0,207 4 | 5 | 6 | Tweensy 7 | 4.71 8 | 4.69 9 | 4.65 10 | 11 | TweenX 12 | 6.98 13 | 6.70 14 | 7.03 15 | 16 | Actuate 17 | 15.36 18 | 16.25 19 | 15.11 20 | 21 | BetweenAS3 22 | 31.95 23 | 31.94 24 | 31.57 25 | 26 | TweenXCore 27 | 58.44 28 | 58.08 29 | 59.12 30 | 31 | = Chrome 32 | Chrome 55.0 33 | Flash Player: 24,0,0,186 34 | 35 | Delta 36 | 4.89 37 | 4.98 38 | 5.01 39 | 40 | = Firefox 41 | Firefox: 49.0, 50.0 42 | Flash Player: 23,0,0,207 43 | 44 | Tweensy 45 | 5.12 46 | 5.01 47 | 48 | TweenX 49 | 7.14 50 | 7.09 51 | 52 | Actuate 53 | 15.76 54 | 16.39 55 | 56 | BetweenAS3 57 | 23.25 58 | 26.25 59 | 60 | TweenXCore 61 | 36.40 62 | 41.52 63 | 64 | = Firefox 65 | Firefox 50.1 66 | Flash Player: 24,0,0,186 67 | 68 | Delta 69 | 5.80 70 | 6.01 -------------------------------------------------------------------------------- /sample/tweenxcore/CrossfadeSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | using tweenxcore.Tools; 4 | 5 | class CrossfadeSample extends Sprite { 6 | public static var TOTAL_FRAME:Int = 40; 7 | 8 | private var square:Square; 9 | private var frameCount:Int = 0; 10 | 11 | public function new() { 12 | super(); 13 | addChild(square = new Square()); 14 | square.y = Square.SIZE * 2; 15 | } 16 | 17 | 18 | public function update():Void { 19 | var rate = frameCount / TOTAL_FRAME; 20 | if (rate <= 1) { 21 | square.x = square.x = rate.crossfadeEasing( 22 | Easing.quintOut, 23 | Easing.bounceOut, 24 | Easing.sineInOut 25 | ).lerp(0, 450); 26 | } 27 | frameCount++; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sample/tweenxcore/RepeatSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | import tweenxcore.structure.FloatChange; 4 | import tweenxcore.structure.FloatChangeRepeatPart; 5 | using tweenxcore.Tools; 6 | 7 | class RepeatSample extends Sprite { 8 | public static var TOTAL_FRAME:Int = 140; 9 | 10 | private var square:Square; 11 | private var frameCount:Int = 0; 12 | 13 | public function new() { 14 | super(); 15 | addChild(square = new Square()); 16 | square.y = Square.SIZE * 2; 17 | } 18 | 19 | public function update():Void { 20 | var floatChange = new FloatChange(frameCount, frameCount += 1); 21 | floatChange.handleRepeatPart(20, 60, 3, updatePart); 22 | } 23 | 24 | private function updatePart(part:FloatChangeRepeatPart):Void { 25 | square.x = part.current.expoIn().lerp(0, 450); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sample/flash/sample/component/PlayButton.hx: -------------------------------------------------------------------------------- 1 | package sample.component; 2 | import flash.display.BlendMode; 3 | import flash.display.Shape; 4 | import flash.display.Sprite; 5 | 6 | class PlayButton extends Sprite 7 | { 8 | public static inline var SIZE:Int = 33; 9 | 10 | public function new() { 11 | super(); 12 | var shape = new Shape(); 13 | addChild(shape); 14 | 15 | shape.graphics.beginFill(SamplePlayer.THEME_COLOR); 16 | shape.graphics.drawCircle(0, 0, SIZE); 17 | shape.graphics.endFill(); 18 | 19 | var side = SIZE * 0.63; 20 | 21 | shape.graphics.beginFill(0xFFFFFF); 22 | shape.graphics.moveTo(side, 0); 23 | shape.graphics.lineTo(-side / 2, 0.866 * side); 24 | shape.graphics.lineTo(-side / 2, -0.866 * side); 25 | shape.graphics.endFill(); 26 | 27 | blendMode = BlendMode.LAYER; 28 | } 29 | } -------------------------------------------------------------------------------- /sample/flash/sample/component/SamplePlayer.hx: -------------------------------------------------------------------------------- 1 | package sample.component; 2 | import flash.display.Graphics; 3 | import flash.display.Sprite; 4 | 5 | class SamplePlayer extends Sprite 6 | { 7 | public static var THEME_COLOR:Int = 0x4EDAE1; 8 | private var child:Sprite; 9 | 10 | static function drawGrid(graphics:Graphics, size = 15, w = 30, h = 10) { 11 | //Draw background 12 | var end = size * w; 13 | for (i in 0...h + 1) { 14 | var p = i * size; 15 | graphics.beginFill(0xF1F1EF, 1); 16 | graphics.drawRect(0, p, end, 1); 17 | graphics.endFill(); 18 | } 19 | 20 | var end = size * h; 21 | for (i in 0...w + 1) { 22 | var p = i * size; 23 | graphics.beginFill(0xF1F1EF, 1); 24 | graphics.drawRect(p, 0, 1, end); 25 | graphics.endFill(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sample/tweenxcore/BezierSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | import tweenxcore.structure.FloatChange; 4 | import tweenxcore.structure.FloatChangePart; 5 | using tweenxcore.Tools; 6 | 7 | class BezierSample extends Sprite { 8 | public static var TOTAL_FRAME:Int = 60; 9 | 10 | private var square:Square; 11 | private var frameCount:Int = 0; 12 | 13 | public function new() { 14 | super(); 15 | addChild(square = new Square()); 16 | } 17 | 18 | public function update():Void { 19 | var floatChange = new FloatChange(frameCount, frameCount += 1); 20 | floatChange.handlePart(20.0, 50.5, updatePart); 21 | } 22 | 23 | private function updatePart(part:FloatChangePart) { 24 | var rate = part.current; 25 | square.x = rate.bezier3(0, 50, 400, 450); 26 | square.y = rate.bezier3(0, 200, -50, 120); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sample/tweenxcore/XySample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | import tweenxcore.structure.FloatChange; 4 | import tweenxcore.structure.FloatChangePart; 5 | using tweenxcore.Tools; 6 | 7 | class XySample extends Sprite { 8 | public static var TOTAL_FRAME:Int = 40; 9 | 10 | private var square:Square; 11 | private var frameCount:Int = 0; 12 | 13 | public function new() { 14 | super(); 15 | addChild(square = new Square()); 16 | square.y = Square.SIZE * 2; 17 | } 18 | 19 | public function update():Void { 20 | var floatChange = new FloatChange(frameCount, frameCount += 1); 21 | floatChange.handlePart(0.0, 40.0, updatePart); 22 | } 23 | 24 | private function updatePart(part:FloatChangePart):Void { 25 | square.x = part.current.lerp(0, 450); 26 | square.y = part.current.sinByRate().lerp(60, 105); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/expr/ExprMaker.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.expr; 2 | import haxe.PosInfos; 3 | import haxe.macro.Context; 4 | import haxe.macro.Expr; 5 | import tweenxcore.expr.ExprMaker.ExprMakeTools; 6 | 7 | class ExprMakeTools 8 | { 9 | public static function floatToExpr(float:Float):ExprOf 10 | { 11 | return { 12 | expr: ExprDef.EConst(Constant.CFloat(Std.string(float))), 13 | pos: pos(), 14 | } 15 | } 16 | 17 | public static function floatArrayToExpr(floats:Array):ExprOf> 18 | { 19 | return { 20 | expr: ExprDef.EArrayDecl([for (float in floats) floatToExpr(float)]), 21 | pos: pos(), 22 | } 23 | } 24 | 25 | public static function pos():Position 26 | { 27 | return 28 | #if macro 29 | Context.currentPos(); 30 | #else 31 | null; 32 | #end 33 | } 34 | } -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/structure/FloatChangeTimelinePart.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.structure; 2 | import haxe.ds.Option; 3 | 4 | class FloatChangeTimelinePart extends FloatChangePart 5 | { 6 | @:deprecated("use isMinorChange") 7 | @:noCompletion 8 | @:noDoc 9 | public var isMinerChange(get, never):Bool; 10 | private function get_isMinerChange():Bool { 11 | return isMinorChange; 12 | } 13 | 14 | public var isMinorChange(default, null):Bool; 15 | public var index(default, null):Int; 16 | public var rangeLeft(default, null):Float; 17 | public var rangeRight(default, null):Float; 18 | 19 | public inline function new (previousValue:Float, currentValue:Float, index:Int, rangeLeft:Float, rangeRight:Float, isMinorChange:Bool) 20 | { 21 | super(previousValue, currentValue); 22 | this.index = index; 23 | this.rangeLeft = rangeLeft; 24 | this.rangeRight = rangeRight; 25 | this.isMinorChange = isMinorChange; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sample/tweenxcore/FloatChangePartSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | import tweenxcore.structure.FloatChange; 4 | import tweenxcore.structure.FloatChangePart; 5 | using tweenxcore.Tools; 6 | 7 | class FloatChangePartSample extends Sprite { 8 | public static var TOTAL_FRAME:Int = 60; 9 | 10 | private var square:Square; 11 | private var frameCount:Int = 0; 12 | 13 | public function new() { 14 | super(); 15 | addChild(square = new Square()); 16 | square.y = Square.SIZE * 2; 17 | square.width = 0; 18 | } 19 | 20 | public function update():Void { 21 | var floatChange = new FloatChange(frameCount, frameCount += 1); 22 | floatChange.handlePart(20.0, 50.5, updatePart); 23 | } 24 | 25 | private function updatePart(part:FloatChangePart):Void { 26 | var left = part.previous.expoIn().lerp(0, 480); 27 | var right = part.current.expoIn().lerp(0, 480); 28 | 29 | square.x = left; 30 | square.width = right - left; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /test/benchmark.md: -------------------------------------------------------------------------------- 1 | # Math.pow vs Math.exp 2 | 3 | source code: [ExpoBenchCase.hx](src/cases/ExpoBenchCase.hx) 4 | 5 | ## Result 6 | | | Flash(Chrome) | Flash(Firefox) | JavaScript(Node) | JavaScript(Chrome)| JavaScript(Firefox) | JavaScript(Edge) | C# | Java | C++ | Neko | 7 | |:--|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:| 8 | |Math.pow(2, 10 * (t - 1))|484ms|792ms|887ms|870ms|504ms|2326ms|406ms|792ms|513ms|2139ms| 9 | |Math.exp(6.931471805599453 * (t - 1))|137ms|422ms|86ms|199ms|313ms|1983ms|197ms|623ms|131ms|1739ms| 10 | |Average error|7.492e-18|5.335e-18|1.375e-17|8.102e-18|8.095e-18|7.504e-18|7.492e-18|7.480e-18|7.486e-18|7.486e-18| 11 | 12 | ## Environment 13 | 14 | ``` 15 | OS : Windows 10 Home (version 1607) 16 | CPU : Intel(R) Core(TM) i7-6700HQ 17 | 18 | Haxe : 3.4.0-RC.1 (hxcs:3.2.0, hxjava:3.2.0, hxcpp:git_fa32f23) 19 | node : v4.6.1 20 | java : 1.8.0_111 21 | .NET Framework : 4.0.30319.42000 22 | Chrome : 54.0.2840.99 m (64-bit) 23 | Firfox : 50.0.2 24 | Flash Player : 23.0.0.207 25 | Microsoft Edge : 38.14393.0.0 26 | ``` 27 | -------------------------------------------------------------------------------- /website/_config.yml: -------------------------------------------------------------------------------- 1 | # Welcome to Jekyll! 2 | # 3 | # This config file is meant for settings that affect your whole blog, values 4 | # which you are expected to set up once and rarely need to edit after that. 5 | # For technical reasons, this file is *NOT* reloaded automatically when you use 6 | # 'jekyll serve'. If you change this file, please restart the server process. 7 | 8 | # Site settings 9 | title: TweenX 10 | description: > # this means to ignore newlines until "baseurl:" 11 | Write an awesome description for your new site here. You can edit this 12 | line in _config.yml. It will appear in your document head meta (for 13 | Google search results) and in your feed.xml site description. 14 | baseurl: "" # the subpath of your site, e.g. /blog 15 | url: "http://spheresofa.net" # the base hostname & protocol for your site 16 | twitter_username: shohei909 17 | github_username: shohei909 18 | 19 | # Build settings 20 | markdown: redcarpet 21 | highlighter: rouge 22 | sass: 23 | style: compressed 24 | gems: 25 | - jekyll-asciidoc 26 | asciidoctor: 27 | attributes: 28 | - hardbreaks! 29 | -------------------------------------------------------------------------------- /sample/tweenx/012_TweenFunction/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.display.StageScaleMode; 4 | import flash.geom.Matrix; 5 | import flash.Lib; 6 | 7 | import tweenx909.TweenX; 8 | import tweenx909.EaseX; 9 | using tweenx909.ChainX; 10 | 11 | class Main extends Sprite { 12 | static inline var CELL_SIZE = 20; 13 | public function new() { 14 | super(); 15 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 16 | 17 | //Draw background 18 | graphics.lineStyle(1, 0xEEEEEE); 19 | var end = CELL_SIZE * 20; 20 | for (i in 0...21) { 21 | var p = i * CELL_SIZE; 22 | graphics.moveTo(0, p); 23 | graphics.lineTo(end, p); 24 | graphics.moveTo(p, 0); 25 | graphics.lineTo(p, end); 26 | } 27 | 28 | 29 | //Tween!! 30 | function draw(x:Float, size:Float) { 31 | graphics.lineStyle(1, 0x335F73); 32 | graphics.drawCircle(x, 200, size); 33 | } 34 | 35 | TweenX.tweenFunc2(draw, 10, 10, 300, 100).time(0.5).ease(EaseX.quadIn); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sample/tweenxcore/MouseSample.hx: -------------------------------------------------------------------------------- 1 | import js.Browser; 2 | import js.html.CanvasElement; 3 | import js.html.MouseEvent; 4 | import sample.Sprite; 5 | import sample.Square; 6 | import tweenxcore.color.HsvColor; 7 | import tweenxcore.structure.FloatChange; 8 | import tweenxcore.structure.FloatChangePart; 9 | import tweenxcore.structure.FloatChangeRepeatPart; 10 | using tweenxcore.Tools; 11 | using CustomEasingSample.CustomEasing; 12 | 13 | class MouseSample extends Sprite { 14 | public static inline var TOTAL_FRAME:Int = 0xFFFFFF; 15 | var square:Square; 16 | 17 | public function new() { 18 | super(); 19 | 20 | square = new Square(); 21 | addChild(square); 22 | } 23 | 24 | public function update():Void {} 25 | 26 | public override function onMouseMove(e:MouseEvent):Void { 27 | var mouseX = e.clientX; 28 | var mouseY = e.clientY; 29 | 30 | var rateX = mouseX.inverseLerp(10, 800).clamp(0, 1); 31 | var rateY = mouseY.repeat(0, 400); 32 | 33 | square.x = rateX.expoInOut().lerp(0, 450); 34 | square.y = rateY.yoyo(Easing.expoInOut).lerp(0, 120); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/storage/StorageManager.hx: -------------------------------------------------------------------------------- 1 | package core.storage; 2 | import core.localize.LocaleKind; 3 | import haxe.EnumTools.EnumValueTools; 4 | import haxe.Serializer; 5 | import haxe.Unserializer; 6 | import haxe.ds.Option; 7 | import js.Browser; 8 | import js.html.Storage; 9 | 10 | class StorageManager 11 | { 12 | private var context:RootContext; 13 | private var storage:Storage; 14 | public function new(context:RootContext) 15 | { 16 | storage = Browser.window.localStorage; 17 | this.context = context; 18 | } 19 | 20 | public function save():Void 21 | { 22 | set(StorageKey.Output, context.output.mode); 23 | set(StorageKey.Locale, context.localize.locale); 24 | } 25 | 26 | private function set(key:StorageKey, data:Dynamic):Void 27 | { 28 | storage.setItem(EnumValueTools.getName(key), Serializer.run(data)); 29 | } 30 | 31 | public function get(key:StorageKey):Option 32 | { 33 | var data = storage.getItem(EnumValueTools.getName(key)); 34 | return if (data == null) Option.None else Option.Some(Unserializer.run(data)); 35 | } 36 | } -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/basic/DropdownButtonView.hx: -------------------------------------------------------------------------------- 1 | package component.basic; 2 | import api.react.React; 3 | import api.react.ReactComponent; 4 | import api.react.ReactComponent.ReactComponentOfProps; 5 | 6 | class DropdownButtonView extends ReactComponentOfProps 7 | { 8 | public function new(props:DropdownButtonProps) 9 | { 10 | super(props); 11 | } 12 | 13 | override public function render():ReactComponent 14 | { 15 | return React.createElement( 16 | "div", 17 | { 18 | className: "dropdown", 19 | }, 20 | React.createElement( 21 | "button", 22 | { 23 | onClick: props.onClick, 24 | className: "btn btn-primary dropdown-toggle", 25 | }, 26 | props.name + " ", 27 | React.createElement( 28 | "span", 29 | { className: "caret" } 30 | ) 31 | ) 32 | ); 33 | } 34 | } 35 | 36 | typedef DropdownButtonProps = 37 | { 38 | name: String, 39 | onClick: Void->Void, 40 | } 41 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/complex/ComplexEasingSelectFocus.hx: -------------------------------------------------------------------------------- 1 | package component.complex; 2 | import core.RootCommand; 3 | import core.easing.EasingCommand; 4 | import haxe.ds.Option; 5 | import component.complex.ComplexEasingId; 6 | import core.focus.FocusManager; 7 | 8 | class ComplexEasingSelectFocus 9 | { 10 | private var focus:FocusManager; 11 | public var id(default, null):ComplexEasingId; 12 | 13 | public function new (focus:FocusManager, id:ComplexEasingId) 14 | { 15 | this.focus = focus; 16 | this.id = id; 17 | } 18 | 19 | public function select(item:ComplexEasingSelectItem):Void 20 | { 21 | switch (focus.context.easing.resolveEasing(id)) 22 | { 23 | case Option.Some(oldEasing): 24 | var newEasing = item.createEasing(new ComplexEasingCreateContext(oldEasing)); 25 | var command = RootCommand.ChangeEasing(id, EasingCommand.Replace(newEasing)); 26 | focus.context.apply(command, true); 27 | 28 | focus.unfocus(); 29 | 30 | case Option.None: 31 | focus.unfocus(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/output/OutputView.hx: -------------------------------------------------------------------------------- 1 | package component.output; 2 | import api.react.ReactComponent; 3 | import api.react.ReactComponent.ReactComponentOfProps; 4 | import component.output.OutputModeSelectView; 5 | import core.RootContext; 6 | import core.output.OutputManager; 7 | import tweenxcore.expr.ComplexEasingKind; 8 | 9 | class OutputView extends ReactComponentOfProps 10 | { 11 | public function new(props:OutputProps) 12 | { 13 | super(props); 14 | } 15 | 16 | override public function render():ReactComponent 17 | { 18 | var output = props.context.output; 19 | return "div".createElement( 20 | { 21 | className: "output" 22 | }, 23 | [ 24 | OutputModeSelectView.createElement( 25 | { 26 | context: props.context, 27 | } 28 | ), 29 | "pre".createElement( 30 | {}, 31 | output.getString() 32 | ) 33 | ] 34 | ); 35 | } 36 | } 37 | 38 | typedef OutputProps = 39 | { 40 | context: RootContext, 41 | } 42 | -------------------------------------------------------------------------------- /sample/tweenx/001_SimplestTween/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.display.StageScaleMode; 4 | import flash.geom.Matrix; 5 | import flash.Lib; 6 | import tweenx909.TweenX; 7 | 8 | class Main extends Sprite { 9 | static inline var CELL_SIZE = 20; 10 | public function new() { 11 | super(); 12 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 13 | 14 | //Draw background 15 | graphics.lineStyle(1, 0xEEEEEE); 16 | var end = CELL_SIZE * 20; 17 | for (i in 0...21) { 18 | var p = i * CELL_SIZE; 19 | graphics.moveTo(0, p); 20 | graphics.lineTo(end, p); 21 | graphics.moveTo(p, 0); 22 | graphics.lineTo(p, end); 23 | } 24 | 25 | //Make square 26 | var square = new Square(CELL_SIZE * 2); 27 | addChild(square); 28 | square.y = CELL_SIZE * 9; 29 | 30 | //Tween!! 31 | TweenX.to(square, {"x":360}); 32 | } 33 | } 34 | 35 | private class Square extends Shape { 36 | public function new(size:Float) { 37 | super(); 38 | graphics.beginFill(0x335F73); 39 | graphics.drawRect(0, 0, size, size); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sample/tweenxcore/EntranceExitSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | import tweenxcore.structure.FloatChange; 4 | import tweenxcore.structure.FloatChangePart; 5 | using tweenxcore.Tools; 6 | 7 | class EntranceExitSample extends Sprite { 8 | public static var TOTAL_FRAME:Int = 60; 9 | 10 | private var square:Square; 11 | private var frameCount:Int = 0; 12 | 13 | public function new() { 14 | super(); 15 | addChild(square = new Square()); 16 | square.y = Square.SIZE * 2; 17 | } 18 | 19 | public function update():Void { 20 | var floatChange = new FloatChange(frameCount, frameCount += 1); 21 | floatChange.handlePart(20.0, 50.5, updatePart); 22 | } 23 | 24 | private function updatePart(part:FloatChangePart) { 25 | if (part.isEntrance()) { 26 | var topBar = new Square(); 27 | addChild(topBar); 28 | topBar.width = 481; 29 | } 30 | 31 | square.x = part.current.expoIn().lerp(0, 450); 32 | 33 | if (part.isExit()) { 34 | var bottomBar = new Square(); 35 | addChild(bottomBar); 36 | bottomBar.y = 120; 37 | bottomBar.width = 481; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sample/tweenxcore/HsvSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | import tweenxcore.color.HsvColor; 4 | import tweenxcore.structure.FloatChange; 5 | import tweenxcore.structure.FloatChangePart; 6 | using tweenxcore.Tools; 7 | 8 | class HsvSample extends Sprite { 9 | public static var TOTAL_FRAME:Int = 40; 10 | private var frameCount:Int = 0; 11 | 12 | public function new() { 13 | super(); 14 | } 15 | 16 | public function update():Void { 17 | var floatChange = new FloatChange(frameCount, frameCount += 1); 18 | floatChange.handlePart(0, 40, updatePart); 19 | } 20 | 21 | private function updatePart(part:FloatChangePart) { 22 | var prevX = part.previous.expoInOut().lerp(0, 480); 23 | var currentX = part.current.expoInOut().lerp(0, 480); 24 | 25 | var curve = part.current.expoInOut(); 26 | var hue = curve.lerp(0.0, 1.0); 27 | var saturation = curve.lerp(0.0, 0.8); 28 | var value = 0.95; 29 | var color = new HsvColor(hue, saturation, value); 30 | 31 | var square = new Square(); 32 | square.color = color; 33 | square.x = prevX; 34 | square.y = 60; 35 | square.width = currentX - prevX; 36 | addChild(square); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /website/css/reset.css: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, embed, 16 | figure, figcaption, footer, header, hgroup, 17 | menu, nav, output, ruby, section, summary, 18 | time, mark, audio, video { 19 | margin: 0; 20 | padding: 0; 21 | border: 0; 22 | font-size: 100%; 23 | font: inherit; 24 | vertical-align: baseline; 25 | } 26 | /* HTML5 display-role reset for older browsers */ 27 | article, aside, details, figcaption, figure, 28 | footer, header, hgroup, menu, nav, section { 29 | display: block; 30 | } 31 | body { 32 | line-height: 1; 33 | } 34 | ol, ul { 35 | list-style: none; 36 | } 37 | blockquote, q { 38 | quotes: none; 39 | } 40 | blockquote:before, blockquote:after, 41 | q:before, q:after { 42 | content: ''; 43 | content: none; 44 | } 45 | table { 46 | border-collapse: collapse; 47 | border-spacing: 0; 48 | } 49 | -------------------------------------------------------------------------------- /sample/tweenxcore/ShakeSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | using tweenxcore.Tools; 4 | 5 | class ShakeSample extends Sprite { 6 | public static var TOTAL_FRAME:Int = 400; 7 | 8 | private var square1:Square; 9 | private var square2:Square; 10 | private var square3:Square; 11 | 12 | public function new() { 13 | super(); 14 | addChild(square1 = new Square()); 15 | addChild(square2 = new Square()); 16 | addChild(square3 = new Square()); 17 | 18 | square1.y = square2.y = square3.y = Square.SIZE * 2; 19 | square1.x = 90; 20 | square2.x = 225; 21 | square3.x = 360; 22 | } 23 | 24 | public function update():Void 25 | { 26 | var scale = 3; 27 | square1.x = scale.shake( 90); 28 | square1.y = scale.shake( 60); 29 | 30 | square2.x = scale.shake(225, random2); 31 | square2.y = scale.shake( 60, random2); 32 | 33 | square3.x = scale.shake(360, random3); 34 | square3.y = scale.shake( 60, random3); 35 | } 36 | 37 | private static function random2():Float 38 | { 39 | return Math.random().quintInOut(); 40 | } 41 | 42 | private static function random3():Float 43 | { 44 | return Math.random().quintOutIn(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/geom/PolarPoint.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.geom; 2 | using tweenxcore.Tools; 3 | 4 | class PolarPoint { 5 | public var distance:Float; 6 | public var angle:Float; 7 | 8 | public var x(get, never):Float; 9 | function get_x() { 10 | return angle.cosByRate() * distance; 11 | } 12 | 13 | public var y(get, never):Float; 14 | function get_y() { 15 | return angle.sinByRate() * distance; 16 | } 17 | 18 | public inline function new(distance:Float, angle:Float) { 19 | this.distance = distance; 20 | this.angle = angle; 21 | } 22 | 23 | public static inline function fromXy(x:Float, y:Float):PolarPoint { 24 | return new PolarPoint(Math.sqrt(x * x + y * y), Math.atan2(y, x)); 25 | } 26 | 27 | public static inline function fromPoint(point:Point):PolarPoint { 28 | return fromXy(point.x, point.y); 29 | } 30 | 31 | public inline function setXy(x:Float, y:Float) { 32 | distance = Math.sqrt(x * x + y * y); 33 | angle = Math.atan2(y, x); 34 | } 35 | 36 | public inline function setPoint(point:Point) { 37 | distance = Math.sqrt(x * x + y * y); 38 | angle = Math.atan2(y, x); 39 | } 40 | 41 | public inline function clone(point:PolarPoint) { 42 | return new PolarPoint(distance, angle); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sample/tweenx/019_GroupEase/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.geom.Matrix; 4 | 5 | import tweenx909.TweenX; 6 | import tweenx909.EaseX; 7 | using tweenx909.ChainX; 8 | 9 | class Main extends Sprite { 10 | static inline var CELL_SIZE = 20; 11 | 12 | public function new() { 13 | super(); 14 | 15 | //Draw background 16 | graphics.lineStyle(1, 0xEEEEEE); 17 | var end = CELL_SIZE * 20; 18 | for (i in 0...21) { 19 | var p = i * CELL_SIZE; 20 | graphics.moveTo(0, p); 21 | graphics.lineTo(end, p); 22 | graphics.moveTo(p, 0); 23 | graphics.lineTo(p, end); 24 | } 25 | 26 | //Make square 27 | var square = new Square(CELL_SIZE * 2); 28 | addChild(square); 29 | square.y = CELL_SIZE * 5; 30 | 31 | //Tween!! 32 | TweenX.serial([ 33 | TweenX.to(square).time(0.48).x(120), 34 | TweenX.to(square).time(0.80).x(240).y(260), 35 | TweenX.to(square).time(0.48).x(360) 36 | ]).ease(EaseX.bounceInOut); 37 | } 38 | } 39 | 40 | private class Square extends Shape { 41 | public function new(size:Float) { 42 | super(); 43 | graphics.beginFill(0x335F73); 44 | graphics.drawRect(0, 0, size, size); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/structure/FloatChangeRepeatPart.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.structure; 2 | import haxe.ds.Option; 3 | 4 | class FloatChangeRepeatPart extends FloatChangePart 5 | { 6 | @:deprecated("use isMinorChange") 7 | @:noCompletion 8 | @:noDoc 9 | public var isMinerChange(get, never):Bool; 10 | private function get_isMinerChange():Bool { 11 | return isMinorChange; 12 | } 13 | 14 | public var isMinorChange(default, null):Bool; 15 | public var repeatIndex(default, null):Int; 16 | public var repeatLength(default, null):Int; 17 | 18 | public inline function new (previousValue:Float, currentValue:Float, repeatIndex:Int, repeatLength:Int, isMinorChange:Bool) 19 | { 20 | super(previousValue, currentValue); 21 | this.repeatIndex = repeatIndex; 22 | this.repeatLength = repeatLength; 23 | this.isMinorChange = isMinorChange; 24 | } 25 | 26 | public inline function isFirstEntrance():Bool { 27 | return (repeatIndex == 0 && previous <= 0 && 0 < current) || 28 | (repeatIndex == repeatLength - 1 && current < 1.0 && 1.0 <= previous); 29 | } 30 | 31 | public inline function isLastExit():Bool { 32 | return (repeatIndex == 0 && current <= 0.0 && 0.0 < previous) || 33 | (repeatIndex == repeatLength - 1 && previous < 1.0 && 1.0 <= current); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sample/common/Style.hx: -------------------------------------------------------------------------------- 1 | package; 2 | import tweenxcore.Tools.Easing; 3 | import tweenxcore.Tools.FloatTools; 4 | import tweenxcore.color.HsvColor; 5 | import tweenxcore.color.RgbColor; 6 | 7 | class Style { 8 | public static var SQUARE_SIZE:Int = 15; 9 | public static var START_FRAME:Int = 15; 10 | public static var FINISH_FRAME:Int = 10; 11 | public static var GRID_SCALE:Int = 15; 12 | public static var GRID_COLOR:RgbColor = RgbColor.of(0xF1F1EF); 13 | public static var THEME_COLOR:RgbColor = RgbColor.of(0x4EDAE1); 14 | public static var DARKEN_THEME_COLOR:RgbColor = RgbColor.of(0x0E9AB1); 15 | public static var BUTTON_SIZE:Int = 33; 16 | public static var DELAY_FRAME:Int = 60; 17 | 18 | public static function startEasing(rate:Float):Float { 19 | return FloatTools.connectEasing( 20 | rate, 21 | fastOut, 22 | Easing.quintIn, 23 | 0.62, 24 | -0.30 25 | ); 26 | } 27 | 28 | public static function finishEasing(rate:Float):Float { 29 | return FloatTools.mixEasing( 30 | rate, 31 | Easing.linear, 32 | fastOut, 33 | 0.8 34 | ); 35 | } 36 | 37 | private static function fastOut(rate:Float):Float { 38 | return Easing.cubicOut(Easing.cubicOut(rate)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/unary/RoundTripView.hx: -------------------------------------------------------------------------------- 1 | package component.unary; 2 | import api.react.React; 3 | import api.react.ReactComponent; 4 | import api.react.ReactComponent.ReactComponentOfProps; 5 | import component.basic.GraphColor; 6 | import component.basic.GraphView; 7 | import tweenxcore.expr.ComplexEasingKind; 8 | import tweenxcore.expr.RoundTripKind; 9 | import tweenxcore.expr.UnaryOpKind; 10 | import tweenxcore.expr.UnaryOpKindTools; 11 | 12 | class RoundTripView extends ReactComponentOfProps 13 | { 14 | public function new(props:RoundTripProps) 15 | { 16 | super(props); 17 | } 18 | 19 | override public function render():ReactComponent 20 | { 21 | return React.createElement( 22 | "div", 23 | { 24 | className: "param-group" 25 | }, 26 | GraphView.createElement( 27 | { 28 | lines: [ 29 | { easing: UnaryOpKindTools.toFunction(UnaryOpKind.RoundTrip(props.roundTrip), props.easing), color: GraphColor.Theme }, 30 | ], 31 | partations: [0.5], 32 | scale: 0.45, 33 | } 34 | ) 35 | ); 36 | } 37 | } 38 | 39 | typedef RoundTripProps = 40 | { 41 | easing: ComplexEasingKind, 42 | roundTrip: RoundTripKind, 43 | } 44 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/menu/LocaleView.hx: -------------------------------------------------------------------------------- 1 | package component.menu; 2 | import api.react.ReactComponent; 3 | import component.basic.SelectGroupView; 4 | import core.RootCommand; 5 | import core.RootContext; 6 | import core.localize.LocaleKind; 7 | import haxe.EnumTools; 8 | import haxe.ds.Option; 9 | 10 | class LocaleView extends ReactComponentOfProps 11 | { 12 | public function new(props:LocaleProps) 13 | { 14 | super(props); 15 | } 16 | 17 | override public function render():ReactComponent 18 | { 19 | var localize = props.context.localize; 20 | return SelectGroupView.createElement( 21 | { 22 | current: Option.Some(localize.locale), 23 | data: [for(c in EnumTools.getConstructors(LocaleKind)) EnumTools.createByName(LocaleKind, c)], 24 | onSelect: onSelect, 25 | getName: localize.getLocaleName, 26 | getIcon: getIcon, 27 | } 28 | ); 29 | } 30 | 31 | private function onSelect(locale:LocaleKind):Void 32 | { 33 | props.context.apply(RootCommand.ChangeLocale(locale), true); 34 | } 35 | 36 | private static function getIcon(mode:LocaleKind):Option 37 | { 38 | return Option.None; 39 | } 40 | 41 | } 42 | 43 | typedef LocaleProps = 44 | { 45 | context: RootContext, 46 | } 47 | -------------------------------------------------------------------------------- /website/feed.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | --- 4 | 5 | 6 | 7 | {{ site.title | xml_escape }} 8 | {{ site.description | xml_escape }} 9 | {{ site.url }}{{ site.baseurl }}/ 10 | 11 | {{ site.time | date_to_rfc822 }} 12 | {{ site.time | date_to_rfc822 }} 13 | Jekyll v{{ jekyll.version }} 14 | {% for post in site.posts limit:10 %} 15 | 16 | {{ post.title | xml_escape }} 17 | {{ post.content | xml_escape }} 18 | {{ post.date | date_to_rfc822 }} 19 | {{ post.url | prepend: site.baseurl | prepend: site.url }} 20 | {{ post.url | prepend: site.baseurl | prepend: site.url }} 21 | {% for tag in post.tags %} 22 | {{ tag | xml_escape }} 23 | {% endfor %} 24 | {% for cat in post.categories %} 25 | {{ cat | xml_escape }} 26 | {% endfor %} 27 | 28 | {% endfor %} 29 | 30 | 31 | -------------------------------------------------------------------------------- /sample/tweenxcore/TimelinePartSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | import tweenxcore.structure.FloatChange; 4 | import tweenxcore.structure.FloatChangeRepeatPart; 5 | import tweenxcore.structure.FloatChangeTimelinePart; 6 | import tweenxcore.structure.Timeline; 7 | using tweenxcore.Tools; 8 | 9 | class TimelinePartSample extends Sprite { 10 | public static var TOTAL_FRAME:Int = 80; 11 | 12 | private var square:Square; 13 | private var frameCount:Int = 0; 14 | private var timeline:TimelineVoid>; 15 | 16 | public function new() { 17 | super(); 18 | addChild(square = new Square()); 19 | 20 | timeline = new Timeline().add(update1, 1).add(update2, 2).add(update3, 5); 21 | } 22 | 23 | public function update():Void { 24 | var floatChange = new FloatChange(frameCount, frameCount += 1); 25 | 26 | floatChange.handleTimelinePart(0, 80, timeline); 27 | } 28 | 29 | private function update1(part:FloatChangeTimelinePart):Void { 30 | square.x = part.current.lerp(0, 450); 31 | } 32 | 33 | private function update2(part:FloatChangeTimelinePart):Void { 34 | square.y = part.current.cubicInOut().lerp(0, 120); 35 | } 36 | 37 | private function update3(part:FloatChangeTimelinePart):Void { 38 | square.x = part.current.quartIn().cubicIn().lerp(450, 0); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/focus/FocusManager.hx: -------------------------------------------------------------------------------- 1 | package core.focus; 2 | import component.basic.NumberInputId; 3 | import component.basic.RateId; 4 | import component.basic.NumberInputFocus; 5 | import component.complex.ComplexEasingSelectFocus; 6 | import component.complex.ComplexEasingId; 7 | import core.RootContext; 8 | import haxe.ds.Option; 9 | import js.Browser; 10 | 11 | class FocusManager 12 | { 13 | public var state(default, null):FocusState; 14 | public var context(default, null):RootContext; 15 | 16 | public function new(context:RootContext) 17 | { 18 | this.state = FocusState.None; 19 | this.context = context; 20 | } 21 | 22 | public function unfocus():Void 23 | { 24 | state = FocusState.None; 25 | context.update(); 26 | } 27 | 28 | // ================================================================== 29 | // Focus 30 | // ================================================================== 31 | public function focusComplexEasingSelect(id:ComplexEasingId):Void 32 | { 33 | state = FocusState.ComplexEasingSelect(new ComplexEasingSelectFocus(this, id)); 34 | context.update(); 35 | } 36 | 37 | public function focusNumberInput(id:NumberInputId, text:String):Void 38 | { 39 | state = FocusState.NumberInput(new NumberInputFocus(this, id, text)); 40 | context.update(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sample/tweenx/017_Quake/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.geom.Matrix; 4 | import tweenx909.rule.QuakeX; 5 | 6 | import tweenx909.rule.QuakeRuleX; 7 | import tweenx909.TweenX; 8 | import tweenx909.EaseX; 9 | using tweenx909.ChainX; 10 | 11 | class Main extends Sprite { 12 | static inline var CELL_SIZE = 20; 13 | public function new() { 14 | super(); 15 | 16 | //Draw background 17 | graphics.lineStyle(1, 0xEEEEEE); 18 | var end = CELL_SIZE * 20; 19 | for (i in 0...21) { 20 | var p = i * CELL_SIZE; 21 | graphics.moveTo(0, p); 22 | graphics.lineTo(end, p); 23 | graphics.moveTo(p, 0); 24 | graphics.lineTo(p, end); 25 | } 26 | 27 | //Make square 28 | var square = new Square(CELL_SIZE * 2); 29 | addChild(square); 30 | square.y = CELL_SIZE * 9; 31 | 32 | //Tween!! 33 | TweenX.from(square, { x:180, y:180 }); 34 | TweenX.to(square, { 35 | x:new QuakeX(180, 80, EaseX.linear), 36 | y:new QuakeX(180, 80, EaseX.linear) 37 | }).time(2); 38 | } 39 | } 40 | 41 | private class Square extends Shape { 42 | public function new(size:Float) { 43 | super(); 44 | graphics.beginFill(0x335F73); 45 | graphics.drawRect(0, 0, size, size); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/basic/NumberInputFocus.hx: -------------------------------------------------------------------------------- 1 | package component.basic; 2 | import api.react.ReactEvent; 3 | import component.basic.NumberInputId; 4 | import core.RootCommand; 5 | import core.focus.FocusManager; 6 | import haxe.ds.Option; 7 | import js.html.Element; 8 | import js.html.Event; 9 | import js.html.Text; 10 | import tweenxcore.expr.ComplexEasingKind; 11 | import tweenxcore.expr.InOutKind; 12 | import tweenxcore.expr.SimpleEasingKind; 13 | 14 | class NumberInputFocus 15 | { 16 | private var focus:FocusManager; 17 | public var text(default, null):String; 18 | public var id(default, null):NumberInputId; 19 | 20 | public function new (focus:FocusManager, id:NumberInputId, text:String) 21 | { 22 | this.text = text; 23 | this.focus = focus; 24 | this.id = id; 25 | } 26 | 27 | public function change(event:ReactEvent):Void 28 | { 29 | var input:Element = cast event.target; 30 | this.text = untyped input.value; 31 | var value = Std.parseFloat(text); 32 | 33 | if (!Math.isNaN(value)) 34 | { 35 | focus.context.applyNumberChange(id, value, true); 36 | } 37 | else 38 | { 39 | focus.context.update(); 40 | } 41 | } 42 | 43 | public function submit(event:ReactEvent):Void 44 | { 45 | var input:Element = cast event.target; 46 | input.blur(); 47 | focus.unfocus(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sample/tweenx/003_MethodChain/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.display.StageScaleMode; 4 | import flash.geom.Matrix; 5 | import flash.Lib; 6 | 7 | import tweenx909.TweenX; 8 | import tweenx909.EaseX; 9 | using tweenx909.ChainX; 10 | 11 | class Main extends Sprite { 12 | static inline var CELL_SIZE = 20; 13 | public function new() { 14 | super(); 15 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 16 | 17 | //Draw background 18 | graphics.lineStyle(1, 0xEEEEEE); 19 | var end = CELL_SIZE * 20; 20 | for (i in 0...21) { 21 | var p = i * CELL_SIZE; 22 | graphics.moveTo(0, p); 23 | graphics.lineTo(end, p); 24 | graphics.moveTo(p, 0); 25 | graphics.lineTo(p, end); 26 | } 27 | 28 | //Make square 29 | var square = new Square(CELL_SIZE * 2); 30 | addChild(square); 31 | square.y = CELL_SIZE * 9; 32 | 33 | //Tween!! 34 | //TweenX.to(square).x(360).rotation(360).scaleXY(0, 0).delay(0.5).time(1.2).ease(EaseX.expoInOut); 35 | 36 | TweenX.defaultTime = 0.3; 37 | 38 | TweenX.to(square).x(180).delay(2); 39 | TweenX.to(square).x(360).delay(1); 40 | } 41 | } 42 | 43 | private class Square extends Shape { 44 | public function new(size:Float) { 45 | super(); 46 | 47 | graphics.beginFill(0x335F73); 48 | graphics.drawRect(0, 0, size, size); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /sample/tweenx/002_GroupTween/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.StageScaleMode; 2 | import flash.Lib; 3 | import flash.display.Sprite; 4 | import flash.display.Shape; 5 | import tweenx909.EaseX; 6 | import tweenx909.TweenX; 7 | using tweenx909.ChainX; 8 | 9 | class Main extends Sprite { 10 | static inline var CELL_SIZE = 20; 11 | public function new() { 12 | super(); 13 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 14 | 15 | //Draw background 16 | graphics.lineStyle(1, 0xEEEEEE); 17 | var end = CELL_SIZE * 20; 18 | for (i in 0...21) { 19 | var p = i * CELL_SIZE; 20 | graphics.moveTo(0, p); 21 | graphics.lineTo(end, p); 22 | graphics.moveTo(p, 0); 23 | graphics.lineTo(p, end); 24 | } 25 | 26 | //Make square 27 | var square1 = new Square(CELL_SIZE * 2); 28 | var square2 = new Square(CELL_SIZE * 2); 29 | var square3 = new Square(CELL_SIZE * 2); 30 | 31 | addChild(square1); 32 | addChild(square2); 33 | addChild(square3); 34 | 35 | square1.y = CELL_SIZE * 5; 36 | square2.y = CELL_SIZE * 9; 37 | square3.y = CELL_SIZE * 13; 38 | 39 | TweenX.to([square1, square2, square3], {x:360}); 40 | } 41 | } 42 | 43 | private class Square extends Shape { 44 | public function new(size:Float) { 45 | super(); 46 | graphics.beginFill(0x335F73); 47 | graphics.drawRect(0, 0, size, size); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sample/tweenx/013_ColorTween/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.display.StageScaleMode; 4 | import flash.geom.Matrix; 5 | import flash.Lib; 6 | import tweenxcore.color.HsvColor; 7 | import tweenxcore.color.RgbColor; 8 | 9 | import tweenx909.TweenX; 10 | import tweenx909.EaseX; 11 | using tweenx909.ChainX; 12 | 13 | class Main extends Sprite { 14 | static inline var CELL_SIZE = 20; 15 | public function new() { 16 | super(); 17 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 18 | 19 | //Draw background 20 | graphics.lineStyle(1, 0xEEEEEE); 21 | var end = CELL_SIZE * 20; 22 | for (i in 0...21) { 23 | var p = i * CELL_SIZE; 24 | graphics.moveTo(0, p); 25 | graphics.lineTo(end, p); 26 | graphics.moveTo(p, 0); 27 | graphics.lineTo(p, end); 28 | } 29 | 30 | //Tween!! 31 | function draw(x:Float, y:Float, color:Int) { 32 | graphics.beginFill(color); 33 | graphics.drawRect(x, y, 8, 40); 34 | } 35 | 36 | TweenX.serial([ 37 | TweenX.tweenFunc(draw, [0, 100, RgbColor.of(0x3373EE) ], [380, 100, RgbColor.of(0xEE7333) ]), 38 | TweenX.tweenFunc(draw, [0, 180, HsvColor.of(0x3373EE) ], [380, 180, HsvColor.of(0xEE7333) ]), 39 | TweenX.tweenFunc(draw, [0, 260, new HsvColor(0,0.7,0.9) ], [380, 260, new HsvColor(2,0.7,0.9) ]), 40 | ]); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/build.hxml: -------------------------------------------------------------------------------- 1 | -as3 bin/TweenXCoreBench 2 | -cp src 3 | -cp ../../../src/tweenxcore 4 | -swf-header 465:465:60:FFFFFF 5 | -main TweenXCoreBench 6 | -D analyzer 7 | -dce full 8 | 9 | --next 10 | 11 | -swf bin/DeltaBench.swf 12 | -cp src 13 | -lib delta 14 | -swf-header 465:465:60:FFFFFF 15 | -main DeltaBench 16 | -D analyzer 17 | -dce full 18 | 19 | --next 20 | 21 | -swf bin/ActuateBench.swf 22 | -cp src 23 | -lib actuate 24 | -swf-header 465:465:60:FFFFFF 25 | -main ActuateBench 26 | -D analyzer 27 | -dce full 28 | 29 | --next 30 | 31 | -swf bin/TweensyBench.swf 32 | -cp src 33 | -swf-lib lib/Tweensy_0_2_22_OriginalCS4.swc 34 | -swf-header 465:465:60:FFFFFF 35 | -main TweensyBench 36 | -D analyzer 37 | -dce full 38 | 39 | --next 40 | 41 | -swf bin/BetweenAS3Bench.swf 42 | -cp src 43 | -swf-lib lib/BetweenAS3-Alpha-r3022-fp10.swc 44 | -swf-header 465:465:60:FFFFFF 45 | -main BetweenAS3Bench 46 | -D analyzer 47 | -dce full 48 | 49 | --next 50 | 51 | -swf bin/TweenerBench.swf 52 | -cp src 53 | -swf-lib lib/tweener_1_33_74_as3.swc 54 | -swf-header 465:465:60:FFFFFF 55 | -main TweenerBench 56 | -D analyzer 57 | -dce full 58 | 59 | --next 60 | 61 | -swf bin/TweenXBench.swf 62 | -cp src 63 | -cp ../../../src/tweenx 64 | -cp ../../../src/tweenxcore 65 | -swf-header 465:465:60:FFFFFF 66 | -main TweenXBench 67 | -D analyzer 68 | -dce full 69 | 70 | --next 71 | 72 | -swf bin/TweenXCoreBench.swf 73 | -cp src 74 | -cp ../../../src/tweenxcore 75 | -swf-header 465:465:60:FFFFFF 76 | -main TweenXCoreBench 77 | -D analyzer 78 | -dce full 79 | -------------------------------------------------------------------------------- /sample/tweenxcore/MatrixSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | import tweenxcore.structure.FloatChange; 4 | import tweenxcore.structure.FloatChangePart; 5 | using tweenxcore.Tools; 6 | 7 | #if flash 8 | import flash.geom.Matrix in MatrixImpl; 9 | #else 10 | private class MatrixImpl { 11 | public var a:Float = 1; 12 | public var b:Float = 0; 13 | public var c:Float = 0; 14 | public var d:Float = 1; 15 | public var tx:Float = 0; 16 | public var ty:Float = 0; 17 | 18 | public function new() {} 19 | } 20 | #end 21 | 22 | class MatrixSample extends Sprite { 23 | public static var TOTAL_FRAME:Int = 40; 24 | 25 | private var square:Square; 26 | private var frameCount:Int = 0; 27 | private var matrix:MatrixImpl; 28 | 29 | public function new() { 30 | super(); 31 | addChild(square = new Square()); 32 | square.y = Square.SIZE * 2; 33 | 34 | matrix = new MatrixImpl(); 35 | matrix.createSimilarityTransform(100, 0, 350, 120); 36 | } 37 | 38 | public function update():Void { 39 | var floatChange = new FloatChange(frameCount, frameCount += 1); 40 | floatChange.handlePart(0.0, 40.0, updatePart); 41 | } 42 | 43 | private function updatePart(part:FloatChangePart):Void { 44 | var x = part.current; 45 | var y = part.current.sinByRate().lerp(0, 0.1); 46 | 47 | square.x = matrix.a * x + matrix.c * y + matrix.tx; 48 | square.y = matrix.b * x + matrix.d * y + matrix.ty; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /website/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %} 6 | 7 | 8 | 9 | {{ page.meta }} 10 | 11 | 12 | 31 |
32 | {{content}} 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TweenXCore / TweenX 2 | ====== 3 | 4 | version: 1.0 5 | 6 | Cross platform tween library for Haxe 7 | 8 | ## Documentation 9 | 10 | * [TweenXCore](http://tweenx.spheresofa.net/core/en.html) 11 | * [TweenX](http://tweenx.spheresofa.net/en.html) 12 | 13 | ##License 14 | 15 | ### TweenX/TweenXCore Source Code, Document, Image, Font: 16 | 17 | The MIT License (MIT) 18 | 19 | Copyright (c) 2014-2016 shohei909 and other tweenx contributors(https://github.com/shohei909/tweenx/graphs/contributors) 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in 29 | all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 37 | THE SOFTWARE. 38 | -------------------------------------------------------------------------------- /sample/tweenx/016_EventHandle/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.geom.Matrix; 4 | 5 | import tweenx909.TweenX; 6 | import tweenx909.EaseX; 7 | using tweenx909.ChainX; 8 | 9 | class Main extends Sprite { 10 | static inline var CELL_SIZE = 20; 11 | public function new() { 12 | super(); 13 | 14 | //Draw background 15 | graphics.lineStyle(1, 0xEEEEEE); 16 | var end = CELL_SIZE * 20; 17 | for (i in 0...21) { 18 | var p = i * CELL_SIZE; 19 | graphics.moveTo(0, p); 20 | graphics.lineTo(end, p); 21 | graphics.moveTo(p, 0); 22 | graphics.lineTo(p, end); 23 | } 24 | 25 | //Make square 26 | var square = new Square(CELL_SIZE * 2); 27 | addChild(square); 28 | square.y = CELL_SIZE * 8; 29 | 30 | var tween = TweenX.to(square) 31 | .x(360) 32 | .ease(EaseX.bounceOut) 33 | .delay(0.5) 34 | .repeat(2) 35 | .time(1.5) 36 | .zigzag() 37 | .interval(0.5); 38 | 39 | var player = new TweenXPlayer(tween, 401); 40 | player.y = 401 - TweenXPlayer.HEIGHT; 41 | addChild(player); 42 | } 43 | } 44 | 45 | private class Square extends Shape { 46 | public function new(size:Float) { 47 | super(); 48 | graphics.beginFill(0x335F73); 49 | graphics.drawRect(0, 0, size, size); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sample/tweenx/011_AutoFrom/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.display.StageScaleMode; 4 | import flash.geom.Matrix; 5 | import flash.Lib; 6 | 7 | import tweenx909.TweenX; 8 | import tweenx909.EaseX; 9 | using tweenx909.ChainX; 10 | 11 | class Main extends Sprite { 12 | static inline var CELL_SIZE = 20; 13 | public function new() { 14 | super(); 15 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 16 | 17 | //Draw background 18 | graphics.lineStyle(1, 0xEEEEEE); 19 | var end = CELL_SIZE * 20; 20 | for (i in 0...21) { 21 | var p = i * CELL_SIZE; 22 | graphics.moveTo(0, p); 23 | graphics.lineTo(end, p); 24 | graphics.moveTo(p, 0); 25 | graphics.lineTo(p, end); 26 | } 27 | 28 | //Make square 29 | var square = new Square(CELL_SIZE * 2); 30 | addChild(square); 31 | 32 | var defaults = TweenX.dumpDefaults(); 33 | defaults.time(1).ease(EaseX.quartOut); 34 | 35 | //Tween!! 36 | TweenX.serial([ 37 | TweenX.to(square).x(360).y( 0), 38 | TweenX.to(square).x(360).y(360).yoyo().repeat(2), 39 | TweenX.to(square).x( 0).y(360).zigzag().repeat(3), 40 | TweenX.to(square).x( 0).y( 0), 41 | ], defaults).repeat(); 42 | } 43 | } 44 | 45 | private class Square extends Shape { 46 | public function new(size:Float) { 47 | super(); 48 | 49 | graphics.beginFill(0x335F73); 50 | graphics.drawRect(0, 0, size, size); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/history/HistoryManager.hx: -------------------------------------------------------------------------------- 1 | package core.history; 2 | 3 | class HistoryManager 4 | { 5 | private var undoStack:List>; 6 | private var redoStack:List>; 7 | private var context:RootContext; 8 | 9 | public function new(context:RootContext) 10 | { 11 | this.context = context; 12 | undoStack = new List(); 13 | redoStack = new List(); 14 | } 15 | 16 | public function canUndo():Bool 17 | { 18 | return !undoStack.isEmpty(); 19 | } 20 | public function undo():Void 21 | { 22 | context.focus.unfocus(); 23 | if (!canUndo()) return; 24 | 25 | var result = context.applyWithoutRecord(undoStack.pop(), true); 26 | redoStack.push(result.undoCommands); 27 | context.applyResult(result, true); 28 | context.update(); 29 | } 30 | 31 | public function canRedo():Bool 32 | { 33 | return !redoStack.isEmpty(); 34 | } 35 | 36 | public function redo():Void 37 | { 38 | context.focus.unfocus(); 39 | if (!canRedo()) return; 40 | 41 | var result = context.applyWithoutRecord(redoStack.pop(), true); 42 | undoStack.push(result.undoCommands); 43 | context.applyResult(result, true); 44 | context.update(); 45 | } 46 | 47 | public function record(commands:List):Void 48 | { 49 | undoStack.push(commands); 50 | redoStack.clear(); 51 | } 52 | 53 | public function clear():Void 54 | { 55 | undoStack.clear(); 56 | redoStack.clear(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/color/AhsvColor.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.color; 2 | using tweenxcore.Tools; 3 | 4 | class AhsvColor extends HsvColor implements ITransparentColor { 5 | /** alpha */ 6 | public var a:Float; 7 | 8 | public function new(alpha:Float, hue:Float, saturation:Float, value:Float) { 9 | this.a = alpha; 10 | super(hue, saturation, value); 11 | } 12 | 13 | public static inline function ahsvToArgbInt(a:Float, h:Float, s:Float, v:Float):Int { 14 | return (Std.int(a.clamp() * 0xFF) << 24) | HsvColor.hsvToRgbInt(h, s, v); 15 | } 16 | 17 | public static inline function of(color:Int, hueIndex:Int = 0) { 18 | var a = ((color >>> 24) & 0xFF) / 0xFF; 19 | return HsvColor.of(color & 0xFFFFFF, hueIndex).toHsvWithAlpha(a); 20 | } 21 | 22 | public static inline function fromArgb(a:Float, r:Float, g:Float, b:Float, hueIndex:Int = 0) { 23 | return HsvColor.fromRgb(r, g, b, hueIndex).toHsvWithAlpha(a); 24 | } 25 | 26 | public inline function getAlpha():Float { 27 | return a; 28 | } 29 | 30 | public inline function toArgb():ArgbColor { 31 | return ArgbColor.fromAhsv(a, h, s, v); 32 | } 33 | 34 | public inline function toAhsv():AhsvColor { 35 | return new AhsvColor(a, h, s, v); 36 | } 37 | 38 | public inline function toArgbInt():Int { 39 | return ahsvToArgbInt(a, h, s, v); 40 | } 41 | 42 | public inline function toArgbHexString():String { 43 | return StringTools.hex(toArgbInt(), 8); 44 | } 45 | 46 | public inline function toRgbaCssString():String { 47 | return toArgb().toRgbaCssString(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/simple/SimpleEasingView.hx: -------------------------------------------------------------------------------- 1 | package component.simple; 2 | import api.react.React; 3 | import api.react.ReactComponent; 4 | import api.react.ReactComponent.ReactComponentOfProps; 5 | import component.complex.ComplexEasingId; 6 | import core.RootContext; 7 | import tweenxcore.expr.SimpleEasingKind; 8 | 9 | class SimpleEasingView extends ReactComponentOfProps 10 | { 11 | public function new(props:SimpleEasingProps) 12 | { 13 | super(props); 14 | } 15 | 16 | override public function render():ReactComponent 17 | { 18 | return switch (props.kind) 19 | { 20 | case SimpleEasingKind.Linear: 21 | React.createElement("div", {}, []); 22 | 23 | case SimpleEasingKind.Standard(easing, inOut): 24 | StandardEasingView.createElement( 25 | { 26 | easing: easing, 27 | inOut: inOut, 28 | id: props.id, 29 | context: props.context, 30 | } 31 | ); 32 | 33 | case SimpleEasingKind.Line(polyline, controls): 34 | PolylineView.createElement( 35 | { 36 | polyline: polyline, 37 | controls: controls, 38 | id: props.id, 39 | context: props.context, 40 | } 41 | ); 42 | } 43 | } 44 | } 45 | 46 | typedef SimpleEasingProps = 47 | { 48 | kind: SimpleEasingKind, 49 | id: ComplexEasingId, 50 | context: RootContext 51 | } 52 | -------------------------------------------------------------------------------- /sample/tweenx/006_ParallelTween/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Shape; 2 | import flash.display.Sprite; 3 | import flash.display.StageScaleMode; 4 | import flash.Lib; 5 | import tweenx909.EaseX; 6 | import tweenx909.TweenX; 7 | 8 | using tweenx909.ChainX; 9 | 10 | class Main extends Sprite { 11 | static inline var CELL_SIZE = 20; 12 | public function new() { 13 | super(); 14 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 15 | 16 | 17 | //Draw background 18 | graphics.lineStyle(1, 0xEEEEEE); 19 | var end = CELL_SIZE * 20; 20 | for (i in 0...21) { 21 | var p = i * CELL_SIZE; 22 | graphics.moveTo(0, p); 23 | graphics.lineTo(end, p); 24 | graphics.moveTo(p, 0); 25 | graphics.lineTo(p, end); 26 | } 27 | 28 | //Make square 29 | var square1 = new Square(CELL_SIZE * 2); 30 | var square2 = new Square(CELL_SIZE * 2); 31 | var square3 = new Square(CELL_SIZE * 2); 32 | 33 | addChild(square1); 34 | addChild(square2); 35 | addChild(square3); 36 | 37 | square1.y = CELL_SIZE * 5; 38 | square2.y = CELL_SIZE * 9; 39 | square3.y = CELL_SIZE * 13; 40 | 41 | //Tween!! 42 | TweenX.parallel([ 43 | TweenX.to(square1).x(360).ease(EaseX.expoOut), 44 | TweenX.to(square2).x(360).ease(EaseX.expoOut), 45 | TweenX.to(square3).x(360).ease(EaseX.expoOut), 46 | ]); 47 | } 48 | } 49 | 50 | private class Square extends Shape { 51 | public function new(size:Float) { 52 | super(); 53 | graphics.beginFill(0x335F73); 54 | graphics.drawRect(0, 0, size, size); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /sample/tweenxcore/PolarSample.hx: -------------------------------------------------------------------------------- 1 | import sample.Sprite; 2 | import sample.Square; 3 | import tweenxcore.geom.PolarPoint; 4 | import tweenxcore.structure.FloatChange; 5 | import tweenxcore.structure.FloatChangePart; 6 | using tweenxcore.Tools; 7 | 8 | #if flash 9 | import flash.geom.Matrix in MatrixImpl; 10 | #else 11 | private class MatrixImpl { 12 | public var a:Float = 1; 13 | public var b:Float = 0; 14 | public var c:Float = 0; 15 | public var d:Float = 1; 16 | public var tx:Float = 0; 17 | public var ty:Float = 0; 18 | 19 | public function new() {} 20 | } 21 | #end 22 | 23 | class PolarSample extends Sprite { 24 | public static var TOTAL_FRAME:Int = 40; 25 | 26 | private var square:Square; 27 | private var frameCount:Int = 0; 28 | private var matrix:MatrixImpl; 29 | 30 | public function new() { 31 | super(); 32 | addChild(square = new Square()); 33 | square.y = Square.SIZE * 2; 34 | 35 | matrix = new MatrixImpl(); 36 | matrix.createSimilarityTransform(210, 60, 0, 0); 37 | } 38 | 39 | public function update():Void { 40 | var floatChange = new FloatChange(frameCount, frameCount += 1); 41 | floatChange.handlePart(0.0, 40.0, updatePart); 42 | } 43 | 44 | private function updatePart(part:FloatChangePart):Void { 45 | var distance = part.current.expoOut().lerp(1, 0); 46 | var angle = part.current.lerp(0, -2); 47 | 48 | var polarPoint = new PolarPoint(distance, angle); 49 | var x = polarPoint.x; 50 | var y = polarPoint.y; 51 | 52 | square.x = matrix.a * x + matrix.c * y + matrix.tx; 53 | square.y = matrix.b * x + matrix.d * y + matrix.ty; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /sample/tweenx/007_LagTween/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.display.StageScaleMode; 4 | import flash.geom.Matrix; 5 | import flash.Lib; 6 | 7 | import tweenx909.TweenX; 8 | import tweenx909.EaseX; 9 | using tweenx909.ChainX; 10 | 11 | class Main extends Sprite { 12 | static inline var CELL_SIZE = 20; 13 | public function new() { 14 | super(); 15 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 16 | 17 | 18 | //Draw background 19 | graphics.lineStyle(1, 0xEEEEEE); 20 | var end = CELL_SIZE * 20; 21 | for (i in 0...21) { 22 | var p = i * CELL_SIZE; 23 | graphics.moveTo(0, p); 24 | graphics.lineTo(end, p); 25 | graphics.moveTo(p, 0); 26 | graphics.lineTo(p, end); 27 | } 28 | 29 | //Make square 30 | var square1 = new Square(CELL_SIZE * 2); 31 | var square2 = new Square(CELL_SIZE * 2); 32 | var square3 = new Square(CELL_SIZE * 2); 33 | 34 | addChild(square1); 35 | addChild(square2); 36 | addChild(square3); 37 | 38 | square1.y = CELL_SIZE * 5; 39 | square2.y = CELL_SIZE * 9; 40 | square3.y = CELL_SIZE * 13; 41 | 42 | //Tween!! 43 | TweenX.lag([ 44 | TweenX.to(square1).x(360).ease(EaseX.expoOut), 45 | TweenX.to(square2).x(360).ease(EaseX.expoOut), 46 | TweenX.to(square3).x(360).ease(EaseX.expoOut), 47 | ], 0.1); 48 | } 49 | } 50 | 51 | private class Square extends Shape { 52 | public function new(size:Float) { 53 | super(); 54 | graphics.beginFill(0x335F73); 55 | graphics.drawRect(0, 0, size, size); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sample/tweenx/005_SerialTween/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Shape; 2 | import flash.display.Sprite; 3 | import flash.display.StageScaleMode; 4 | import flash.Lib; 5 | import tweenx909.EaseX; 6 | 7 | using tweenx909.TweenX; 8 | using tweenx909.ChainX; 9 | 10 | class Main extends Sprite { 11 | static inline var CELL_SIZE = 20; 12 | public function new() { 13 | super(); 14 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 15 | 16 | 17 | //Draw background 18 | graphics.lineStyle(1, 0xEEEEEE); 19 | var end = CELL_SIZE * 20; 20 | for (i in 0...21) { 21 | var p = i * CELL_SIZE; 22 | graphics.moveTo(0, p); 23 | graphics.lineTo(end, p); 24 | graphics.moveTo(p, 0); 25 | graphics.lineTo(p, end); 26 | } 27 | 28 | //Make square 29 | var square1 = new Square(CELL_SIZE * 2); 30 | var square2 = new Square(CELL_SIZE * 2); 31 | var square3 = new Square(CELL_SIZE * 2); 32 | 33 | addChild(square1); 34 | addChild(square2); 35 | addChild(square3); 36 | 37 | square1.y = CELL_SIZE * 5; 38 | square2.y = CELL_SIZE * 9; 39 | square3.y = CELL_SIZE * 13; 40 | 41 | //Tween!! 42 | TweenX.serial([ 43 | TweenX.to(square1).x(360).ease(EaseX.expoOut), 44 | TweenX.to(square2).x(360).ease(EaseX.expoOut), 45 | TweenX.to(square3).x(360).ease(EaseX.expoOut), 46 | ]); 47 | } 48 | } 49 | 50 | private class Square extends Shape { 51 | public function new(size:Float) { 52 | super(); 53 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 54 | 55 | graphics.beginFill(0x335F73); 56 | graphics.drawRect(0, 0, size, size); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/tweenxcore/tweenxcore/color/ArgbColor.hx: -------------------------------------------------------------------------------- 1 | package tweenxcore.color; 2 | using tweenxcore.Tools; 3 | 4 | class ArgbColor extends RgbColor implements ITransparentColor { 5 | /** alpha */ 6 | public var a:Float; 7 | 8 | public function new(alpha:Float, red:Float, green:Float, blue:Float) { 9 | this.a = alpha; 10 | super(red, green, blue); 11 | } 12 | 13 | public static inline function argbToInt(a:Float, r:Float, g:Float, b:Float):Int { 14 | return (Std.int(a.clamp() * 0xFF) << 24) | RgbColor.rgbToInt(r, g, b); 15 | } 16 | 17 | public static inline function of(color:Int) { 18 | return new ArgbColor( 19 | ((color >>> 24) & 0xFF) / 0xFF, 20 | ((color >> 16) & 0xFF) / 0xFF, 21 | ((color >> 8) & 0xFF) / 0xFF, 22 | (color & 0xFF) / 0xFF 23 | ); 24 | } 25 | 26 | public inline function getAlpha():Float { 27 | return a; 28 | } 29 | 30 | public inline function toArgb():ArgbColor { 31 | return new ArgbColor(a, r, g, b); 32 | } 33 | 34 | public inline function toAhsv():AhsvColor { 35 | return AhsvColor.fromArgb(a, r, g, b); 36 | } 37 | 38 | public inline function toArgbInt():Int { 39 | return argbToInt(a, r, g, b); 40 | } 41 | 42 | public inline function toArgbHexString():String { 43 | return StringTools.hex(toArgbInt(), 8); 44 | } 45 | 46 | public inline function toRgbaCssString():String { 47 | return "rgba(" + Std.int(r * 0xFF) + "," + Std.int(g * 0xFF) + "," + Std.int(b * 0xFF) + "," + a + ")"; 48 | } 49 | 50 | public static inline function fromAhsv(a:Float, h:Float, s:Float, v:Float, hueIndex:Int = 0) { 51 | return RgbColor.fromHsv(h, s, v).toRgbWithAlpha(a); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /test/TweenXCoreTest.hxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | cmd /c haxe $(OutputFile) 44 | 45 | 46 | 47 | 48 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /sample/tweenx/009_RepeatTween/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.display.StageScaleMode; 4 | import flash.geom.Matrix; 5 | import flash.Lib; 6 | 7 | import tweenx909.TweenX; 8 | import tweenx909.EaseX; 9 | using tweenx909.ChainX; 10 | 11 | class Main extends Sprite { 12 | static inline var CELL_SIZE = 20; 13 | public function new() { 14 | super(); 15 | Lib.current.stage.scaleMode = StageScaleMode.SHOW_ALL; 16 | 17 | //Draw background 18 | graphics.lineStyle(1, 0xEEEEEE); 19 | var end = CELL_SIZE * 20; 20 | for (i in 0...21) { 21 | var p = i * CELL_SIZE; 22 | graphics.moveTo(0, p); 23 | graphics.lineTo(end, p); 24 | graphics.moveTo(p, 0); 25 | graphics.lineTo(p, end); 26 | } 27 | 28 | //Make square 29 | var square1 = new Square(CELL_SIZE * 2); 30 | var square2 = new Square(CELL_SIZE * 2); 31 | var square3 = new Square(CELL_SIZE * 2); 32 | 33 | addChild(square1); 34 | addChild(square2); 35 | addChild(square3); 36 | 37 | square1.y = CELL_SIZE * 5; 38 | square2.y = CELL_SIZE * 9; 39 | square3.y = CELL_SIZE * 13; 40 | 41 | //Tween!! 42 | TweenX.serial([ 43 | TweenX.to(square1).x(360).time(0.4).ease(EaseX.quartOut).repeat(3), 44 | TweenX.to(square2).x(360).time(0.4).ease(EaseX.quartOut).repeat(5).yoyo(), 45 | TweenX.to(square3).x(360).time(0.4).ease(EaseX.quartOut).repeat(5).zigzag(), 46 | ]).repeat().interval(0.4); 47 | } 48 | } 49 | 50 | private class Square extends Shape { 51 | public function new(size:Float) { 52 | super(); 53 | 54 | graphics.beginFill(0x335F73); 55 | graphics.drawRect(0, 0, size, size); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/complex/ComplexEasingDrag.hx: -------------------------------------------------------------------------------- 1 | package component.complex; 2 | import core.RootCommand; 3 | import core.drag.DragManager; 4 | import core.drag.DragState; 5 | import core.drag.DragStateKind; 6 | import core.easing.EasingCommand; 7 | import js.html.MouseEvent; 8 | 9 | class ComplexEasingDrag implements DragState 10 | { 11 | private var drag:DragManager; 12 | public var kind(default, null):DragStateKind; 13 | public var fromId(default, null):ComplexEasingId; 14 | public var toId(default, null):ComplexEasingId; 15 | 16 | public function new (drag:DragManager, id:ComplexEasingId) 17 | { 18 | this.drag = drag; 19 | this.fromId = id; 20 | this.toId = id; 21 | this.kind = DragStateKind.ComplexEasing(this); 22 | } 23 | 24 | public function move(e:MouseEvent):Void 25 | { 26 | } 27 | 28 | public function finish():Void 29 | { 30 | if (drag.context.key.ctrl) 31 | { 32 | drag.context.apply(RootCommand.ChangeEasing(toId, EasingCommand.Paste(fromId)), true); 33 | } 34 | else 35 | { 36 | drag.context.apply(RootCommand.ChangeEasing(toId, EasingCommand.Move(fromId)), true); 37 | } 38 | } 39 | 40 | public function enter(id:ComplexEasingId):Void 41 | { 42 | trace("enter0", toId); 43 | toId = id; 44 | trace("enter1", toId); 45 | 46 | drag.context.update(); 47 | } 48 | 49 | public function leave():Void 50 | { 51 | trace("leave0", toId); 52 | if (!toId.isEmpty()) 53 | { 54 | toId = toId.parent(); 55 | } 56 | else 57 | { 58 | toId = fromId; 59 | } 60 | 61 | trace("leave1", toId); 62 | 63 | drag.context.update(); 64 | } 65 | } -------------------------------------------------------------------------------- /tools/ChainMaker/ChainMaker.hxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /website/_layouts/tool.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 31 |
32 | {{content}} 33 |
34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/localize/resource/EnglishResource.hx: -------------------------------------------------------------------------------- 1 | package core.localize.resource; 2 | import component.complex.ComplexEasingSelectItemId; 3 | import core.localize.LocalizeResource; 4 | import core.output.OutputMode; 5 | import haxe.EnumTools.EnumValueTools; 6 | import tweenxcore.expr.InOutKind; 7 | 8 | class EnglishResource implements LocalizeResource 9 | { 10 | public function new () 11 | { 12 | } 13 | 14 | public function easingItem(itemId:ComplexEasingSelectItemId):String 15 | { 16 | return EnumValueTools.getName(itemId); 17 | } 18 | 19 | public function outputMode(mode:OutputMode):String 20 | { 21 | return switch(mode) 22 | { 23 | case OutputMode.Unity: "Unity (TweenCore#)"; 24 | case _: EnumValueTools.getName(mode); 25 | } 26 | } 27 | 28 | public function inOut(kind:InOutKind):String 29 | { 30 | return EnumValueTools.getName(kind); 31 | } 32 | 33 | public function common(key:ResourceKey):String 34 | { 35 | return switch(key) 36 | { 37 | case Title: "Easing Editor"; 38 | case Min: "Min"; 39 | case Max: "Max"; 40 | case From: "From"; 41 | case To: "To"; 42 | case AnimationTime: "Animation Time[sec]"; 43 | case SwitchTime: "Switch Time"; 44 | case SwitchValue: "Switch Value"; 45 | case Undo: "Undo"; 46 | case Redo: "Redo"; 47 | case Weight: "Weight"; 48 | case Repeat: "Repeat"; 49 | case DropToMove: "Move"; 50 | case DropToDuplicate: "Duplicate"; 51 | } 52 | } 53 | 54 | public function getCode():String { 55 | return "en"; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /website/core/api/highlighter.js: -------------------------------------------------------------------------------- 1 | // highlighter adapted from code.haxe.org 2 | (function (console) { "use strict"; 3 | var EReg = function(r,opt) { 4 | opt = opt.split("u").join(""); 5 | this.r = new RegExp(r,opt); 6 | }; 7 | EReg.prototype = { 8 | replace: function(s,by) { 9 | return s.replace(this.r,by); 10 | } 11 | }; 12 | var Highlighter = function() { }; 13 | Highlighter.main = function() { 14 | js.JQuery("pre code").each(function() { 15 | var el = js.JQuery(this); 16 | if(!el.hasClass("highlighted")) { 17 | el.html(Highlighter.syntaxHighlight(el.html())); 18 | el.addClass("highlighted"); 19 | } 20 | }); 21 | }; 22 | Highlighter.syntaxHighlight = function(html) { 23 | var kwds = ["abstract","trace","break","case","cast","class","continue","default","do","dynamic","else","enum","extends","extern","for","function","if","implements","import","in","inline","interface","macro","new","override","package","private","public","return","static","switch","throw","try","typedef","untyped","using","var","while"]; 24 | var kwds1 = new EReg("\\b(" + kwds.join("|") + ")\\b","g"); 25 | var vals = ["null","true","false","this"]; 26 | var vals1 = new EReg("\\b(" + vals.join("|") + ")\\b","g"); 27 | var types = new EReg("\\b([A-Z][a-zA-Z0-9]*)\\b","g"); 28 | html = kwds1.replace(html,"$1"); 29 | html = vals1.replace(html,"$1"); 30 | html = types.replace(html,"$1"); 31 | html = new EReg("(\"[^\"]*\")","g").replace(html,"$1"); 32 | html = new EReg("(//.+\n)","g").replace(html,"$1"); 33 | html = new EReg("(/\\*\\*?[^*]*\\*?\\*/)","g").replace(html,"$1"); 34 | return html; 35 | }; 36 | var q = window.jQuery; 37 | var js = js || {} 38 | js.JQuery = q; 39 | Highlighter.main(); 40 | })(typeof console != "undefined" ? console : {log:function(){}}); -------------------------------------------------------------------------------- /sample/Sample.hxproj: -------------------------------------------------------------------------------- 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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | cmd /c haxe $(OutputFile) 46 | 47 | 48 | 49 | 50 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/core/animation/AnimationManager.hx: -------------------------------------------------------------------------------- 1 | package core.animation; 2 | import component.basic.PreviewAnimation; 3 | import component.complex.ComplexEasingId; 4 | import core.ApplyResult; 5 | import core.RootContext; 6 | import js.Browser; 7 | import js.html.CanvasElement; 8 | import tweenxcore.expr.ComplexEasingKind; 9 | 10 | class AnimationManager 11 | { 12 | public var time:Float; 13 | private var animations:Map; 14 | private var context:RootContext; 15 | 16 | public function new(context:RootContext) 17 | { 18 | this.context = context; 19 | animations = new Map(); 20 | time = 0.25; 21 | } 22 | 23 | public function onFrame(time:Float):Void 24 | { 25 | for (key in animations.keys()) 26 | { 27 | var animation = animations[key]; 28 | animation.onFrame(time); 29 | 30 | if (animation.isDead()) 31 | { 32 | animations.remove(key); 33 | } 34 | } 35 | } 36 | 37 | public function add(id:String, animation:Animation):Void 38 | { 39 | animations[id] = animation; 40 | } 41 | 42 | public function startPreview(id:ComplexEasingId, easing:ComplexEasingKind):Void 43 | { 44 | var canvas = Browser.document.getElementById("preview-canvas-" + id.toString()); 45 | 46 | if (canvas != null) 47 | { 48 | add(id.toString(), new PreviewAnimation(this, cast canvas, easing)); 49 | } 50 | } 51 | 52 | public function changeTime(newTime:Float, result:ApplyResult):Void 53 | { 54 | if (time == newTime) return; 55 | result.addUndoCommand(RootCommand.ChangeAnimationTime(time)); 56 | time = newTime; 57 | result.requestPreview(ComplexEasingId.root(), context.easing.current); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /tools/chain/ChainMaker.hxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | cmd /c haxe $(OutputFile) 44 | 45 | 46 | 47 | 48 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/output/OutputModeSelectView.hx: -------------------------------------------------------------------------------- 1 | package component.output; 2 | import api.react.ReactComponent; 3 | import api.react.ReactComponent.ReactComponentOfProps; 4 | import component.basic.SelectGroupView; 5 | import component.output.OutputModeSelectView; 6 | import core.RootCommand; 7 | import core.RootContext; 8 | import core.output.OutputManager; 9 | import core.output.OutputMode; 10 | import haxe.EnumTools; 11 | import haxe.ds.Option; 12 | import tweenxcore.expr.ComplexEasingKind; 13 | 14 | class OutputModeSelectView extends ReactComponentOfProps 15 | { 16 | public function new(props:OutputModeSelectProps) 17 | { 18 | super(props); 19 | } 20 | 21 | override public function render():ReactComponent 22 | { 23 | var output = props.context.output; 24 | return "div".createElement( 25 | { className: "output-mode-select" }, 26 | OutputModeView.createElement( 27 | { 28 | { 29 | current: Option.Some(output.mode), 30 | data: [for(c in EnumTools.getConstructors(OutputMode)) EnumTools.createByName(OutputMode, c)], 31 | onSelect: onSelect, 32 | getName: props.context.localize.resource.outputMode, 33 | getIcon: getIcon, 34 | } 35 | } 36 | ) 37 | ); 38 | } 39 | 40 | private function onSelect(mode:OutputMode):Void 41 | { 42 | props.context.apply(RootCommand.ChangeOutputMode(mode), true); 43 | } 44 | 45 | private static function getIcon(mode:OutputMode):Option 46 | { 47 | return Option.None; 48 | } 49 | 50 | } 51 | 52 | typedef OutputModeSelectProps = 53 | { 54 | context: RootContext, 55 | } 56 | 57 | private typedef OutputModeView = SelectGroupView; 58 | -------------------------------------------------------------------------------- /tools/CustumEasing/CustomEasing.hxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | cmd /c haxe $(OutputFile) 46 | 47 | 48 | 49 | 50 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/simple/StandardEasingView.hx: -------------------------------------------------------------------------------- 1 | package component.simple; 2 | import api.react.React; 3 | import api.react.ReactComponent; 4 | import api.react.ReactComponent.ReactComponentOfProps; 5 | import component.basic.DropdownButtonView; 6 | import component.basic.SelectGroupView; 7 | import component.complex.ComplexEasingSelectItem; 8 | import core.RootCommand; 9 | import core.easing.EasingCommand; 10 | import haxe.EnumTools; 11 | import component.complex.ComplexEasingId; 12 | import core.RootContext; 13 | import core.focus.FocusState; 14 | import haxe.ds.Option; 15 | import tweenxcore.expr.InOutKind; 16 | import tweenxcore.expr.StandardEasingKind; 17 | class StandardEasingView extends ReactComponentOfProps 18 | { 19 | public function new(props:StandardEasingProps) 20 | { 21 | super(props); 22 | } 23 | 24 | override public function render():ReactComponent 25 | { 26 | return InOutView.createElement( 27 | { 28 | current: Option.Some(props.inOut), 29 | data: [for(c in EnumTools.getConstructors(InOutKind)) EnumTools.createByName(InOutKind, c)], 30 | onSelect: onSelect, 31 | getName: props.context.localize.resource.inOut, 32 | getIcon: getIcon, 33 | } 34 | ); 35 | } 36 | 37 | private function onSelect(inOut:InOutKind):Void 38 | { 39 | props.context.apply(RootCommand.ChangeEasing(props.id, EasingCommand.InOut(inOut)), true); 40 | } 41 | 42 | private static function getIcon(inOut:InOutKind):Option 43 | { 44 | return Option.Some(EnumValueTools.getName(inOut) + ".png"); 45 | } 46 | } 47 | 48 | typedef StandardEasingProps = 49 | { 50 | easing: StandardEasingKind, 51 | inOut: InOutKind, 52 | id: ComplexEasingId, 53 | context: RootContext 54 | } 55 | 56 | private typedef InOutView = SelectGroupView; -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/unary/RepeatView.hx: -------------------------------------------------------------------------------- 1 | package component.unary; 2 | import api.react.React; 3 | import api.react.ReactComponent; 4 | import api.react.ReactComponent.ReactComponentOfProps; 5 | import component.basic.GraphColor; 6 | import component.basic.GraphView; 7 | import component.basic.NumberInputView; 8 | import component.complex.ComplexEasingId; 9 | import core.RootContext; 10 | import core.localize.ResourceKey; 11 | import tweenxcore.expr.ComplexEasingKind; 12 | import tweenxcore.expr.UnaryOpKind; 13 | import tweenxcore.expr.UnaryOpKindTools; 14 | 15 | 16 | class RepeatView extends ReactComponentOfProps 17 | { 18 | public function new(props:RepeatProps) 19 | { 20 | super(props); 21 | } 22 | 23 | override public function render():ReactComponent 24 | { 25 | return React.createElement( 26 | "div", 27 | { 28 | className: "param-group" 29 | }, 30 | NumberInputView.createElement( 31 | { 32 | name: props.context.localize.resource.common(ResourceKey.Repeat), 33 | value: props.repeat, 34 | id: props.id.numberInputId(0), 35 | context: props.context 36 | } 37 | ), 38 | GraphView.createElement( 39 | { 40 | lines: [ 41 | { easing: UnaryOpKindTools.toFunction(UnaryOpKind.Repeat(props.repeat), props.easing), color: GraphColor.Theme }, 42 | ], 43 | partations: [for (i in 0...Math.ceil(props.repeat - 1)) (i + 1) / props.repeat], 44 | scale: 0.45, 45 | } 46 | ) 47 | ); 48 | } 49 | } 50 | 51 | typedef RepeatProps = 52 | { 53 | easing: ComplexEasingKind, 54 | repeat: Float, 55 | id: ComplexEasingId, 56 | context: RootContext 57 | } 58 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/basic/NumberSliderDrag.hx: -------------------------------------------------------------------------------- 1 | package component.basic; 2 | import api.react.ReactEvent; 3 | import component.basic.NumberInputId; 4 | import core.RootCommand; 5 | import core.drag.DragManager; 6 | import core.drag.DragState; 7 | import core.drag.DragStateKind; 8 | import core.focus.FocusManager; 9 | import haxe.ds.Option; 10 | import js.html.Element; 11 | import js.html.Event; 12 | import js.html.MouseEvent; 13 | import js.html.Text; 14 | import tweenxcore.expr.ComplexEasingKind; 15 | import tweenxcore.expr.InOutKind; 16 | import tweenxcore.expr.SimpleEasingKind; 17 | 18 | class NumberSliderDrag implements DragState 19 | { 20 | private var drag:DragManager; 21 | private var centerX:Float; 22 | private var currentX:Float; 23 | 24 | public var centerValue(default, null):Float; 25 | public var kind(default, null):DragStateKind; 26 | public var id(default, null):NumberInputId; 27 | 28 | public function new (drag:DragManager, id:NumberInputId, currentX:Float, centerX:Float, centerValue:Float) 29 | { 30 | this.drag = drag; 31 | this.centerValue = centerValue; 32 | this.currentX = currentX; 33 | this.centerX = centerX; 34 | this.id = id; 35 | kind = DragStateKind.NumberSlider(this); 36 | apply(false); 37 | } 38 | 39 | public function getCurrentValue():Float 40 | { 41 | var value = centerValue + ((currentX - centerX) / (NumberSliderView.BAR_WIDTH / 2)); 42 | return Math.floor(value * 50) / 50; 43 | } 44 | 45 | public function move(e:MouseEvent):Void 46 | { 47 | currentX = e.clientX; 48 | apply(false); 49 | } 50 | 51 | public function finish():Void 52 | { 53 | drag.context.focus.unfocus(); 54 | apply(true); 55 | } 56 | 57 | public function apply(major:Bool):Void 58 | { 59 | drag.context.applyNumberChange(id, getCurrentValue(), major); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /sample/tweenxcore/ImageSample.hx: -------------------------------------------------------------------------------- 1 | package; 2 | import js.html.Image; 3 | import sample.Sprite; 4 | import sample.context.DrawContext; 5 | import sample.context.Drawable; 6 | import tweenxcore.Tools.Easing; 7 | import tweenxcore.structure.FloatChange; 8 | import tweenxcore.structure.FloatChangePart; 9 | import tweenxcore.structure.Timeline; 10 | using tweenxcore.Tools; 11 | 12 | class ImageSample extends Sprite { 13 | public static var TOTAL_FRAME:Int = 1000; 14 | private var frameCount:Int = 0; 15 | private var image:FaceImage; 16 | private var timeline:Timeline; 17 | 18 | public function new() { 19 | super(); 20 | 21 | addChild(image = new FaceImage()); 22 | timeline = new Timeline(); 23 | timeline.add(0, 0.5); 24 | for (i in 1...16) { 25 | timeline.add(i); 26 | } 27 | timeline.add(0, 0.5); 28 | } 29 | 30 | private function update() { 31 | var change = new FloatChange(frameCount, frameCount += 1); 32 | change.handleRepeatPart(0, 100, 10, updatePart); 33 | } 34 | 35 | private function updatePart(part:FloatChangePart) { 36 | var curve = part.current.mixEasing( 37 | Easing.linear, 38 | FloatTools.connectEasing.bind(_, Easing.quadInOut, Easing.quadInOut), 39 | 0.5 40 | ); 41 | image.index = timeline.search(curve).data; 42 | } 43 | } 44 | 45 | 46 | private class FaceImage implements Drawable 47 | { 48 | private var image:Image; 49 | private static var WIDTH:Int = 96; 50 | private static var HEIGHT:Int = 96; 51 | public var index:Int = 0; 52 | 53 | public function new () 54 | { 55 | image = new Image(); 56 | image.src = "/images/character.png"; 57 | } 58 | 59 | 60 | public function draw(context:DrawContext):Void 61 | { 62 | context.context.drawImage(image, WIDTH * index, 0, WIDTH, HEIGHT, 0, 0, WIDTH, HEIGHT); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/menu/MenuView.hx: -------------------------------------------------------------------------------- 1 | package component.menu; 2 | import api.react.ReactComponent; 3 | import component.basic.NumberInputId; 4 | import component.basic.NumberInputView; 5 | import component.basic.SelectGroupView; 6 | import core.RootContext; 7 | import core.localize.ResourceKey; 8 | 9 | class MenuView extends ReactComponentOfProps 10 | { 11 | public function new(props:MenuProps) 12 | { 13 | super(props); 14 | } 15 | 16 | override public function render():ReactComponent 17 | { 18 | return "div".createElement( 19 | { 20 | className: "menu" 21 | }, 22 | [ 23 | "div".createElement( 24 | { 25 | className: "menu-item" 26 | }, 27 | HistoryView.createElement( 28 | { 29 | context: props.context 30 | } 31 | ) 32 | ), 33 | "div".createElement( 34 | { 35 | className: "menu-item" 36 | }, 37 | NumberInputView.createElement( 38 | { 39 | name: props.context.localize.resource.common(ResourceKey.AnimationTime), 40 | value: props.context.animation.time, 41 | id: NumberInputId.AnimationTime, 42 | context: props.context, 43 | } 44 | ) 45 | ), 46 | "div".createElement( 47 | { 48 | className: "menu-item" 49 | }, 50 | LocaleView.createElement(props) 51 | ) 52 | ] 53 | ); 54 | } 55 | } 56 | 57 | typedef MenuProps = 58 | { 59 | context: RootContext, 60 | } 61 | -------------------------------------------------------------------------------- /sample/tweenx/800_BenchMark/BenchMark.hxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | cmd /c haxe $(OutputFile) 46 | 47 | 48 | 49 | 50 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/component/complex/ComplexEasingCreateContext.hx: -------------------------------------------------------------------------------- 1 | package component.complex; 2 | import tweenxcore.expr.BinaryOpKind; 3 | import tweenxcore.expr.ComplexEasingKind; 4 | import tweenxcore.expr.InOutKind; 5 | import tweenxcore.expr.SimpleEasingKind; 6 | import tweenxcore.expr.StandardEasingKind; 7 | import tweenxcore.expr.UnaryOpKind; 8 | 9 | class ComplexEasingCreateContext 10 | { 11 | private var prevEasing:ComplexEasingKind; 12 | 13 | public function new(prevEasing:ComplexEasingKind) 14 | { 15 | this.prevEasing = prevEasing; 16 | } 17 | 18 | public function getInOut():InOutKind 19 | { 20 | return _getInOut(prevEasing); 21 | } 22 | 23 | private static function _getInOut(easing:ComplexEasingKind):InOutKind 24 | { 25 | return switch (easing) 26 | { 27 | case ComplexEasingKind.Op(nextEasing, _): 28 | _getInOut(nextEasing); 29 | 30 | case ComplexEasingKind.Simple(SimpleEasingKind.Standard(_, inOut)): 31 | inOut; 32 | 33 | case ComplexEasingKind.Simple(_): 34 | InOutKind.In; 35 | } 36 | } 37 | 38 | public function getEasing():ComplexEasingKind 39 | { 40 | return prevEasing; 41 | } 42 | 43 | public function getControls():Array 44 | { 45 | return _getControls(prevEasing); 46 | } 47 | 48 | private static function _getControls(easing:ComplexEasingKind):Array 49 | { 50 | return switch (easing) 51 | { 52 | case ComplexEasingKind.Op(nextEasing, _): 53 | _getControls(nextEasing); 54 | 55 | case ComplexEasingKind.Simple(SimpleEasingKind.Line(_, controls)): 56 | controls.copy(); 57 | 58 | case ComplexEasingKind.Simple(_): 59 | [0, 0, 1, 1]; 60 | } 61 | } 62 | 63 | 64 | } -------------------------------------------------------------------------------- /TweenX.hxproj: -------------------------------------------------------------------------------- 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 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | cmd /c haxe $(OutputFile) --times 47 | 48 | 49 | 50 | 51 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /tools/CustumEasing/src/Application.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | import api.react.ReactComponent; 4 | import api.react.ReactDOM; 5 | import component.complex.ComplexEasingId; 6 | import component.complex.ComplexEasingView; 7 | import component.menu.MenuView; 8 | import component.output.OutputView; 9 | import core.RootContext; 10 | import core.localize.ResourceKey; 11 | import js.Browser; 12 | 13 | class Application extends ReactComponentOfProps 14 | { 15 | static public function main() 16 | { 17 | ReactDOM.render( 18 | Application.createElement( 19 | { 20 | context: new RootContext(), 21 | } 22 | ), 23 | Browser.document.getElementById('application') 24 | ); 25 | } 26 | 27 | public function new(props:ComplexEasingProps) 28 | { 29 | super(props); 30 | props.context.setup(this); 31 | } 32 | 33 | public override function componentDidMount():Void 34 | { 35 | props.context.init(); 36 | } 37 | 38 | override function render():ReactComponent 39 | { 40 | return "div".createElement( 41 | {}, 42 | [ 43 | "h2".createElement( 44 | {}, 45 | "a".createElement( 46 | { href: "./" }, 47 | props.context.localize.resource.common(ResourceKey.Title) 48 | ) 49 | ), 50 | MenuView.createElement(props), 51 | ComplexEasingView.createElement( 52 | { 53 | easing: props.context.easing.current, 54 | id: ComplexEasingId.root(), 55 | context: props.context 56 | } 57 | ), 58 | OutputView.createElement(props) 59 | ] 60 | ); 61 | } 62 | } 63 | 64 | typedef ApplicationProps = 65 | { 66 | context: RootContext, 67 | } 68 | -------------------------------------------------------------------------------- /sample/tweenx/018_RelativeTween/Main.hx: -------------------------------------------------------------------------------- 1 | import flash.display.Sprite; 2 | import flash.display.Shape; 3 | import flash.geom.Matrix; 4 | 5 | import tweenx909.TweenX; 6 | import tweenx909.EaseX; 7 | using tweenx909.ChainX; 8 | 9 | class Main extends Sprite { 10 | static inline var CELL_SIZE = 20; 11 | public function new() { 12 | super(); 13 | 14 | //Draw background 15 | graphics.lineStyle(1, 0xEEEEEE); 16 | var end = CELL_SIZE * 20; 17 | for (i in 0...21) { 18 | var p = i * CELL_SIZE; 19 | graphics.moveTo(0, p); 20 | graphics.lineTo(end, p); 21 | graphics.moveTo(p, 0); 22 | graphics.lineTo(p, end); 23 | } 24 | 25 | //Make square 26 | var square = new Square(CELL_SIZE * 2); 27 | addChild(square); 28 | 29 | //Tween!! 30 | TweenX.serial([ 31 | TweenX.serial([ 32 | TweenX.to(square).xy(360, 0), 33 | TweenX.to(square).xy(360, 360), 34 | TweenX.to(square).xy( 0, 360), 35 | TweenX.to(square).xy( 0, 0), 36 | ]), 37 | TweenX.wait(0.5), 38 | TweenX.serial([ 39 | TweenX.to(square)._xy(360, 0), 40 | TweenX.to(square)._xy(360, 360), 41 | TweenX.to(square)._xy( 0, 360), 42 | TweenX.to(square)._xy( 0, 0), 43 | ]), 44 | TweenX.wait(0.5), 45 | TweenX.serial([ 46 | TweenX.to(square).__xy( 360, 0), 47 | TweenX.to(square).__xy( 0, 360), 48 | TweenX.to(square).__xy(-360, 0), 49 | TweenX.to(square).__xy( 0, -360), 50 | ]), 51 | ]).delay(0.5); 52 | } 53 | } 54 | 55 | private class Square extends Shape { 56 | public function new(size:Float) { 57 | super(); 58 | graphics.beginFill(0x335F73); 59 | graphics.drawRect(0, 0, size, size); 60 | } 61 | } 62 | --------------------------------------------------------------------------------