Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass on view animation helper class and sample #31

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cinderblock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

<headerPattern>src/debug/*.h</headerPattern>
<sourcePattern>src/debug/*.cpp</sourcePattern>

<headerPattern>src/utils/*.h</headerPattern>
<sourcePattern>src/utils/*.cpp</sourcePattern>

<includePath>src</includePath>
</block>
Expand Down
7 changes: 7 additions & 0 deletions samples/ViewAnimationsSample/include/Resources.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once
#include "cinder/CinderResources.h"

//#define RES_MY_RES CINDER_RESOURCE( ../resources/, image_name.png, 128, IMAGE )



Binary file not shown.
63 changes: 63 additions & 0 deletions samples/ViewAnimationsSample/src/ViewAnimationsSampleApp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "BaseApp.h"
#include "SettingsManager.h"
#include "utils/ViewAnimations.h"

using namespace ci;
using namespace ci::app;
using namespace std;
using namespace bluecadet::views;
using namespace bluecadet::utils;

class ViewAnimationsSampleApp : public BaseApp {
public:
void setup() override;
void mouseDown( MouseEvent event ) override;
void mouseUp(MouseEvent event) override;
void update() override;
void draw() override;
static void prepareSettings(ci::app::App::Settings* settings);

BaseViewRef testView;
};

void ViewAnimationsSampleApp::setup()
{
BaseApp::setup();
testView = BaseViewRef(new BaseView());
testView->setSize(vec2(10, 10));
testView->setPosition(vec2(5, 5));
testView->setBackgroundColor(Color(1, 0, 0));
mRootView->addChild(testView);
}

void ViewAnimationsSampleApp::prepareSettings(ci::app::App::Settings* settings) {
BaseApp::prepareSettings(settings);
SettingsManager::getInstance()->mDebugFullscreen = false;
SettingsManager::getInstance()->mDebugWindowSize = vec2(200, 200);
}

void ViewAnimationsSampleApp::mouseDown( MouseEvent event )
{
//ViewAnimations::fadeOut(testView, 0.5f);
testView->getTimeline()->apply(&testView->getAlpha(), 0.0f, 2.0f, EaseInExpo());
}

void ViewAnimationsSampleApp::mouseUp(MouseEvent event)
{
ViewAnimations::fadeIn(testView, 0.5f);
}

void ViewAnimationsSampleApp::update()
{
BaseApp::update();
}

void ViewAnimationsSampleApp::draw()
{
BaseApp::draw();
}

CINDER_APP( ViewAnimationsSampleApp, RendererGl )
3 changes: 3 additions & 0 deletions samples/ViewAnimationsSample/vc2013/Resources.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "../include/Resources.h"

1 ICON "..\\resources\\cinder_app_icon.ico"
20 changes: 20 additions & 0 deletions samples/ViewAnimationsSample/vc2013/ViewAnimationsSample.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ViewAnimationsSample", "ViewAnimationsSample.vcxproj", "{C4E27AC9-684D-40D2-A1AA-691A9949BAF9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C4E27AC9-684D-40D2-A1AA-691A9949BAF9}.Debug|x64.ActiveCfg = Debug|x64
{C4E27AC9-684D-40D2-A1AA-691A9949BAF9}.Debug|x64.Build.0 = Debug|x64
{C4E27AC9-684D-40D2-A1AA-691A9949BAF9}.Release|x64.ActiveCfg = Release|x64
{C4E27AC9-684D-40D2-A1AA-691A9949BAF9}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
159 changes: 159 additions & 0 deletions samples/ViewAnimationsSample/vc2013/ViewAnimationsSample.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C4E27AC9-684D-40D2-A1AA-691A9949BAF9}</ProjectGuid>
<RootNamespace>ViewAnimationsSample</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\include;"..\..\..\..\..\include";..\..\..\..\Cinder-BluecadetText\src;..\..\..\..\Cinder-BluecadetTouch\src;..\..\..\..\Cinder-BluecadetUtils\src;..\..\..\src;..\..\..\..\OSC\src;..\..\..\..\TUIO\src</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0601;_WINDOWS;NOMINMAX;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>"..\..\..\..\..\include";..\include</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>cinder-$(PlatformToolset)_d.lib;OpenGL32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>"..\..\..\..\..\lib\msw\$(PlatformTarget)"</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
<IgnoreSpecificDefaultLibraries>LIBCMT;LIBCPMT</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\include;"..\..\..\..\..\include";..\..\..\..\Cinder-BluecadetText\src;..\..\..\..\Cinder-BluecadetTouch\src;..\..\..\..\Cinder-BluecadetUtils\src;..\..\..\src;..\..\..\..\OSC\src;..\..\..\..\TUIO\src</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=0x0601;_WINDOWS;NOMINMAX;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<ResourceCompile>
<AdditionalIncludeDirectories>"..\..\..\..\..\include";..\include</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>cinder-$(PlatformToolset).lib;OpenGL32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>"..\..\..\..\..\lib\msw\$(PlatformTarget)"</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding />
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention />
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="Resources.rc" />
</ItemGroup>
<ItemGroup />
<ItemGroup />
<ItemGroup>
<ClCompile Include="..\src\ViewAnimationsSampleApp.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetText\src\FontManager.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetText\src\StyledTextLayout.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetText\src\StyledTextParser.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetText\src\StyleManager.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetTouch\src\TouchManager.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetTouch\src\drivers\MouseDriver.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetTouch\src\drivers\NativeTouchDriver.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetTouch\src\drivers\SimulatedTouchDriver.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetTouch\src\drivers\TuioDriver.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetUtils\src\ImageManager.cpp" />
<ClCompile Include="..\..\..\..\Cinder-BluecadetUtils\src\SettingsManager.cpp" />
<ClCompile Include="..\..\..\src\BaseApp.cpp" />
<ClCompile Include="..\..\..\src\BaseView.cpp" />
<ClCompile Include="..\..\..\src\EllipseView.cpp" />
<ClCompile Include="..\..\..\src\ImageView.cpp" />
<ClCompile Include="..\..\..\src\LineView.cpp" />
<ClCompile Include="..\..\..\src\ScreenLayoutView.cpp" />
<ClCompile Include="..\..\..\src\TextView.cpp" />
<ClCompile Include="..\..\..\src\TouchView.cpp" />
<ClCompile Include="..\..\..\src\debug\StatsView.cpp" />
<ClCompile Include="..\..\..\src\utils\ViewAnimations.cpp" />
<ClCompile Include="..\..\..\..\OSC\src\Osc.cpp" />
<ClCompile Include="..\..\..\..\TUIO\src\Tuio.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\Resources.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetText\src\FontManager.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetText\src\StyledTextLayout.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetText\src\StyledTextParser.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetText\src\StyleManager.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetText\src\Text.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetTouch\src\Touch.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetTouch\src\TouchManager.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetTouch\src\drivers\MouseDriver.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetTouch\src\drivers\NativeTouchDriver.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetTouch\src\drivers\SimulatedTouchDriver.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetTouch\src\drivers\TuioDriver.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetUtils\src\ImageManager.h" />
<ClInclude Include="..\..\..\..\Cinder-BluecadetUtils\src\SettingsManager.h" />
<ClInclude Include="..\..\..\src\BaseApp.h" />
<ClInclude Include="..\..\..\src\BaseView.h" />
<ClInclude Include="..\..\..\src\EllipseView.h" />
<ClInclude Include="..\..\..\src\ImageView.h" />
<ClInclude Include="..\..\..\src\LineView.h" />
<ClInclude Include="..\..\..\src\ScreenLayoutView.h" />
<ClInclude Include="..\..\..\src\TextView.h" />
<ClInclude Include="..\..\..\src\TouchView.h" />
<ClInclude Include="..\..\..\src\debug\StatsView.h" />
<ClInclude Include="..\..\..\src\utils\ViewAnimations.h" />
<ClInclude Include="..\..\..\..\OSC\src\Osc.h" />
<ClInclude Include="..\..\..\..\TUIO\src\Tuio.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
Loading