<ui-application appid="text-field.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-field.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
<label>Text Field</label>
</ui-application>
+ <ui-application appid="text-fonts.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-fonts.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
+ <label>Text Fonts</label>
+ </ui-application>
<ui-application appid="text-message-field.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-message-field.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
<label>Text Label</label>
</ui-application>
const std::string BUTTON_OK( "Ok" );
const std::string BUTTON_CANCEL( "Cancel" );
-const std::string DEFAULT_BACKGROUND_IMAGE_PATH( DALI_IMAGE_DIR "background-gradient.jpg" );
-const std::string LOGO_PATH( DALI_IMAGE_DIR "dali-logo.png" );
+const std::string LOGO_PATH( DALI_IMAGE_DIR "Logo-for-demo.png" );
const std::string DEFAULT_TOOLBAR_IMAGE_PATH( DALI_IMAGE_DIR "top-bar.png" );
const std::string BUTTON_BACKGROUND(DALI_IMAGE_DIR "button-background.png");
const std::string TILE_BACKGROUND(DALI_IMAGE_DIR "item-background.png");
/**
* Creates the background image
*/
-ImageView CreateBackground( std::string imagePath )
+Control CreateBackground( std::string stylename )
{
- Image image = ResourceImage::New( imagePath );
- ImageView background = ImageView::New( image );
+ Control background = Control::New();
+ Stage::GetCurrent().Add( background );
+ background.SetProperty( Control::Property::STYLE_NAME,stylename);
background.SetName( "BACKGROUND" );
background.SetAnchorPoint( AnchorPoint::CENTER );
background.SetParentOrigin( ParentOrigin::CENTER );
- background.SetZ( -1.0f );
background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
return background;
mBackgroundAnimations(),
mExampleList(),
mExampleMap(),
- mBackgroundImagePath( DEFAULT_BACKGROUND_IMAGE_PATH ),
mTotalPages(),
mScrolling( false ),
mSortAlphabetically( false ),
mExampleMap[ example.name ] = example;
}
-void DaliTableView::SetBackgroundPath( std::string imagePath )
-{
- mBackgroundImagePath = imagePath;
-}
-
void DaliTableView::SortAlphabetically( bool sortAlphabetically )
{
mSortAlphabetically = sortAlphabetically;
const Vector2 stageSize = Stage::GetCurrent().GetSize();
// Background
- ImageView background = CreateBackground( mBackgroundImagePath );
+ Control background = CreateBackground( "launcherbackground" );
Stage::GetCurrent().Add( background );
- // Render entire content as overlays, as is all on same 2D plane.
+ // Add root actor
mRootActor = TableView::New( 4, 1 );
mRootActor.SetAnchorPoint( AnchorPoint::CENTER );
mRootActor.SetParentOrigin( ParentOrigin::CENTER );
void AddExample(Example example);
/**
- * Sets the background image PATH.
- *
- * @param[in] imagePath The file path to the image to use as the background.
- *
- * @note Should be called before the Application MainLoop is started.
- */
- void SetBackgroundPath( std::string imagePath );
-
- /**
* Sorts the example list alphabetically by Title if parameter is true.
*
* @param[in] sortAlphabetically If true, example list is sorted alphabetically.
ExampleList mExampleList; ///< List of examples.
ExampleMap mExampleMap; ///< Map LUT for examples.
- std::string mBackgroundImagePath; ///< The path to the background image.
int mTotalPages; ///< Total pages within scrollview.
bool mScrolling:1; ///< Flag indicating whether view is currently being scrolled
const float TRANSITION_DURATION = 2.5f; //2.5 second
-const float INITIAL_DEPTH = -10.0f;
+const float INITIAL_DEPTH = 10.0f;
/**
* @brief Load an image, scaled-down to no more than the stage dimensions.
Toolkit::TextLabel mTitleActor;
Actor mParent;
- ImageActor mCurrentImage;
- ImageActor mNextImage;
+ Toolkit::ImageView mCurrentImage;
+ Toolkit::ImageView mNextImage;
unsigned int mIndex;
- ShaderEffect mCurrentImageEffect;
- ShaderEffect mNextImageEffect;
+ Property::Map mDissolveEffect;
+ Property::Map mEmptyEffect;
+
bool mUseHighPrecision;
Animation mAnimation;
bool mTimerReady;
unsigned int mCentralLineIndex;
+ Image mIconPlay;
+ Image mIconPlaySelected;
+ Image mIconStop;
+ Image mIconStopSelected;
Toolkit::PushButton mPlayStopButton;
+ Image mIconHighP;
+ Image mIconHighPSelected;
+ Image mIconMediumP;
+ Image mIconMediumPSelected;
Toolkit::PushButton mEffectChangeButton;
};
mContent = DemoHelper::CreateView( application, mView,mToolBar, "", TOOLBAR_IMAGE, "" );
// Add an effect-changing button on the right of the tool bar.
+ mIconHighP = ResourceImage::New( EFFECT_HIGHP_IMAGE );
+ mIconHighPSelected = ResourceImage::New( EFFECT_HIGHP_IMAGE_SELECTED );
+ mIconMediumP = ResourceImage::New( EFFECT_MEDIUMP_IMAGE );
+ mIconMediumPSelected = ResourceImage::New( EFFECT_MEDIUMP_IMAGE_SELECTED );
mEffectChangeButton = Toolkit::PushButton::New();
- mEffectChangeButton.SetUnselectedImage( EFFECT_HIGHP_IMAGE );
- mEffectChangeButton.SetSelectedImage( EFFECT_HIGHP_IMAGE_SELECTED );
+ mEffectChangeButton.SetButtonImage( mIconHighP );
+ mEffectChangeButton.SetSelectedImage( mIconHighPSelected );
mEffectChangeButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnEffectButtonClicked );
mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter );
// Add an slide-show button on the right of the title
+ mIconPlay = ResourceImage::New( PLAY_ICON );
+ mIconPlaySelected = ResourceImage::New( PLAY_ICON_SELECTED );
+ mIconStop = ResourceImage::New( STOP_ICON );
+ mIconStopSelected = ResourceImage::New( STOP_ICON_SELECTED );
mPlayStopButton = Toolkit::PushButton::New();
- mPlayStopButton.SetUnselectedImage( PLAY_ICON );
- mPlayStopButton.SetSelectedImage( PLAY_ICON_SELECTED );
+ mPlayStopButton.SetButtonImage( mIconPlay );
+ mPlayStopButton.SetSelectedImage( mIconPlaySelected );
mPlayStopButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnSildeshowButtonClicked );
mToolBar.AddControl( mPlayStopButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
mPanGestureDetector = PanGestureDetector::New();
mPanGestureDetector.DetectedSignal().Connect( this, &DissolveEffectApp::OnPanGesture );
- // create the dissolve effect object
- mCurrentImageEffect = Toolkit::CreateDissolveEffect(mUseHighPrecision);
- mNextImageEffect = Toolkit::CreateDissolveEffect(mUseHighPrecision);
-
mViewTimer = Timer::New( VIEWINGTIME );
mViewTimer.TickSignal().Connect( this, &DissolveEffectApp::OnTimerTick );
mTimerReady = true;
mContent.Add( mParent );
// show the first image
- mCurrentImage = ImageActor::New( LoadStageFillingImage( IMAGES[mIndex] ) );
+ mCurrentImage = Toolkit::ImageView::New( LoadStageFillingImage( IMAGES[mIndex] ) );
mCurrentImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
mCurrentImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mCurrentImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mParent.Add( mCurrentImage );
mPanGestureDetector.Attach( mCurrentImage );
+
+ mDissolveEffect = Dali::Toolkit::CreateDissolveEffect( mUseHighPrecision );
+ mEmptyEffect.Insert( "shader", Property::Value() );
}
// signal handler, called when the pan gesture is detected
}
Image image = LoadStageFillingImage( IMAGES[ mIndex ] );
- mNextImage = ImageActor::New( image );
+ mNextImage = Toolkit::ImageView::New( image );
mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
{
mAnimation = Animation::New(TRANSITION_DURATION);
- Dali::Toolkit::DissolveEffectSetCentralLine( mCurrentImageEffect, position, displacement );
- mCurrentImageEffect.SetUniform("uPercentage", 0.0f);
- mCurrentImage.SetShaderEffect(mCurrentImageEffect);
- mAnimation.AnimateTo( Property(mCurrentImageEffect, "uPercentage"), 1.0f, AlphaFunction::LINEAR );
+ Dali::Toolkit::DissolveEffectSetCentralLine( mCurrentImage, position, displacement, 0.0f );
+ mCurrentImage.SetProperty( Toolkit::ImageView::Property::IMAGE, mDissolveEffect );
+ mAnimation.AnimateTo( Property( mCurrentImage, "uPercentage" ), 1.0f, AlphaFunction::LINEAR );
mNextImage.SetOpacity(0.0f);
mAnimation.AnimateTo( Property( mNextImage, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::LINEAR );
if(mUseHighPrecision)
{
- Dali::Toolkit::DissolveEffectSetCentralLine( mNextImageEffect, position, displacement );
- mNextImageEffect.SetUniform("uPercentage", 1.0f);
- mNextImage.SetShaderEffect(mNextImageEffect);
- mAnimation.AnimateTo( Property(mNextImageEffect, "uPercentage"), 0.0f, AlphaFunction::LINEAR );
+ Dali::Toolkit::DissolveEffectSetCentralLine( mNextImage, position, displacement, 1.0f );
+ mNextImage.SetProperty( Toolkit::ImageView::Property::IMAGE, mDissolveEffect );
+ mAnimation.AnimateTo( Property( mNextImage, "uPercentage" ), 0.0f, AlphaFunction::LINEAR );
}
else
{
bool DissolveEffectApp::OnEffectButtonClicked( Toolkit::Button button )
{
mUseHighPrecision = !mUseHighPrecision;
- mCurrentImageEffect = Dali::Toolkit::CreateDissolveEffect(mUseHighPrecision);
+ mDissolveEffect = Dali::Toolkit::CreateDissolveEffect(mUseHighPrecision);
if(mUseHighPrecision)
{
mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_HIGHP) );
- mEffectChangeButton.SetUnselectedImage( EFFECT_HIGHP_IMAGE );
- mEffectChangeButton.SetSelectedImage( EFFECT_HIGHP_IMAGE_SELECTED );
+ mEffectChangeButton.SetButtonImage( mIconHighP );
+ mEffectChangeButton.SetSelectedImage( mIconHighPSelected );
}
else
{
mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_MEDIUMP) );
- mEffectChangeButton.SetUnselectedImage( EFFECT_MEDIUMP_IMAGE );
- mEffectChangeButton.SetSelectedImage( EFFECT_MEDIUMP_IMAGE_SELECTED );
+ mEffectChangeButton.SetButtonImage( mIconMediumP );
+ mEffectChangeButton.SetSelectedImage( mIconMediumPSelected );
}
return true;
mSlideshow = !mSlideshow;
if( mSlideshow )
{
- mPlayStopButton.SetUnselectedImage( STOP_ICON );
- mPlayStopButton.SetSelectedImage( STOP_ICON_SELECTED );
+ mPlayStopButton.SetButtonImage( mIconStop );
+ mPlayStopButton.SetSelectedImage( mIconStopSelected );
mPanGestureDetector.Detach( mParent );
mViewTimer.Start();
mTimerReady = false;
}
else
{
- mPlayStopButton.SetUnselectedImage( PLAY_ICON );
- mPlayStopButton.SetSelectedImage( PLAY_ICON_SELECTED );
+ mPlayStopButton.SetButtonImage( mIconPlay );
+ mPlayStopButton.SetSelectedImage( mIconPlaySelected );
mTimerReady = true;
mPanGestureDetector.Attach( mParent );
}
void DissolveEffectApp::OnTransitionCompleted( Animation& source )
{
- mCurrentImage.RemoveShaderEffect();
- mNextImage.RemoveShaderEffect();
+ mNextImage.SetProperty( Toolkit::ImageView::Property::IMAGE, mEmptyEffect );
mParent.Remove( mCurrentImage );
mPanGestureDetector.Detach( mCurrentImage );
mCurrentImage = mNextImage;
{
mIndex = (mIndex + 1)%NUM_IMAGES;
Image image = LoadStageFillingImage( IMAGES[ mIndex ] );
- mNextImage = ImageActor::New( image );
+ mNextImage = Toolkit::ImageView::New( image );
mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mHeightBox = Toolkit::ImageView::New( heightBackground );
mHeightBox.SetOpacity( 0.2f );
- stage.Add( mHeightBox );
+ background.Add( mHeightBox );
mWidthBox = Toolkit::ImageView::New( widthBackground );
mWidthBox.SetOpacity( 0.2f );
- stage.Add( mWidthBox );
+ background.Add( mWidthBox );
mDesiredBox = Toolkit::ImageView::New( desiredBackground );
- stage.Add( mDesiredBox );
+ background.Add( mDesiredBox );
mDesiredBox.SetSize( stage.GetSize() * mImageStageScale );
mDesiredBox.SetParentOrigin( ParentOrigin::CENTER );
mImageActor.SetSortModifier(5.f);
// Display the actor on the stage
- stage.Add( mImageActor );
+ background.Add( mImageActor );
mImageActor.SetSize( stage.GetSize() * mImageStageScale );
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/images/atlas.h>
+#include <dali/devel-api/rendering/cull-face.h>
using namespace Dali;
using namespace Dali::Toolkit;
mReplaceButton.SetVisible( false );
stage.Add( mReplaceButton );
+ // Store one 1x1 white image for multiple items to share for backgrounds:
+ mWhiteImage = BufferImage::WHITE();
+
// Create the item view actor
mImageAtlas = CreateImageAtlas();
mItemView = ItemView::New(*this);
// Set the title and icon to the current layout
SetLayoutTitle();
SetLayoutImage();
-
- // Store one 1x1 white image for multiple items to share for backgrounds:
- mWhiteImage = BufferImage::WHITE();
}
Actor OnKeyboardPreFocusChange( Actor current, Actor proposed, Control::KeyboardFocus::Direction direction )
checkbox.SetSize( spiralItemSize.width * 0.2f, spiralItemSize.width * 0.2f );
checkbox.SetPosition( -SELECTION_BORDER_WIDTH, SELECTION_BORDER_WIDTH );
checkbox.SetZ( 1.0f );
- checkbox.SetSortModifier( -50.0f );
+ SetCullFace(checkbox, Dali::CullBack);
+ checkbox.SetSortModifier( 150.0f );
if( MODE_REMOVE_MANY != mMode &&
MODE_INSERT_MANY != mMode &&
MODE_REPLACE_MANY != mMode )
tick.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
tick.SetSize( spiralItemSize.width * 0.2f, spiralItemSize.width * 0.2f );
tick.SetZ( 1.0f );
- tick.SetSortModifier( -50.0f );
+ tick.SetSortModifier( 150.0f );
tick.SetVisible( false );
+ SetCullFace(tick, Dali::CullBack);
checkbox.Add( tick );
// Connect new items for various editing modes
Stage::GetCurrent().Add(overlay);
mMagnifier = Toolkit::Magnifier::New();
- mMagnifier.SetSourceActor( mView.GetChildAt( 0 ) );
+ mMagnifier.SetSourceActor( mView );
mMagnifier.SetSize( MAGNIFIER_SIZE * mStageSize.width ); // Size of magnifier is in relation to stage width
mMagnifier.SetProperty( Toolkit::Magnifier::Property::MAGNIFICATION_FACTOR, MAGNIFICATION_FACTOR );
mMagnifier.SetScale(Vector3::ZERO);
// Create bouncing magnifier automatically bounces around screen.
mBouncingMagnifier = Toolkit::Magnifier::New();
- mBouncingMagnifier.SetSourceActor( mView.GetChildAt( 0 ) );
+ mBouncingMagnifier.SetSourceActor( mView );
mBouncingMagnifier.SetSize( MAGNIFIER_SIZE * mStageSize.width ); // Size of magnifier is in relation to stage width
mBouncingMagnifier.SetProperty( Toolkit::Magnifier::Property::MAGNIFICATION_FACTOR, MAGNIFICATION_FACTOR );
overlay.Add( mBouncingMagnifier );
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * @file text-fonts-example.cpp
+ * @brief Example of various TextLabel each with different font set ups,
+ * enables Testing of Font when the system font changes.
+ The first label is free, with no font family set, it could use the default system font and change as it changes.
+ The second label has it's font family set via the demo json file. It should not change when the system font changes.
+ The third label has it's font family set in code via SetProperty. It also should not change when the system font changes.
+ The forth label is not shown until the button along the bottom is pressed, it has no font set so the newly created label should use the system font,
+ Pressing the button again resets and unparents that button and then re-adds it.
+ */
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/dali-toolkit.h>
+#include <iostream>
+
+// INTERNAL INCLUDES
+#include "shared/multi-language-strings.h"
+#include "shared/view.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+using namespace MultiLanguageStrings;
+
+namespace
+{
+ const char* const LABEL_TEXT = "A Quick Fox";
+ const char* const LABEL_TEXT_MIXED = "Fox 구미호";
+ const char* const LABEL_TEXT_KOREAN = "구미호";
+}
+
+/**
+ * @brief The main class of the demo.
+ */
+class TextFontsExample : public ConnectionTracker
+{
+public:
+
+ TextFontsExample( Application& application )
+ : mApplication( application ),
+ mToggle(true)
+ {
+ // Connect to the Application's Init signal
+ mApplication.InitSignal().Connect( this, &TextFontsExample::Create );
+ }
+
+ ~TextFontsExample()
+ {
+ // Nothing to do here.
+ }
+
+ void CreateTextLabel( TextLabel& textLabel, std::string textString, const Vector4& color, bool infoLabel=false )
+ {
+ textLabel = TextLabel::New( textString );
+ textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
+ textLabel.SetProperty( TextLabel::Property::MULTI_LINE, true );
+ if ( infoLabel )
+ {
+ textLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE );
+ textLabel.SetProperty( TextLabel::Property::POINT_SIZE, 12.0f );
+ textLabel.SetProperty( TextLabel::Property::FONT_FAMILY, "SamsungOneUI" );
+ }
+ else
+ {
+ textLabel.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 0.3f, 0.3f ) );
+ textLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK );
+ textLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
+ }
+ textLabel.SetBackgroundColor( color );
+ }
+
+ void CreateContainer( Control& container, const Vector2 size )
+ {
+ container = Control::New();
+ container.SetSize( size );
+ container.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ container.SetDrawMode( DrawMode::OVERLAY_2D );
+ }
+
+ void CreateFolderButton( PushButton& button )
+ {
+ button = PushButton::New();
+ button.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+ button.SetSize( 50.0f, 50.0f );
+ }
+
+ bool OnButtonClicked( Toolkit::Button button )
+ {
+ if ( mLabel4 )
+ {
+ UnparentAndReset( mLabel4 );
+ }
+
+ if ( !mContainer4 )
+ {
+ CreateContainer ( mContainer4 , mLayoutSize);
+ Stage stage = Stage::GetCurrent();
+ Vector2 stageSize = stage.GetSize();
+ mContainer4.SetPosition( 0, stageSize.height*0.25f*3 );
+ stage.Add( mContainer4 );
+ // Info
+ CreateContainer ( mContainer4Info , mLayoutSize );
+ mContainer4Info.SetParentOrigin( ParentOrigin::TOP_RIGHT );
+ mContainer4.Add( mContainer4Info );
+ CreateTextLabel ( mLabel4Info, "system free", Color::BLACK, true );
+ mContainer4Info.Add ( mLabel4Info );
+ }
+
+ if ( mToggle )
+ {
+ CreateTextLabel ( mLabel4, LABEL_TEXT_KOREAN, Color::WHITE );
+ mToggle = false;
+ }
+ else
+ {
+ CreateTextLabel ( mLabel4, LABEL_TEXT_MIXED, Color::WHITE );
+ mToggle = true;
+ }
+
+ mContainer4.Add( mLabel4 );
+
+ return true;
+ }
+
+ /**
+ * One-time setup in response to Application InitSignal.
+ */
+ void Create( Application& application )
+ {
+ Stage stage = Stage::GetCurrent();
+ Vector2 stageSize = stage.GetSize();
+
+ stage.KeyEventSignal().Connect(this, &TextFontsExample::OnKeyEvent);
+
+ CreateFolderButton ( mButton );
+ mButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ mButton.ClickedSignal().Connect( this, &TextFontsExample::OnButtonClicked );
+ stage.Add( mButton );
+
+ mLayoutSize = Vector2( stageSize.width*0.5f, stageSize.height*0.10f );
+ CreateContainer ( mContainer , mLayoutSize);
+ CreateContainer ( mContainer2 , mLayoutSize );
+ CreateContainer ( mContainer3 , mLayoutSize );
+
+ // Info about Text Label and if font should be fixed or free to change with system
+ CreateContainer ( mContainerInfo , mLayoutSize );
+ CreateContainer ( mContainer2Info , mLayoutSize );
+ CreateContainer ( mContainer3Info , mLayoutSize );
+ mContainerInfo.SetParentOrigin( ParentOrigin::TOP_RIGHT );
+ mContainer2Info.SetParentOrigin( ParentOrigin::TOP_RIGHT );
+ mContainer3Info.SetParentOrigin( ParentOrigin::TOP_RIGHT );
+ mContainer.Add( mContainerInfo );
+ mContainer2.Add( mContainer2Info );
+ mContainer3.Add( mContainer3Info );
+ CreateTextLabel ( mLabelInfo, "system free", Color::BLACK, true );
+ CreateTextLabel ( mLabel2Info, "json fixed", Color::BLACK, true );
+ CreateTextLabel ( mLabel3Info, "SetProp fixed", Color::BLACK, true );
+ mContainerInfo.Add( mLabelInfo );
+ mContainer2Info.Add( mLabel2Info );
+ mContainer3Info.Add( mLabel3Info );
+
+ stage.Add( mContainer );
+ stage.Add( mContainer2 );
+ stage.Add( mContainer3 );
+
+ CreateTextLabel ( mLabel, LABEL_TEXT, Color::WHITE );
+
+ CreateTextLabel ( mLabel2, LABEL_TEXT, Color::WHITE );
+ mLabel2.SetStyleName("textlabel-Rosemary");
+
+ CreateTextLabel ( mLabel3, LABEL_TEXT, Color::WHITE );
+ mLabel3.SetProperty( TextLabel::Property::FONT_FAMILY, "SamsungOneUI" );
+
+ mContainer.SetPosition( 0, 0 );
+ mContainer2.SetPosition( 0, stageSize.height*0.25f );
+ mContainer3.SetPosition( 0, stageSize.height*0.25f*2 );
+
+ mContainer.Add( mLabel );
+ mContainer2.Add( mLabel2 );
+ mContainer3.Add( mLabel3 );
+ }
+
+ /**
+ * Main key event handler
+ */
+ void OnKeyEvent(const KeyEvent& event)
+ {
+ if(event.state == KeyEvent::Down)
+ {
+ if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
+private:
+
+ Application& mApplication;
+
+ PushButton mButton;
+
+ TextLabel mLabel;
+ TextLabel mLabel2;
+ TextLabel mLabel3;
+
+ TextLabel mLabel4;
+
+ Control mContainer;
+ Control mContainer2;
+ Control mContainer3;
+ Control mContainer4;
+
+ Control mContainerInfo;
+ Control mContainer2Info;
+ Control mContainer3Info;
+ Control mContainer4Info;
+
+ TextLabel mLabelInfo;
+ TextLabel mLabel2Info;
+ TextLabel mLabel3Info;
+ TextLabel mLabel4Info;
+
+ Vector2 mLayoutSize;
+
+ bool mToggle;
+};
+
+void RunTest( Application& application )
+{
+ TextFontsExample test( application );
+
+ application.MainLoop();
+}
+
+/** Entry point for Linux & Tizen applications */
+int main( int argc, char **argv )
+{
+ Application application = Application::New( &argc, &argv, DALI_DEMO_THEME_PATH );
+
+ RunTest( application );
+
+ return 0;
+}
mMeshActor.AddRenderer( mRenderer );
mMeshActor.SetSize(400, 400);
- Property::Index fadeColorIndex = mMeshActor.RegisterProperty( "uFadeColor", Color::GREEN );
-
- fadeColorIndex = mRenderer.RegisterProperty( "uFadeColor", Color::MAGENTA );
+ Property::Index fadeColorIndex = mRenderer.RegisterProperty( "uFadeColor", Color::MAGENTA );
mRenderer.SetDepthIndex(0);
mMeshActor.SetParentOrigin( ParentOrigin::TOP_CENTER );
mMeshActor2.SetSize(400, 400);
mMeshActor2.RegisterProperty( "a-n-other-property", Color::GREEN );
- Property::Index fadeColorIndex2 = mMeshActor2.RegisterProperty( "uFadeColor", Color::GREEN );
mRenderer2.RegisterProperty( "a-n-other-property", Vector3::ZERO );
mRenderer2.RegisterProperty( "a-coefficient", 0.008f );
- fadeColorIndex2 = mRenderer2.RegisterProperty( "uFadeColor", Color::BLUE );
+ Property::Index fadeColorIndex2 = mRenderer2.RegisterProperty( "uFadeColor", Color::BLUE );
mRenderer2.SetDepthIndex(0);
mMeshActor2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
Name: com.samsung.dali-demo
Summary: The OpenGLES Canvas Core Demo
-Version: 1.1.4
+Version: 1.1.5
Release: 1
Group: System/Libraries
License: Apache-2.0
{
"styles":
{
+ "textlabel-Rosemary":
+ {
+ "font-family":"Rosemary"
+ },
"textlabel":
{
- "font-family":"HelveticaNeue",
"font-style":"Regular",
"point-size":18
},
-
"launcherlabel":
{
"point-size":18
"buttonlabel":
{
"point-size":11
+ },
+
+ "launcherbackground":
+ {
+ "background":
+ {
+ "renderer-type": "gradient-renderer",
+ "gradient-center": [240, 400],
+ "gradient-radius": 932,
+ "gradient-units": "user-space",
+ "gradient-stop-color": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]],
+ "gradient-stop-offset":[0.0,1.0]
+ }
}
}
}
{
"styles":
{
+ "textlabel-Rosemary":
+ {
+ "font-family":"Rosemary"
+ },
"textlabel":
{
- "font-family":"SamsungSans",
"font-style":"Regular",
"point-size":18
},
-
"textlabel-font-size-0":
{
"point-size":8
{
"point-size":10
},
-
+
"scrollview":
{
"overshoot-effect-color":"B018"
"buttonlabel":
{
"point-size":8
+ },
+
+ "launcherbackground":
+ {
+ "background":
+ {
+ "renderer-type": "gradient-renderer",
+ "gradient-center": [360, 640],
+ "gradient-radius": 1468,
+ "gradient-units": "user-space",
+ "gradient-stop-color": [[0.247,0.38,0.52,1.0],[0.055,0.18,0.286,1.0]],
+ "gradient-stop-offset":[0.0,1.0]
+ }
}
}
}