Commit 1e8cf4e9b7b912503aee6bc3494217e88d13ef52
Merge remote-tracking branch 'origin/tizen' into new_text
Conflicts: build/tizen/CMakeLists.txt build/tizen/demo/CMakeLists.txt build/tizen/examples/CMakeLists.txt demo/dali-table-view.cpp examples/buttons/buttons-example.cpp examples/shader-effect/dissolve-effect-example.cpp examples/shadows/shadow-bone-lighting-example.cpp packaging/com.samsung.dali-demo.spec Change-Id: I57a2de5bfa6d0f05c02b8aba06dec9130f14a906
Showing
28 changed files
with
348 additions
and
490 deletions
demo/dali-table-view.cpp
| ... | ... | @@ -63,7 +63,7 @@ const float EFFECT_SNAP_DURATION = 0.66f; ///< Scroll Snap |
| 63 | 63 | const float EFFECT_FLICK_DURATION = 0.5f; ///< Scroll Flick Duration for Effects |
| 64 | 64 | const Vector3 ANGLE_CUBE_PAGE_ROTATE(Math::PI * 0.5f, Math::PI * 0.5f, 0.0f); |
| 65 | 65 | |
| 66 | -const int NUM_BACKGROUND_IMAGES = 20; | |
| 66 | +const int NUM_BACKGROUND_IMAGES = 18; | |
| 67 | 67 | const float BACKGROUND_SWIPE_SCALE = 0.025f; |
| 68 | 68 | const float BACKGROUND_SPREAD_SCALE = 1.5f; |
| 69 | 69 | const float SCALE_MOD = 1000.0f * Math::PI * 2.0f; |
| ... | ... | @@ -107,7 +107,7 @@ Vector3 ScalePointSize(const Vector3& vec) |
| 107 | 107 | */ |
| 108 | 108 | ImageActor CreateBackground( std::string imagePath ) |
| 109 | 109 | { |
| 110 | - Image image = Image::New( imagePath ); | |
| 110 | + Image image = ResourceImage::New( imagePath ); | |
| 111 | 111 | ImageActor background = ImageActor::New( image ); |
| 112 | 112 | |
| 113 | 113 | background.SetAnchorPoint( AnchorPoint::CENTER ); |
| ... | ... | @@ -124,90 +124,40 @@ const float IMAGE_BORDER_TOP = IMAGE_BORDER_LEFT; |
| 124 | 124 | const float IMAGE_BORDER_BOTTOM = IMAGE_BORDER_LEFT; |
| 125 | 125 | |
| 126 | 126 | /** |
| 127 | - * TableViewVisibilityConstraint | |
| 127 | + * Constraint to return a position for a bubble based on the scroll value and vertical wrapping. | |
| 128 | 128 | */ |
| 129 | -struct TableViewVisibilityConstraint | |
| 130 | -{ | |
| 131 | - bool operator()( const bool& current, | |
| 132 | - const PropertyInput& pagePositionProperty, | |
| 133 | - const PropertyInput& pageSizeProperty ) | |
| 134 | - { | |
| 135 | - // Only the tableview in the current page should be visible. | |
| 136 | - const Vector3& pagePosition = pagePositionProperty.GetVector3(); | |
| 137 | - const Vector3& pageSize = pageSizeProperty.GetVector3(); | |
| 138 | - return fabsf( pagePosition.x ) < pageSize.x; | |
| 139 | - } | |
| 140 | -}; | |
| 141 | - | |
| 142 | -/** | |
| 143 | - * Constraint to wrap an actor in y that is moving vertically | |
| 144 | - */ | |
| 145 | -Vector3 ShapeMovementConstraint( const Vector3& current, | |
| 146 | - const PropertyInput& shapeSizeProperty, | |
| 147 | - const PropertyInput& parentSizeProperty ) | |
| 148 | -{ | |
| 149 | - const Vector3& shapeSize = shapeSizeProperty.GetVector3(); | |
| 150 | - const Vector3& parentSize = parentSizeProperty.GetVector3(); | |
| 151 | - | |
| 152 | - Vector3 pos( current ); | |
| 153 | - if( pos.y + shapeSize.y * 0.5f < -parentSize.y * 0.5f ) | |
| 154 | - { | |
| 155 | - pos.y += parentSize.y + shapeSize.y; | |
| 156 | - } | |
| 157 | - | |
| 158 | - return pos; | |
| 159 | -} | |
| 160 | - | |
| 161 | -/** | |
| 162 | - * Constraint to return a position for the background based on the scroll value | |
| 163 | - */ | |
| 164 | -struct AnimScrollConstraint | |
| 129 | +struct AnimateBubbleConstraint | |
| 165 | 130 | { |
| 166 | 131 | public: |
| 167 | - | |
| 168 | - AnimScrollConstraint( const Vector3& initialPos, float scale ) | |
| 169 | - : mInitialPos( initialPos ), | |
| 170 | - mScale( scale ) | |
| 132 | + AnimateBubbleConstraint( const Vector3& initialPos, float scale, float size ) | |
| 133 | + : mInitialX( initialPos.x ), | |
| 134 | + mScale( scale ), | |
| 135 | + mShapeSize( size ) | |
| 171 | 136 | { |
| 172 | - | |
| 173 | 137 | } |
| 174 | 138 | |
| 175 | - Vector3 operator()( const Vector3& current, const PropertyInput& scrollProperty ) | |
| 176 | - { | |
| 177 | - float scrollPos = scrollProperty.GetVector3().x; | |
| 178 | - | |
| 179 | - return mInitialPos + Vector3( -scrollPos * mScale, 0.0f, 0.0f ); | |
| 180 | - } | |
| 181 | - | |
| 182 | -private: | |
| 183 | - Vector3 mInitialPos; | |
| 184 | - float mScale; | |
| 185 | -}; | |
| 186 | - | |
| 187 | -/** | |
| 188 | - * Constraint to return a tracked world position added to the constant local position | |
| 189 | - */ | |
| 190 | -struct TranslateLocalConstraint | |
| 191 | -{ | |
| 192 | -public: | |
| 193 | - | |
| 194 | - TranslateLocalConstraint( const Vector3& localPos ) | |
| 195 | - : mLocalPos( localPos ) | |
| 139 | + Vector3 operator()( const Vector3& current, const PropertyInput& scrollProperty, const PropertyInput& parentSize ) | |
| 196 | 140 | { |
| 197 | - } | |
| 141 | + Vector3 pos( current ); | |
| 198 | 142 | |
| 199 | - Vector3 operator()( const Vector3& current, const PropertyInput& pagePosProperty ) | |
| 200 | - { | |
| 201 | - Vector3 worldPos = pagePosProperty.GetVector3(); | |
| 143 | + // Wrap bubbles verically. | |
| 144 | + if( pos.y + mShapeSize * 0.5f < -parentSize.GetVector3().y * 0.5f ) | |
| 145 | + { | |
| 146 | + pos.y += parentSize.GetVector3().y + mShapeSize; | |
| 147 | + } | |
| 202 | 148 | |
| 203 | - return ( worldPos + mLocalPos ); | |
| 149 | + // Bubbles X position moves parallax to horizontal | |
| 150 | + // panning by a scale factor unique to each bubble. | |
| 151 | + pos.x = mInitialX + ( scrollProperty.GetVector3().x * mScale ); | |
| 152 | + return pos; | |
| 204 | 153 | } |
| 205 | 154 | |
| 206 | 155 | private: |
| 207 | - Vector3 mLocalPos; | |
| 156 | + float mInitialX; | |
| 157 | + float mScale; | |
| 158 | + float mShapeSize; | |
| 208 | 159 | }; |
| 209 | 160 | |
| 210 | - | |
| 211 | 161 | bool CompareByTitle( const Example& lhs, const Example& rhs ) |
| 212 | 162 | { |
| 213 | 163 | return lhs.title < rhs.title; |
| ... | ... | @@ -297,8 +247,9 @@ void DaliTableView::Initialize( Application& application ) |
| 297 | 247 | |
| 298 | 248 | mScrollView.SetAnchorPoint( AnchorPoint::CENTER ); |
| 299 | 249 | mScrollView.SetParentOrigin( ParentOrigin::CENTER ); |
| 300 | - mScrollView.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), | |
| 301 | - Dali::RelativeToConstraint( SCROLLVIEW_RELATIVE_SIZE ) ) ); | |
| 250 | + // Note: Currently, changing mScrollView to use SizeMode RELATIVE_TO_PARENT | |
| 251 | + // will cause scroll ends to appear in the wrong position. | |
| 252 | + mScrollView.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::RelativeToConstraint( SCROLLVIEW_RELATIVE_SIZE ) ) ); | |
| 302 | 253 | mScrollView.SetAxisAutoLock( true ); |
| 303 | 254 | mScrollView.ScrollCompletedSignal().Connect( this, &DaliTableView::OnScrollComplete ); |
| 304 | 255 | mScrollView.ScrollStartedSignal().Connect( this, &DaliTableView::OnScrollStart ); |
| ... | ... | @@ -395,7 +346,7 @@ void DaliTableView::Populate() |
| 395 | 346 | |
| 396 | 347 | page.SetAnchorPoint( AnchorPoint::CENTER ); |
| 397 | 348 | page.SetParentOrigin( ParentOrigin::CENTER ); |
| 398 | - page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 349 | + page.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 399 | 350 | |
| 400 | 351 | // add cells to table |
| 401 | 352 | const float margin = 4.0f; |
| ... | ... | @@ -496,31 +447,24 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit |
| 496 | 447 | tile.SetAnchorPoint( AnchorPoint::CENTER ); |
| 497 | 448 | tile.SetParentOrigin( ParentOrigin::CENTER ); |
| 498 | 449 | |
| 499 | - Actor content = Actor::New(); | |
| 500 | - content.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 501 | - content.SetParentOrigin( ParentOrigin::CENTER ); | |
| 502 | - content.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 503 | - tile.Add(content); | |
| 504 | - | |
| 505 | 450 | // create background image |
| 506 | 451 | if( addBackground ) |
| 507 | 452 | { |
| 508 | - Image bg = Image::New( TILE_BACKGROUND ); | |
| 453 | + Image bg = ResourceImage::New( TILE_BACKGROUND ); | |
| 509 | 454 | ImageActor image = ImageActor::New( bg ); |
| 510 | 455 | image.SetAnchorPoint( AnchorPoint::CENTER ); |
| 511 | 456 | image.SetParentOrigin( ParentOrigin::CENTER ); |
| 512 | 457 | // make the image 100% of tile |
| 513 | - image.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 458 | + image.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 514 | 459 | // move image back to get text appear in front |
| 515 | 460 | image.SetZ( -1 ); |
| 516 | 461 | image.SetStyle( ImageActor::STYLE_NINE_PATCH ); |
| 517 | 462 | image.SetNinePatchBorder( Vector4( IMAGE_BORDER_LEFT, IMAGE_BORDER_TOP, IMAGE_BORDER_RIGHT, IMAGE_BORDER_BOTTOM ) ); |
| 518 | - | |
| 519 | - content.Add( image ); | |
| 463 | + tile.Add( image ); | |
| 520 | 464 | |
| 521 | 465 | // Add stencil |
| 522 | 466 | ImageActor stencil = NewStencilImage(); |
| 523 | - stencil.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 467 | + stencil.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 524 | 468 | image.Add( stencil ); |
| 525 | 469 | } |
| 526 | 470 | |
| ... | ... | @@ -530,7 +474,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit |
| 530 | 474 | label.SetProperty( TextLabel::PROPERTY_MULTI_LINE, true ); |
| 531 | 475 | label.SetProperty( TextLabel::PROPERTY_TEXT, title ); |
| 532 | 476 | label.SetColor( Color::BLACK ); |
| 533 | - content.Add( label ); | |
| 477 | + tile.Add( label ); | |
| 534 | 478 | |
| 535 | 479 | // FIXME - This is a kludge because size negotiation is not finished |
| 536 | 480 | label.SetSize( parentSize ); |
| ... | ... | @@ -547,7 +491,7 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit |
| 547 | 491 | |
| 548 | 492 | ImageActor DaliTableView::NewStencilImage() |
| 549 | 493 | { |
| 550 | - Image alpha = Image::New( TILE_BACKGROUND_ALPHA ); | |
| 494 | + Image alpha = ResourceImage::New( TILE_BACKGROUND_ALPHA ); | |
| 551 | 495 | |
| 552 | 496 | ImageActor stencilActor = ImageActor::New( alpha ); |
| 553 | 497 | stencilActor.SetStyle( ImageActor::STYLE_NINE_PATCH ); |
| ... | ... | @@ -723,61 +667,25 @@ void DaliTableView::OnKeyEvent( const KeyEvent& event ) |
| 723 | 667 | } |
| 724 | 668 | } |
| 725 | 669 | |
| 726 | -Actor CreateBackgroundActor( const Vector2& size ) | |
| 670 | +void DaliTableView::SetupBackground( Actor bubbleContainer, Actor backgroundLayer, const Vector2& size ) | |
| 727 | 671 | { |
| 728 | - Actor layer = Actor::New(); | |
| 729 | - layer.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 730 | - layer.SetParentOrigin( ParentOrigin::CENTER ); | |
| 731 | - layer.SetSize( size ); | |
| 732 | - return layer; | |
| 733 | -} | |
| 734 | - | |
| 735 | -void DaliTableView::SetupBackground( Actor bubbleLayer, Actor backgroundLayer, const Vector2& size ) | |
| 736 | -{ | |
| 737 | - // Create distance field shape | |
| 672 | + // Create distance field shape. | |
| 738 | 673 | BitmapImage distanceField; |
| 739 | 674 | Size imageSize( 512, 512 ); |
| 740 | 675 | CreateShapeImage( CIRCLE, imageSize, distanceField ); |
| 741 | 676 | |
| 742 | - // Create layers | |
| 743 | - Actor backgroundAnimLayer0 = CreateBackgroundActor( size ); | |
| 744 | - Actor backgroundAnimLayer1 = CreateBackgroundActor( size ); | |
| 745 | - Actor backgroundAnimLayer2 = CreateBackgroundActor( size ); | |
| 746 | - | |
| 747 | - // Add constraints | |
| 748 | - Constraint animConstraint0 = Constraint::New < Vector3 > ( Actor::POSITION, | |
| 749 | - Source( mScrollView, mScrollView.GetPropertyIndex( ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), | |
| 750 | - AnimScrollConstraint( backgroundAnimLayer0.GetCurrentPosition(), 0.75f ) ); | |
| 751 | - backgroundAnimLayer0.ApplyConstraint( animConstraint0 ); | |
| 752 | - | |
| 753 | - Constraint animConstraint1 = Constraint::New < Vector3 > ( Actor::POSITION, | |
| 754 | - Source( mScrollView, mScrollView.GetPropertyIndex( ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), | |
| 755 | - AnimScrollConstraint( backgroundAnimLayer1.GetCurrentPosition(), 0.5f ) ); | |
| 756 | - backgroundAnimLayer1.ApplyConstraint( animConstraint1 ); | |
| 677 | + // Create solid background colour. | |
| 678 | + ImageActor backgroundColourActor = Dali::Toolkit::CreateSolidColorActor( BACKGROUND_COLOR ); | |
| 679 | + backgroundColourActor.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 680 | + backgroundColourActor.SetParentOrigin( ParentOrigin::CENTER ); | |
| 681 | + backgroundColourActor.SetSize( size * BACKGROUND_SIZE_SCALE ); | |
| 682 | + backgroundColourActor.SetZ( BACKGROUND_Z ); | |
| 683 | + backgroundColourActor.SetPositionInheritanceMode( DONT_INHERIT_POSITION ); | |
| 684 | + backgroundLayer.Add( backgroundColourActor ); | |
| 757 | 685 | |
| 758 | - Constraint animConstraint2 = Constraint::New < Vector3 > ( Actor::POSITION, | |
| 759 | - Source( mScrollView, mScrollView.GetPropertyIndex( ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), | |
| 760 | - AnimScrollConstraint( backgroundAnimLayer2.GetCurrentPosition(), 0.25f ) ); | |
| 761 | - backgroundAnimLayer2.ApplyConstraint( animConstraint2 ); | |
| 762 | - | |
| 763 | - // Background | |
| 764 | - ImageActor layer = Dali::Toolkit::CreateSolidColorActor( BACKGROUND_COLOR ); | |
| 765 | - layer.SetAnchorPoint( AnchorPoint::CENTER ); | |
| 766 | - layer.SetParentOrigin( ParentOrigin::CENTER ); | |
| 767 | - layer.SetSize( size * BACKGROUND_SIZE_SCALE ); | |
| 768 | - layer.SetZ( BACKGROUND_Z ); | |
| 769 | - layer.SetPositionInheritanceMode( DONT_INHERIT_POSITION ); | |
| 770 | - backgroundLayer.Add( layer ); | |
| 771 | - | |
| 772 | - // Parent the layers | |
| 773 | - bubbleLayer.Add( backgroundAnimLayer0 ); | |
| 774 | - bubbleLayer.Add( backgroundAnimLayer1 ); | |
| 775 | - bubbleLayer.Add( backgroundAnimLayer2 ); | |
| 776 | - | |
| 777 | - // Add all the children | |
| 778 | - AddBackgroundActors( backgroundAnimLayer0, NUM_BACKGROUND_IMAGES / 3, distanceField, size ); | |
| 779 | - AddBackgroundActors( backgroundAnimLayer1, NUM_BACKGROUND_IMAGES / 3, distanceField, size ); | |
| 780 | - AddBackgroundActors( backgroundAnimLayer2, NUM_BACKGROUND_IMAGES / 3, distanceField, size ); | |
| 686 | + // Add bubbles to the bubbleContainer. | |
| 687 | + // Note: The bubbleContainer is parented externally to this function. | |
| 688 | + AddBackgroundActors( bubbleContainer, NUM_BACKGROUND_IMAGES, distanceField, size ); | |
| 781 | 689 | } |
| 782 | 690 | |
| 783 | 691 | void DaliTableView::AddBackgroundActors( Actor layer, int count, BitmapImage distanceField, const Dali::Vector2& size ) |
| ... | ... | @@ -807,11 +715,12 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count, BitmapImage dis |
| 807 | 715 | Random::Range( BUBBLE_MIN_Z, BUBBLE_MAX_Z ) ); |
| 808 | 716 | dfActor.SetPosition( actorPos ); |
| 809 | 717 | |
| 810 | - Constraint movementConstraint = Constraint::New < Vector3 > ( Actor::POSITION, | |
| 811 | - LocalSource( Actor::SIZE ), | |
| 812 | - ParentSource( Actor::SIZE ), | |
| 813 | - ShapeMovementConstraint ); | |
| 814 | - dfActor.ApplyConstraint( movementConstraint ); | |
| 718 | + // Define bubble horizontal parallax and vertical wrapping | |
| 719 | + Constraint animConstraint = Constraint::New < Vector3 > ( Actor::POSITION, | |
| 720 | + Source( mScrollView, mScrollView.GetPropertyIndex( ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ), | |
| 721 | + Dali::ParentSource( Dali::Actor::SIZE ), | |
| 722 | + AnimateBubbleConstraint( actorPos, Random::Range( -0.85f, 0.25f ), randSize ) ); | |
| 723 | + dfActor.ApplyConstraint( animConstraint ); | |
| 815 | 724 | |
| 816 | 725 | // Kickoff animation |
| 817 | 726 | Animation animation = Animation::New( Random::Range( 40.0f, 200.0f ) ); |
| ... | ... | @@ -893,7 +802,7 @@ void DaliTableView::GenerateCircle( const Size& size, std::vector< unsigned char |
| 893 | 802 | |
| 894 | 803 | ImageActor DaliTableView::CreateLogo( std::string imagePath ) |
| 895 | 804 | { |
| 896 | - Image image = Image::New( imagePath ); | |
| 805 | + Image image = ResourceImage::New( imagePath ); | |
| 897 | 806 | ImageActor logo = ImageActor::New( image ); |
| 898 | 807 | |
| 899 | 808 | logo.SetAnchorPoint( AnchorPoint::CENTER ); | ... | ... |
demo/images/checkbox-checked.png renamed to demo/images/checkbox-selected.png
1.94 KB
demo/images/checkbox-unchecked.png renamed to demo/images/checkbox-unselected.png
629 Bytes
demo/scripts/button.json
| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | "filename": "{DALI_IMAGE_DIR}blocks-brick-1.png" |
| 33 | 33 | } |
| 34 | 34 | }, |
| 35 | - "pressed-state-actor": { | |
| 35 | + "selected-state-actor": { | |
| 36 | 36 | "type": "ImageActor", |
| 37 | 37 | "image": { |
| 38 | 38 | "filename": "{DALI_IMAGE_DIR}blocks-brick-2.png" |
| ... | ... | @@ -53,22 +53,22 @@ |
| 53 | 53 | "size": [0, 200, 0], |
| 54 | 54 | "label-actor": { |
| 55 | 55 | "type": "TextView", |
| 56 | - "text": "Dimmed" | |
| 56 | + "text": "Disabled" | |
| 57 | 57 | }, |
| 58 | - "dimmed": true, | |
| 58 | + "disabled": true, | |
| 59 | 59 | "normal-state-actor": { |
| 60 | 60 | "type": "ImageActor", |
| 61 | 61 | "image": { |
| 62 | 62 | "filename": "{DALI_IMAGE_DIR}blocks-brick-1.png" |
| 63 | 63 | } |
| 64 | 64 | }, |
| 65 | - "pressed-state-actor": { | |
| 65 | + "selected-state-actor": { | |
| 66 | 66 | "type": "ImageActor", |
| 67 | 67 | "image": { |
| 68 | 68 | "filename": "{DALI_IMAGE_DIR}blocks-brick-2.png" |
| 69 | 69 | } |
| 70 | 70 | }, |
| 71 | - "dimmed-state-actor": { | |
| 71 | + "disabled-state-actor": { | |
| 72 | 72 | "type": "ImageActor", |
| 73 | 73 | "image": { |
| 74 | 74 | "filename": "{DALI_IMAGE_DIR}blocks-brick-3.png" |
| ... | ... | @@ -97,7 +97,7 @@ |
| 97 | 97 | "filename": "{DALI_IMAGE_DIR}blocks-brick-1.png" |
| 98 | 98 | } |
| 99 | 99 | }, |
| 100 | - "pressed-state-actor": { | |
| 100 | + "selected-state-actor": { | |
| 101 | 101 | "type": "ImageActor", |
| 102 | 102 | "style": "STYLE_NINE_PATCH", |
| 103 | 103 | "border": [26, 24, 26, 23], |
| ... | ... | @@ -106,7 +106,7 @@ |
| 106 | 106 | } |
| 107 | 107 | }, |
| 108 | 108 | "signals": [{ |
| 109 | - "name": "toggled", | |
| 109 | + "name": "selected", | |
| 110 | 110 | "action": "set", |
| 111 | 111 | "actor": "toggle-button", |
| 112 | 112 | "property": "label-actor", | ... | ... |
demo/scripts/super-blur-view.json
demo/scripts/table-view.json
examples/blocks/blocks-example.cpp
| ... | ... | @@ -423,7 +423,7 @@ private: |
| 423 | 423 | mLevelContainer = Actor::New(); |
| 424 | 424 | mLevelContainer.SetAnchorPoint( AnchorPoint::CENTER ); |
| 425 | 425 | mLevelContainer.SetParentOrigin( ParentOrigin::CENTER ); |
| 426 | - mLevelContainer.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 426 | + mLevelContainer.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 427 | 427 | mContentLayer.Add( mLevelContainer ); |
| 428 | 428 | |
| 429 | 429 | mBrickCount = 0; |
| ... | ... | @@ -591,7 +591,7 @@ private: |
| 591 | 591 | ImageAttributes attr; |
| 592 | 592 | attr.SetSize( 128, 64 ); |
| 593 | 593 | attr.SetScalingMode( ImageAttributes::ScaleToFill ); |
| 594 | - Image img = Image::New(BRICK_IMAGE_PATH[type], attr); | |
| 594 | + Image img = ResourceImage::New(BRICK_IMAGE_PATH[type], attr); | |
| 595 | 595 | ImageActor brick = ImageActor::New(img); |
| 596 | 596 | brick.SetParentOrigin(ParentOrigin::TOP_LEFT); |
| 597 | 597 | brick.SetAnchorPoint(AnchorPoint::CENTER); |
| ... | ... | @@ -623,7 +623,7 @@ private: |
| 623 | 623 | */ |
| 624 | 624 | ImageActor CreateImage(const std::string& filename) |
| 625 | 625 | { |
| 626 | - Image img = Image::New(filename); | |
| 626 | + Image img = ResourceImage::New(filename); | |
| 627 | 627 | ImageActor actor = ImageActor::New(img); |
| 628 | 628 | actor.SetParentOrigin(ParentOrigin::TOP_LEFT); |
| 629 | 629 | actor.SetAnchorPoint(AnchorPoint::CENTER); | ... | ... |
examples/builder/dali-builder.cpp
examples/builder/examples.cpp
| ... | ... | @@ -33,6 +33,7 @@ |
| 33 | 33 | #include <boost/scoped_ptr.hpp> |
| 34 | 34 | #include <dirent.h> |
| 35 | 35 | #include <stdio.h> |
| 36 | +#include <iostream> | |
| 36 | 37 | |
| 37 | 38 | //#include <boost/regex.hpp> |
| 38 | 39 | #include "sys/stat.h" |
| ... | ... | @@ -507,7 +508,7 @@ public: |
| 507 | 508 | |
| 508 | 509 | // Create an edit mode button. (left of toolbar) |
| 509 | 510 | Toolkit::PushButton editButton = Toolkit::PushButton::New(); |
| 510 | - editButton.SetBackgroundImage( Image::New( EDIT_IMAGE ) ); | |
| 511 | + editButton.SetBackgroundImage( ResourceImage::New( EDIT_IMAGE ) ); | |
| 511 | 512 | editButton.ClickedSignal().Connect( this, &ExampleApp::OnToolSelectLayout); |
| 512 | 513 | editButton.SetLeaveRequired( true ); |
| 513 | 514 | mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); | ... | ... |
examples/buttons/buttons-example.cpp
| ... | ... | @@ -61,8 +61,8 @@ const char* const PUSHBUTTON_PRESS_IMAGE = DALI_IMAGE_DIR "button-down.9.png"; |
| 61 | 61 | const char* const PUSHBUTTON_DISABLED_IMAGE = DALI_IMAGE_DIR "button-disabled.9.png"; |
| 62 | 62 | const char* const PUSHBUTTON_BUTTON_IMAGE = DALI_IMAGE_DIR "button-up.9.png"; |
| 63 | 63 | |
| 64 | -const char* const CHECKBOX_UNCHECKED_IMAGE = DALI_IMAGE_DIR "checkbox-unchecked.png"; | |
| 65 | -const char* const CHECKBOX_CHECKED_IMAGE = DALI_IMAGE_DIR "checkbox-checked.png"; | |
| 64 | +const char* const CHECKBOX_UNSELECTED_IMAGE = DALI_IMAGE_DIR "checkbox-unselected.png"; | |
| 65 | +const char* const CHECKBOX_SELECTED_IMAGE = DALI_IMAGE_DIR "checkbox-selected.png"; | |
| 66 | 66 | |
| 67 | 67 | const Vector4 BACKGROUND_COLOUR( 1.0f, 1.0f, 1.0f, 0.15f ); |
| 68 | 68 | |
| ... | ... | @@ -142,7 +142,7 @@ class ButtonsController: public ConnectionTracker |
| 142 | 142 | |
| 143 | 143 | // Radio 1 |
| 144 | 144 | { |
| 145 | - ImageActor imageActor = ImageActor::New( Image::New( SMALL_IMAGE_1 ) ); | |
| 145 | + ImageActor imageActor = ImageActor::New( ResourceImage::New( SMALL_IMAGE_1 ) ); | |
| 146 | 146 | imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| 147 | 147 | mRadioButtonImage1 = Dali::Toolkit::RadioButton::New( imageActor ); |
| 148 | 148 | mRadioButtonImage1.SetParentOrigin( ParentOrigin::TOP_LEFT ); |
| ... | ... | @@ -157,7 +157,7 @@ class ButtonsController: public ConnectionTracker |
| 157 | 157 | { |
| 158 | 158 | radioY += RADIO_LABEL_THUMBNAIL_SIZE + RADIO_IMAGE_SPACING; |
| 159 | 159 | |
| 160 | - ImageActor imageActor = ImageActor::New( Image::New( SMALL_IMAGE_2 ) ); | |
| 160 | + ImageActor imageActor = ImageActor::New( ResourceImage::New( SMALL_IMAGE_2 ) ); | |
| 161 | 161 | imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| 162 | 162 | |
| 163 | 163 | mRadioButtonImage2 = Dali::Toolkit::RadioButton::New( imageActor ); |
| ... | ... | @@ -172,7 +172,7 @@ class ButtonsController: public ConnectionTracker |
| 172 | 172 | { |
| 173 | 173 | radioY += RADIO_LABEL_THUMBNAIL_SIZE + RADIO_IMAGE_SPACING; |
| 174 | 174 | |
| 175 | - ImageActor imageActor = ImageActor::New( Image::New( SMALL_IMAGE_3 ) ); | |
| 175 | + ImageActor imageActor = ImageActor::New( ResourceImage::New( SMALL_IMAGE_3 ) ); | |
| 176 | 176 | imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| 177 | 177 | |
| 178 | 178 | mRadioButtonImage3 = Dali::Toolkit::RadioButton::New( imageActor ); |
| ... | ... | @@ -191,18 +191,18 @@ class ButtonsController: public ConnectionTracker |
| 191 | 191 | mUpdateButton.SetLabel("Select"); |
| 192 | 192 | mUpdateButton.SetSize( DP(100), DP(BUTTON_HEIGHT) ); |
| 193 | 193 | |
| 194 | - mUpdateButton.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 195 | - mUpdateButton.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 196 | - mUpdateButton.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 194 | + mUpdateButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 195 | + mUpdateButton.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 196 | + mUpdateButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 197 | 197 | |
| 198 | 198 | mUpdateButton.ClickedSignal().Connect( this, &ButtonsController::OnButtonClicked ); |
| 199 | 199 | |
| 200 | 200 | radioButtonsGroup2.Add(mUpdateButton); |
| 201 | 201 | |
| 202 | 202 | // ImageActor to display selected image |
| 203 | - mBigImage1 = Image::New( BIG_IMAGE_1 ); | |
| 204 | - mBigImage2 = Image::New( BIG_IMAGE_2 ); | |
| 205 | - mBigImage3 = Image::New( BIG_IMAGE_3 ); | |
| 203 | + mBigImage1 = ResourceImage::New( BIG_IMAGE_1 ); | |
| 204 | + mBigImage2 = ResourceImage::New( BIG_IMAGE_2 ); | |
| 205 | + mBigImage3 = ResourceImage::New( BIG_IMAGE_3 ); | |
| 206 | 206 | |
| 207 | 207 | mImage = ImageActor::New( mBigImage1 ); |
| 208 | 208 | mImage.SetParentOrigin( ParentOrigin::TOP_RIGHT ); |
| ... | ... | @@ -234,7 +234,7 @@ class ButtonsController: public ConnectionTracker |
| 234 | 234 | Toolkit::TableView tableView = Toolkit::TableView::New( 1, 2 ); |
| 235 | 235 | tableView.SetSize( DP(260), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| 236 | 236 | |
| 237 | - ImageActor imageActor = ImageActor::New( Image::New( ENABLED_IMAGE ) ); | |
| 237 | + ImageActor imageActor = ImageActor::New( ResourceImage::New( ENABLED_IMAGE ) ); | |
| 238 | 238 | imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| 239 | 239 | tableView.AddChild( imageActor, Toolkit::TableView::CellPosition( 0, 1 ) ); |
| 240 | 240 | tableView.SetFixedWidth( 1, DP(RADIO_LABEL_THUMBNAIL_SIZE) ); |
| ... | ... | @@ -246,7 +246,7 @@ class ButtonsController: public ConnectionTracker |
| 246 | 246 | radioButton.SetPosition( 0, 0 ); |
| 247 | 247 | radioButton.SetSelected( true ); |
| 248 | 248 | |
| 249 | - radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButtonToggle ); | |
| 249 | + radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButton ); | |
| 250 | 250 | |
| 251 | 251 | radioButtonsGroup1.Add( radioButton ); |
| 252 | 252 | } |
| ... | ... | @@ -259,7 +259,7 @@ class ButtonsController: public ConnectionTracker |
| 259 | 259 | radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 260 | 260 | radioButton.SetPosition( 0, DP(50) ); |
| 261 | 261 | |
| 262 | - radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButtonToggle ); | |
| 262 | + radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButton ); | |
| 263 | 263 | |
| 264 | 264 | radioButtonsGroup1.Add( radioButton ); |
| 265 | 265 | } |
| ... | ... | @@ -274,8 +274,8 @@ class ButtonsController: public ConnectionTracker |
| 274 | 274 | checkBoxBackground.SetSize( DP(430), DP(GROUP3_HEIGHT) ); |
| 275 | 275 | mContentLayer.Add( checkBoxBackground ); |
| 276 | 276 | |
| 277 | - Dali::Image unchecked = Dali::Image::New( CHECKBOX_UNCHECKED_IMAGE ); | |
| 278 | - Dali::Image checked = Dali::Image::New( CHECKBOX_CHECKED_IMAGE ); | |
| 277 | + Dali::Image unselected = Dali::ResourceImage::New( CHECKBOX_UNSELECTED_IMAGE ); | |
| 278 | + Dali::Image selected = Dali::ResourceImage::New( CHECKBOX_SELECTED_IMAGE ); | |
| 279 | 279 | |
| 280 | 280 | int checkYPos = MARGIN_SIZE; |
| 281 | 281 | |
| ... | ... | @@ -285,10 +285,10 @@ class ButtonsController: public ConnectionTracker |
| 285 | 285 | checkBox.SetPosition( DP(MARGIN_SIZE), DP(checkYPos) ); |
| 286 | 286 | checkBox.SetParentOrigin( ParentOrigin::TOP_LEFT ); |
| 287 | 287 | checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 288 | - checkBox.SetBackgroundImage( unchecked ); | |
| 289 | - checkBox.SetCheckedImage( checked ); | |
| 288 | + checkBox.SetBackgroundImage( unselected ); | |
| 289 | + checkBox.SetSelectedImage( selected ); | |
| 290 | 290 | checkBox.SetSize( DP(48), DP(48) ); |
| 291 | - checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesToggled ); | |
| 291 | + checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); | |
| 292 | 292 | |
| 293 | 293 | checkBoxBackground.Add( checkBox ); |
| 294 | 294 | } |
| ... | ... | @@ -300,11 +300,11 @@ class ButtonsController: public ConnectionTracker |
| 300 | 300 | checkBox.SetName( "checkbox2" ); |
| 301 | 301 | checkBox.SetPosition( DP(MARGIN_SIZE), DP(checkYPos) ); |
| 302 | 302 | checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 303 | - checkBox.SetBackgroundImage( unchecked ); | |
| 304 | - checkBox.SetCheckedImage( checked ); | |
| 303 | + checkBox.SetBackgroundImage( unselected ); | |
| 304 | + checkBox.SetSelectedImage( selected ); | |
| 305 | 305 | checkBox.SetSize( DP(48), DP(48) ); |
| 306 | - checkBox.SetChecked( true ); | |
| 307 | - checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesToggled ); | |
| 306 | + checkBox.SetSelected( true ); | |
| 307 | + checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); | |
| 308 | 308 | |
| 309 | 309 | checkBoxBackground.Add( checkBox ); |
| 310 | 310 | } |
| ... | ... | @@ -316,15 +316,14 @@ class ButtonsController: public ConnectionTracker |
| 316 | 316 | checkBox.SetName( "checkbox3" ); |
| 317 | 317 | checkBox.SetPosition( DP(MARGIN_SIZE), DP(checkYPos) ); |
| 318 | 318 | checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 319 | - checkBox.SetBackgroundImage( unchecked ); | |
| 320 | - checkBox.SetCheckedImage( checked ); | |
| 319 | + checkBox.SetBackgroundImage( unselected ); | |
| 320 | + checkBox.SetSelectedImage( selected ); | |
| 321 | 321 | checkBox.SetSize( DP(48), DP(48) ); |
| 322 | - checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesToggled ); | |
| 322 | + checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); | |
| 323 | 323 | |
| 324 | 324 | checkBoxBackground.Add( checkBox ); |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | - // Create toggle button | |
| 328 | 327 | yPos += GROUP3_HEIGHT + MARGIN_SIZE; |
| 329 | 328 | |
| 330 | 329 | Actor toggleBackground = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR ); |
| ... | ... | @@ -335,18 +334,18 @@ class ButtonsController: public ConnectionTracker |
| 335 | 334 | mContentLayer.Add( toggleBackground ); |
| 336 | 335 | |
| 337 | 336 | Toolkit::PushButton toggleButton = Toolkit::PushButton::New(); |
| 338 | - toggleButton.SetToggleButton( true ); | |
| 337 | + toggleButton.SetTogglableButton( true ); | |
| 339 | 338 | toggleButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); |
| 340 | 339 | toggleButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 341 | 340 | toggleButton.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) ); |
| 342 | - toggleButton.SetLabel( "Toggle OFF" ); | |
| 341 | + toggleButton.SetLabel( "Unselected" ); | |
| 343 | 342 | toggleButton.SetSize( DP(150), DP(BUTTON_HEIGHT) ); |
| 344 | 343 | |
| 345 | - toggleButton.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 346 | - toggleButton.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 347 | - toggleButton.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 344 | + toggleButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 345 | + toggleButton.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 346 | + toggleButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 348 | 347 | |
| 349 | - toggleButton.StateChangedSignal().Connect( this, &ButtonsController::OnButtonToggled ); | |
| 348 | + toggleButton.StateChangedSignal().Connect( this, &ButtonsController::OnButtonSelected ); | |
| 350 | 349 | |
| 351 | 350 | toggleBackground.Add( toggleButton ); |
| 352 | 351 | } |
| ... | ... | @@ -363,31 +362,31 @@ class ButtonsController: public ConnectionTracker |
| 363 | 362 | } |
| 364 | 363 | } |
| 365 | 364 | |
| 366 | - bool OnButtonToggled( Toolkit::Button button, bool state ) | |
| 365 | + bool OnButtonSelected( Toolkit::Button button ) | |
| 367 | 366 | { |
| 368 | 367 | Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( button ); |
| 369 | 368 | if( pushButton ) |
| 370 | 369 | { |
| 371 | - if( state ) | |
| 370 | + if( button.IsSelected() ) | |
| 372 | 371 | { |
| 373 | - pushButton.SetLabel( "Toggle ON" ); | |
| 372 | + pushButton.SetLabel( "Selected" ); | |
| 374 | 373 | } |
| 375 | 374 | else |
| 376 | 375 | { |
| 377 | - pushButton.SetLabel( "Toggle OFF" ); | |
| 376 | + pushButton.SetLabel( "Unselected" ); | |
| 378 | 377 | } |
| 379 | 378 | } |
| 380 | 379 | |
| 381 | 380 | return true; |
| 382 | 381 | } |
| 383 | 382 | |
| 384 | - bool EnableSelectButtonToggle( Toolkit::Button button, bool state ) | |
| 383 | + bool EnableSelectButton( Toolkit::Button button ) | |
| 385 | 384 | { |
| 386 | - if( button.GetName() == "radio-select-enable" && state == true ) | |
| 385 | + if( button.GetName() == "radio-select-enable" && button.IsSelected() == true ) | |
| 387 | 386 | { |
| 388 | 387 | mUpdateButton.SetDisabled( false ); |
| 389 | 388 | } |
| 390 | - else if( button.GetName() == "radio-select-disable" && state == true ) | |
| 389 | + else if( button.GetName() == "radio-select-disable" && button.IsSelected() == true ) | |
| 391 | 390 | { |
| 392 | 391 | mUpdateButton.SetDisabled( true ); |
| 393 | 392 | } |
| ... | ... | @@ -412,7 +411,7 @@ class ButtonsController: public ConnectionTracker |
| 412 | 411 | return true; |
| 413 | 412 | } |
| 414 | 413 | |
| 415 | - bool OnCheckBoxesToggled( Toolkit::Button button, bool state ) | |
| 414 | + bool OnCheckBoxesSelected( Toolkit::Button button ) | |
| 416 | 415 | { |
| 417 | 416 | return true; |
| 418 | 417 | } | ... | ... |
examples/cluster/cluster-example.cpp
| ... | ... | @@ -199,33 +199,6 @@ struct CarouselEffectOrientationConstraint |
| 199 | 199 | }; |
| 200 | 200 | |
| 201 | 201 | /** |
| 202 | - * RescaleConstraint | |
| 203 | - * Rescales the inputer scale by the ratio of the height:width of it's parent. | |
| 204 | - */ | |
| 205 | -struct RescaleConstraint | |
| 206 | -{ | |
| 207 | - /** | |
| 208 | - * Constructor | |
| 209 | - * @param[in] value0 Constant multiplication operand (K). | |
| 210 | - */ | |
| 211 | - RescaleConstraint() | |
| 212 | - { | |
| 213 | - } | |
| 214 | - | |
| 215 | - /** | |
| 216 | - * @param[in] current The object's current property value | |
| 217 | - * @param[in] property0 The first property to multiplication operand | |
| 218 | - * @return The object's new property value | |
| 219 | - */ | |
| 220 | - Vector3 operator()(const Vector3& current, | |
| 221 | - const PropertyInput& property0) | |
| 222 | - { | |
| 223 | - return current * Vector3( property0.GetVector3().y / property0.GetVector3().x, 1.0f, 1.0f ); | |
| 224 | - } | |
| 225 | - | |
| 226 | -}; | |
| 227 | - | |
| 228 | -/** | |
| 229 | 202 | * ShearEffectConstraint |
| 230 | 203 | * |
| 231 | 204 | * Constrains ShearEffect's tilt to be a function of scrollview's |
| ... | ... | @@ -493,10 +466,10 @@ public: |
| 493 | 466 | "" ); |
| 494 | 467 | |
| 495 | 468 | // Create a effect toggle button. (right of toolbar) |
| 496 | - mLayoutButtonImages[ NO_EFFECT ] = Image::New( LAYOUT_NONE_IMAGE ); | |
| 497 | - mLayoutButtonImages[ WOBBLE_EFFECT ] = Image::New( LAYOUT_WOBBLE_IMAGE ); | |
| 498 | - mLayoutButtonImages[ CAROUSEL_EFFECT ] = Image::New( LAYOUT_CAROUSEL_IMAGE ); | |
| 499 | - mLayoutButtonImages[ SPHERE_EFFECT ] = Image::New( LAYOUT_SPHERE_IMAGE ); | |
| 469 | + mLayoutButtonImages[ NO_EFFECT ] = ResourceImage::New( LAYOUT_NONE_IMAGE ); | |
| 470 | + mLayoutButtonImages[ WOBBLE_EFFECT ] = ResourceImage::New( LAYOUT_WOBBLE_IMAGE ); | |
| 471 | + mLayoutButtonImages[ CAROUSEL_EFFECT ] = ResourceImage::New( LAYOUT_CAROUSEL_IMAGE ); | |
| 472 | + mLayoutButtonImages[ SPHERE_EFFECT ] = ResourceImage::New( LAYOUT_SPHERE_IMAGE ); | |
| 500 | 473 | |
| 501 | 474 | mLayoutButton = Toolkit::PushButton::New(); |
| 502 | 475 | mLayoutButton.ClickedSignal().Connect( this, &ClusterController::OnEffectTouched ); |
| ... | ... | @@ -514,18 +487,14 @@ public: |
| 514 | 487 | mScrollView.SetAnchorPoint(AnchorPoint::CENTER); |
| 515 | 488 | mScrollView.SetParentOrigin(ParentOrigin::CENTER); |
| 516 | 489 | |
| 517 | - // Scale ScrollView to fit within parent (mContentLayer) | |
| 518 | - Constraint constraint = Constraint::New<Vector3>( Actor::SCALE, | |
| 519 | - LocalSource( Actor::SIZE ), | |
| 520 | - ParentSource( Actor::SIZE ), | |
| 521 | - ScaleToFitConstraint() ); | |
| 522 | - mScrollView.ApplyConstraint(constraint); | |
| 490 | + // Scale ScrollView to fit parent (mContentLayer) | |
| 491 | + mScrollView.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 523 | 492 | |
| 524 | 493 | // Add the scroll view to the content layer |
| 525 | 494 | mContentLayer.Add(mScrollView); |
| 526 | 495 | |
| 527 | 496 | // Create the image border shared by all the cluster image actors |
| 528 | - mClusterBorderImage = Image::New(CLUSTER_BORDER_IMAGE_PATH); | |
| 497 | + mClusterBorderImage = ResourceImage::New(CLUSTER_BORDER_IMAGE_PATH); | |
| 529 | 498 | |
| 530 | 499 | AddCluster( PEOPLE, ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle1) ); |
| 531 | 500 | AddCluster( TODAY, ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle2) ); |
| ... | ... | @@ -556,7 +525,7 @@ public: |
| 556 | 525 | DALI_ASSERT_ALWAYS(paths); |
| 557 | 526 | |
| 558 | 527 | // Add a background image to the cluster |
| 559 | - Image bg = Image::New( CLUSTER_BACKGROUND_IMAGE_PATH ); | |
| 528 | + Image bg = ResourceImage::New( CLUSTER_BACKGROUND_IMAGE_PATH ); | |
| 560 | 529 | ImageActor image = ImageActor::New(bg); |
| 561 | 530 | clusterActor.SetBackgroundImage(image); |
| 562 | 531 | |
| ... | ... | @@ -587,10 +556,9 @@ public: |
| 587 | 556 | ImageAttributes attribs = ImageAttributes::New(); |
| 588 | 557 | attribs.SetSize(CLUSTER_IMAGE_THUMBNAIL_WIDTH, CLUSTER_IMAGE_THUMBNAIL_HEIGHT); |
| 589 | 558 | attribs.SetScalingMode(Dali::ImageAttributes::ShrinkToFit); |
| 590 | - attribs.SetPixelFormat( Pixel::RGB888 ); | |
| 591 | 559 | |
| 592 | 560 | // Add a shadow image child actor |
| 593 | - Image shadowImage = Image::New( CLUSTER_SHADOW_IMAGE_PATH, attribs ); | |
| 561 | + Image shadowImage = ResourceImage::New( CLUSTER_SHADOW_IMAGE_PATH, attribs ); | |
| 594 | 562 | ImageActor shadowActor = ImageActor::New(shadowImage); |
| 595 | 563 | |
| 596 | 564 | // Shadow is not exactly located on the center of the image, so it is moved to a little |
| ... | ... | @@ -605,7 +573,7 @@ public: |
| 605 | 573 | actor.Add( shadowActor ); |
| 606 | 574 | |
| 607 | 575 | // Add a picture image actor to actor (with equal size to the parent). |
| 608 | - Image image = Image::New( imagePath, attribs ); | |
| 576 | + Image image = ResourceImage::New( imagePath, attribs ); | |
| 609 | 577 | ImageActor imageActor = ImageActor::New( image ); |
| 610 | 578 | imageActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 611 | 579 | imageActor.SetAnchorPoint( AnchorPoint::CENTER ); |
| ... | ... | @@ -649,14 +617,7 @@ public: |
| 649 | 617 | mScrollView.Add(pageView); |
| 650 | 618 | pageView.SetParentOrigin(ParentOrigin::CENTER); |
| 651 | 619 | pageView.SetPosition(Vector3(stageSize.width * column, 0.0f, 0.0f)); |
| 652 | - pageView.SetSize(stageSize); | |
| 653 | - | |
| 654 | - // Resize pageView (which contains a Cluster) | |
| 655 | - Constraint constraintScale = Constraint::New<Vector3>( Actor::SCALE, | |
| 656 | - ParentSource( Actor::SCALE ), | |
| 657 | - RescaleConstraint() ); | |
| 658 | - constraintScale.SetRemoveAction(Constraint::Discard); | |
| 659 | - pageView.ApplyConstraint(constraintScale); | |
| 620 | + pageView.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 660 | 621 | |
| 661 | 622 | // Create cluster actors, add them to scroll view, and set the shear effect with the given center point. |
| 662 | 623 | Cluster cluster = CreateClusterActor(clusterType, style); | ... | ... |
examples/hello-world/hello-world-example.cpp
examples/image/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
| ... | ... | @@ -45,6 +45,7 @@ |
| 45 | 45 | #include <algorithm> |
| 46 | 46 | #include <map> |
| 47 | 47 | #include <dali-toolkit/dali-toolkit.h> |
| 48 | +#include <iostream> | |
| 48 | 49 | |
| 49 | 50 | // INTERNAL INCLUDES |
| 50 | 51 | #include "grid-flags.h" |
| ... | ... | @@ -182,7 +183,7 @@ Image CreateImage(const std::string& filename, unsigned int width, unsigned int |
| 182 | 183 | |
| 183 | 184 | attributes.SetSize( width, height ); |
| 184 | 185 | attributes.SetScalingMode( scalingMode ); |
| 185 | - Image image = Image::New( filename, attributes ); | |
| 186 | + Image image = ResourceImage::New( filename, attributes ); | |
| 186 | 187 | return image; |
| 187 | 188 | } |
| 188 | 189 | |
| ... | ... | @@ -307,7 +308,7 @@ public: |
| 307 | 308 | "" ); |
| 308 | 309 | |
| 309 | 310 | // Create an image scaling toggle button. (right of toolbar) |
| 310 | - Image toggleScalingImage = Image::New( TOGGLE_SCALING_IMAGE ); | |
| 311 | + Image toggleScalingImage = ResourceImage::New( TOGGLE_SCALING_IMAGE ); | |
| 311 | 312 | Toolkit::PushButton toggleScalingButton = Toolkit::PushButton::New(); |
| 312 | 313 | toggleScalingButton.SetBackgroundImage( toggleScalingImage ); |
| 313 | 314 | toggleScalingButton.ClickedSignal().Connect( this, &ImageScalingIrregularGridController::OnToggleScalingTouched ); |
| ... | ... | @@ -416,7 +417,7 @@ public: |
| 416 | 417 | // coordinates in a frame defined by a parent actor: |
| 417 | 418 | |
| 418 | 419 | Actor gridActor = Actor::New(); |
| 419 | - gridActor.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 420 | + gridActor.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 420 | 421 | gridActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 421 | 422 | gridActor.SetAnchorPoint( AnchorPoint::CENTER ); |
| 422 | 423 | |
| ... | ... | @@ -472,7 +473,7 @@ public: |
| 472 | 473 | |
| 473 | 474 | ImageActor imageActor = ImageActor::DownCast( actor ); |
| 474 | 475 | Image oldImage = imageActor.GetImage(); |
| 475 | - Image newImage = CreateImage( oldImage.GetFilename(), imageSize.width + 0.5f, imageSize.height + 0.5f, newMode ); | |
| 476 | + Image newImage = CreateImage( ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width + 0.5f, imageSize.height + 0.5f, newMode ); | |
| 476 | 477 | imageActor.SetImage( newImage ); |
| 477 | 478 | mScalingModes[id] = newMode; |
| 478 | 479 | } |
| ... | ... | @@ -514,7 +515,7 @@ public: |
| 514 | 515 | const Vector2 imageSize = mSizes[gridImageActor.GetId()]; |
| 515 | 516 | ImageAttributes::ScalingMode newMode = NextMode( mScalingModes[gridImageActor.GetId()] ); |
| 516 | 517 | Image oldImage = gridImageActor.GetImage(); |
| 517 | - Image newImage = CreateImage( oldImage.GetFilename(), imageSize.width, imageSize.height, newMode ); | |
| 518 | + Image newImage = CreateImage(ResourceImage::DownCast(oldImage).GetUrl(), imageSize.width, imageSize.height, newMode ); | |
| 518 | 519 | gridImageActor.SetImage( newImage ); |
| 519 | 520 | |
| 520 | 521 | mScalingModes[gridImageActor.GetId()] = newMode; | ... | ... |
examples/item-view/item-view-example.cpp
| ... | ... | @@ -162,15 +162,6 @@ const float LABEL_TEXT_SIZE_Y = 20.0f; |
| 162 | 162 | |
| 163 | 163 | const Vector3 INITIAL_OFFSCREEN_POSITION( 1000.0f, 0, -1000.0f ); |
| 164 | 164 | |
| 165 | -struct BorderSizeConstraintFunction | |
| 166 | -{ | |
| 167 | - Vector3 operator()(const Vector3& current, | |
| 168 | - const PropertyInput& parentSize) | |
| 169 | - { | |
| 170 | - return parentSize.GetVector3() + ITEM_BORDER_MARGIN_SIZE; | |
| 171 | - } | |
| 172 | -}; | |
| 173 | - | |
| 174 | 165 | static Vector3 DepthLayoutItemSizeFunctionPortrait(unsigned int numberOfColumns, float layoutWidth) |
| 175 | 166 | { |
| 176 | 167 | float width = (layoutWidth / static_cast<float>(numberOfColumns + 1)) * DEPTH_LAYOUT_ITEM_SIZE_FACTOR_PORTRAIT; |
| ... | ... | @@ -249,7 +240,7 @@ public: |
| 249 | 240 | Vector2 stageSize = Stage::GetCurrent().GetSize(); |
| 250 | 241 | |
| 251 | 242 | // Create a border image shared by all the item actors |
| 252 | - mBorderImage = Image::New(ITEM_BORDER_IMAGE_PATH); | |
| 243 | + mBorderImage = ResourceImage::New(ITEM_BORDER_IMAGE_PATH); | |
| 253 | 244 | |
| 254 | 245 | // Creates a default view with a default tool bar. |
| 255 | 246 | // The view is added to the stage. |
| ... | ... | @@ -264,14 +255,14 @@ public: |
| 264 | 255 | |
| 265 | 256 | // Create an edit mode button. (left of toolbar) |
| 266 | 257 | Toolkit::PushButton editButton = Toolkit::PushButton::New(); |
| 267 | - editButton.SetBackgroundImage( Image::New( EDIT_IMAGE ) ); | |
| 258 | + editButton.SetBackgroundImage( ResourceImage::New( EDIT_IMAGE ) ); | |
| 268 | 259 | editButton.ClickedSignal().Connect( this, &ItemViewExample::OnModeButtonClicked); |
| 269 | 260 | editButton.SetLeaveRequired( true ); |
| 270 | 261 | mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 271 | 262 | |
| 272 | 263 | // Create a layout toggle button. (right of toolbar) |
| 273 | 264 | mLayoutButton = Toolkit::PushButton::New(); |
| 274 | - mLayoutButton.SetBackgroundImage( Image::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 265 | + mLayoutButton.SetBackgroundImage( ResourceImage::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 275 | 266 | mLayoutButton.ClickedSignal().Connect( this, &ItemViewExample::OnLayoutButtonClicked); |
| 276 | 267 | mLayoutButton.SetLeaveRequired( true ); |
| 277 | 268 | mToolBar.AddControl( mLayoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| ... | ... | @@ -282,8 +273,8 @@ public: |
| 282 | 273 | mDeleteButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT); |
| 283 | 274 | mDeleteButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); |
| 284 | 275 | mDeleteButton.SetDrawMode( DrawMode::OVERLAY ); |
| 285 | - mDeleteButton.SetBackgroundImage( Image::New( TOOLBAR_IMAGE ) ); | |
| 286 | - mDeleteButton.SetButtonImage( Image::New( DELETE_IMAGE ) ); | |
| 276 | + mDeleteButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) ); | |
| 277 | + mDeleteButton.SetButtonImage( ResourceImage::New( DELETE_IMAGE ) ); | |
| 287 | 278 | mDeleteButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f ); |
| 288 | 279 | mDeleteButton.ClickedSignal().Connect( this, &ItemViewExample::OnDeleteButtonClicked); |
| 289 | 280 | mDeleteButton.SetLeaveRequired( true ); |
| ... | ... | @@ -296,8 +287,8 @@ public: |
| 296 | 287 | mInsertButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT); |
| 297 | 288 | mInsertButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); |
| 298 | 289 | mInsertButton.SetDrawMode( DrawMode::OVERLAY ); |
| 299 | - mInsertButton.SetBackgroundImage( Image::New( TOOLBAR_IMAGE ) ); | |
| 300 | - mInsertButton.SetButtonImage( Image::New( INSERT_IMAGE ) ); | |
| 290 | + mInsertButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) ); | |
| 291 | + mInsertButton.SetButtonImage( ResourceImage::New( INSERT_IMAGE ) ); | |
| 301 | 292 | mInsertButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f ); |
| 302 | 293 | mInsertButton.ClickedSignal().Connect( this, &ItemViewExample::OnInsertButtonClicked); |
| 303 | 294 | mInsertButton.SetLeaveRequired( true ); |
| ... | ... | @@ -310,8 +301,8 @@ public: |
| 310 | 301 | mReplaceButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT); |
| 311 | 302 | mReplaceButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); |
| 312 | 303 | mReplaceButton.SetDrawMode( DrawMode::OVERLAY ); |
| 313 | - mReplaceButton.SetBackgroundImage( Image::New( TOOLBAR_IMAGE ) ); | |
| 314 | - mReplaceButton.SetButtonImage( Image::New( REPLACE_IMAGE ) ); | |
| 304 | + mReplaceButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) ); | |
| 305 | + mReplaceButton.SetButtonImage( ResourceImage::New( REPLACE_IMAGE ) ); | |
| 315 | 306 | mReplaceButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f ); |
| 316 | 307 | mReplaceButton.ClickedSignal().Connect( this, &ItemViewExample::OnReplaceButtonClicked); |
| 317 | 308 | mReplaceButton.SetLeaveRequired( true ); |
| ... | ... | @@ -842,19 +833,19 @@ public: |
| 842 | 833 | { |
| 843 | 834 | case SPIRAL_LAYOUT: |
| 844 | 835 | { |
| 845 | - mLayoutButton.SetBackgroundImage( Image::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 836 | + mLayoutButton.SetBackgroundImage( ResourceImage::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 846 | 837 | break; |
| 847 | 838 | } |
| 848 | 839 | |
| 849 | 840 | case GRID_LAYOUT: |
| 850 | 841 | { |
| 851 | - mLayoutButton.SetBackgroundImage( Image::New( GRID_LAYOUT_IMAGE ) ); | |
| 842 | + mLayoutButton.SetBackgroundImage( ResourceImage::New( GRID_LAYOUT_IMAGE ) ); | |
| 852 | 843 | break; |
| 853 | 844 | } |
| 854 | 845 | |
| 855 | 846 | case DEPTH_LAYOUT: |
| 856 | 847 | { |
| 857 | - mLayoutButton.SetBackgroundImage( Image::New( DEPTH_LAYOUT_IMAGE ) ); | |
| 848 | + mLayoutButton.SetBackgroundImage( ResourceImage::New( DEPTH_LAYOUT_IMAGE ) ); | |
| 858 | 849 | break; |
| 859 | 850 | } |
| 860 | 851 | |
| ... | ... | @@ -883,7 +874,7 @@ public: // From ItemFactory |
| 883 | 874 | virtual Actor NewItem(unsigned int itemId) |
| 884 | 875 | { |
| 885 | 876 | // Create an image actor for this item |
| 886 | - Image image = Image::New( IMAGE_PATHS[itemId % NUM_IMAGES] ); | |
| 877 | + Image image = ResourceImage::New( IMAGE_PATHS[itemId % NUM_IMAGES] ); | |
| 887 | 878 | Actor actor = ImageActor::New(image); |
| 888 | 879 | actor.SetPosition( INITIAL_OFFSCREEN_POSITION ); |
| 889 | 880 | |
| ... | ... | @@ -895,9 +886,8 @@ public: // From ItemFactory |
| 895 | 886 | borderActor.SetStyle( ImageActor::STYLE_NINE_PATCH ); |
| 896 | 887 | borderActor.SetNinePatchBorder( Vector4( ITEM_IMAGE_BORDER_LEFT, ITEM_IMAGE_BORDER_TOP, ITEM_IMAGE_BORDER_RIGHT, ITEM_IMAGE_BORDER_BOTTOM ) ); |
| 897 | 888 | borderActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); // darken with parent image-actor |
| 898 | - | |
| 899 | - Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), BorderSizeConstraintFunction() ); | |
| 900 | - borderActor.ApplyConstraint(constraint); | |
| 889 | + borderActor.SetSizeMode( SIZE_FIXED_OFFSET_FROM_PARENT ); | |
| 890 | + borderActor.SetSizeModeFactor( ITEM_BORDER_MARGIN_SIZE ); | |
| 901 | 891 | actor.Add(borderActor); |
| 902 | 892 | actor.SetKeyboardFocusable( true ); |
| 903 | 893 | |
| ... | ... | @@ -922,7 +912,7 @@ public: // From ItemFactory |
| 922 | 912 | } |
| 923 | 913 | actor.Add( checkbox ); |
| 924 | 914 | |
| 925 | - ImageActor tick = ImageActor::New( Image::New(SELECTED_IMAGE) ); | |
| 915 | + ImageActor tick = ImageActor::New( ResourceImage::New(SELECTED_IMAGE) ); | |
| 926 | 916 | tick.SetColorMode( USE_OWN_COLOR ); |
| 927 | 917 | tick.SetName( "Tick" ); |
| 928 | 918 | tick.SetParentOrigin( ParentOrigin::TOP_RIGHT ); | ... | ... |
examples/logging/logging-example.cpp
| ... | ... | @@ -276,9 +276,9 @@ class LoggingController: public ConnectionTracker |
| 276 | 276 | button.SetPosition( buttonXDP, 0 ); |
| 277 | 277 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 278 | 278 | |
| 279 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 280 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 281 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 279 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 280 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 281 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 282 | 282 | |
| 283 | 283 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 284 | 284 | |
| ... | ... | @@ -296,9 +296,9 @@ class LoggingController: public ConnectionTracker |
| 296 | 296 | button.SetPosition( buttonXDP, 0 ); |
| 297 | 297 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 298 | 298 | |
| 299 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 300 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 301 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 299 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 300 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 301 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 302 | 302 | |
| 303 | 303 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 304 | 304 | |
| ... | ... | @@ -327,9 +327,9 @@ class LoggingController: public ConnectionTracker |
| 327 | 327 | button.SetPosition( buttonXDP, 0 ); |
| 328 | 328 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 329 | 329 | |
| 330 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 331 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 332 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 330 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 331 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 332 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 333 | 333 | |
| 334 | 334 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 335 | 335 | |
| ... | ... | @@ -347,9 +347,9 @@ class LoggingController: public ConnectionTracker |
| 347 | 347 | button.SetPosition( buttonXDP, 0 ); |
| 348 | 348 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 349 | 349 | |
| 350 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 351 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 352 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 350 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 351 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 352 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 353 | 353 | |
| 354 | 354 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 355 | 355 | |
| ... | ... | @@ -378,9 +378,9 @@ class LoggingController: public ConnectionTracker |
| 378 | 378 | button.SetPosition( buttonXDP, 0 ); |
| 379 | 379 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 380 | 380 | |
| 381 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 382 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 383 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 381 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 382 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 383 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 384 | 384 | |
| 385 | 385 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 386 | 386 | |
| ... | ... | @@ -398,9 +398,9 @@ class LoggingController: public ConnectionTracker |
| 398 | 398 | button.SetPosition( buttonXDP, 0 ); |
| 399 | 399 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 400 | 400 | |
| 401 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 402 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 403 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 401 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 402 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 403 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 404 | 404 | |
| 405 | 405 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 406 | 406 | |
| ... | ... | @@ -500,9 +500,9 @@ class LoggingController: public ConnectionTracker |
| 500 | 500 | button.SetPosition( buttonXDP, 0 ); |
| 501 | 501 | button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) ); |
| 502 | 502 | |
| 503 | - button.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 504 | - button.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 505 | - button.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 503 | + button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 504 | + button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 505 | + button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 506 | 506 | |
| 507 | 507 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 508 | 508 | |
| ... | ... | @@ -517,17 +517,17 @@ class LoggingController: public ConnectionTracker |
| 517 | 517 | // TODO |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | - bool LoggingRadioSelect( Toolkit::Button button, bool state ) | |
| 520 | + bool LoggingRadioSelect( Toolkit::Button button ) | |
| 521 | 521 | { |
| 522 | - if( button.GetName() == LOGGER_1_RADIO_ID && state == true ) | |
| 522 | + if( button.GetName() == LOGGER_1_RADIO_ID && button.IsSelected() == true ) | |
| 523 | 523 | { |
| 524 | 524 | mCurrentLogger = 0; |
| 525 | 525 | } |
| 526 | - else if( button.GetName() == LOGGER_2_RADIO_ID && state == true ) | |
| 526 | + else if( button.GetName() == LOGGER_2_RADIO_ID && button.IsSelected() == true ) | |
| 527 | 527 | { |
| 528 | 528 | mCurrentLogger = 1; |
| 529 | 529 | } |
| 530 | - else if( button.GetName() == LOGGER_3_RADIO_ID && state == true ) | |
| 530 | + else if( button.GetName() == LOGGER_3_RADIO_ID && button.IsSelected() == true ) | |
| 531 | 531 | { |
| 532 | 532 | mCurrentLogger = 2; |
| 533 | 533 | } |
| ... | ... | @@ -555,9 +555,9 @@ class LoggingController: public ConnectionTracker |
| 555 | 555 | } |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | - bool FrequencyRadioSelect( Toolkit::Button button, bool state ) | |
| 558 | + bool FrequencyRadioSelect( Toolkit::Button button ) | |
| 559 | 559 | { |
| 560 | - if( button.GetName() == FREQUENCY_1_RADIO_ID && state == true ) | |
| 560 | + if( button.GetName() == FREQUENCY_1_RADIO_ID && button.IsSelected() == true ) | |
| 561 | 561 | { |
| 562 | 562 | if( mPerformanceLoggers[mCurrentLogger] ) |
| 563 | 563 | { |
| ... | ... | @@ -568,7 +568,7 @@ class LoggingController: public ConnectionTracker |
| 568 | 568 | mLoggerStates[mCurrentLogger].frequency = HIGH_FREQUENCY; |
| 569 | 569 | } |
| 570 | 570 | } |
| 571 | - else if( button.GetName() == FREQUENCY_2_RADIO_ID && state == true ) | |
| 571 | + else if( button.GetName() == FREQUENCY_2_RADIO_ID && button.IsSelected() == true ) | |
| 572 | 572 | { |
| 573 | 573 | if( mPerformanceLoggers[mCurrentLogger] ) |
| 574 | 574 | { |
| ... | ... | @@ -579,7 +579,7 @@ class LoggingController: public ConnectionTracker |
| 579 | 579 | mLoggerStates[mCurrentLogger].frequency = MEDIUM_FREQUENCY; |
| 580 | 580 | } |
| 581 | 581 | } |
| 582 | - else if( button.GetName() == FREQUENCY_3_RADIO_ID && state == true ) | |
| 582 | + else if( button.GetName() == FREQUENCY_3_RADIO_ID && button.IsSelected() == true ) | |
| 583 | 583 | { |
| 584 | 584 | if( mPerformanceLoggers[mCurrentLogger] ) |
| 585 | 585 | { | ... | ... |
examples/motion/motion-blur-example.cpp
| ... | ... | @@ -149,8 +149,8 @@ public: |
| 149 | 149 | APPLICATION_TITLE ); |
| 150 | 150 | |
| 151 | 151 | //Add an effects icon on the right of the title |
| 152 | - mIconEffectsOff = Image::New( EFFECTS_OFF_ICON ); | |
| 153 | - mIconEffectsOn = Image::New( EFFECTS_ON_ICON ); | |
| 152 | + mIconEffectsOff = ResourceImage::New( EFFECTS_OFF_ICON ); | |
| 153 | + mIconEffectsOn = ResourceImage::New( EFFECTS_ON_ICON ); | |
| 154 | 154 | mActorEffectsButton = Toolkit::PushButton::New(); |
| 155 | 155 | mActorEffectsButton.SetBackgroundImage( mIconEffectsOff ); |
| 156 | 156 | mActorEffectsButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnEffectButtonClicked ); |
| ... | ... | @@ -158,7 +158,7 @@ public: |
| 158 | 158 | |
| 159 | 159 | // Creates a mode button. |
| 160 | 160 | // Create a effect toggle button. (right of toolbar) |
| 161 | - Image imageLayout = Image::New( LAYOUT_IMAGE ); | |
| 161 | + Image imageLayout = ResourceImage::New( LAYOUT_IMAGE ); | |
| 162 | 162 | Toolkit::PushButton layoutButton = Toolkit::PushButton::New(); |
| 163 | 163 | layoutButton.SetBackgroundImage(imageLayout); |
| 164 | 164 | layoutButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnLayoutButtonClicked); |
| ... | ... | @@ -187,7 +187,7 @@ public: |
| 187 | 187 | // Motion blurred actor |
| 188 | 188 | // |
| 189 | 189 | |
| 190 | - Image image = Image::New( MOTION_BLUR_ACTOR_IMAGE1 ); | |
| 190 | + Image image = ResourceImage::New( MOTION_BLUR_ACTOR_IMAGE1 ); | |
| 191 | 191 | mMotionBlurImageActor = ImageActor::New(image); |
| 192 | 192 | mMotionBlurImageActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 193 | 193 | mMotionBlurImageActor.SetSize(MOTION_BLUR_ACTOR_WIDTH, MOTION_BLUR_ACTOR_HEIGHT); |
| ... | ... | @@ -478,7 +478,7 @@ public: |
| 478 | 478 | mCurrentImage = 0; |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | - Image blurImage = Image::New( MOTION_BLUR_ACTOR_IMAGES[mCurrentImage] ); | |
| 481 | + Image blurImage = ResourceImage::New( MOTION_BLUR_ACTOR_IMAGES[mCurrentImage] ); | |
| 482 | 482 | mMotionBlurImageActor.SetImage(blurImage); |
| 483 | 483 | } |
| 484 | 484 | ... | ... |
examples/motion/motion-stretch-example.cpp
| ... | ... | @@ -136,8 +136,8 @@ public: |
| 136 | 136 | APPLICATION_TITLE ); |
| 137 | 137 | |
| 138 | 138 | //Add an slideshow icon on the right of the title |
| 139 | - mIconEffectsOff = Image::New( EFFECTS_OFF_ICON ); | |
| 140 | - mIconEffectsOn = Image::New( EFFECTS_ON_ICON ); | |
| 139 | + mIconEffectsOff = ResourceImage::New( EFFECTS_OFF_ICON ); | |
| 140 | + mIconEffectsOn = ResourceImage::New( EFFECTS_ON_ICON ); | |
| 141 | 141 | mActorEffectsButton = Toolkit::PushButton::New(); |
| 142 | 142 | mActorEffectsButton.SetBackgroundImage( mIconEffectsOff ); |
| 143 | 143 | mActorEffectsButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnEffectButtonClicked ); |
| ... | ... | @@ -145,7 +145,7 @@ public: |
| 145 | 145 | |
| 146 | 146 | // Creates a mode button. |
| 147 | 147 | // Create a effect toggle button. (right of toolbar) |
| 148 | - Image imageLayout = Image::New( LAYOUT_IMAGE ); | |
| 148 | + Image imageLayout = ResourceImage::New( LAYOUT_IMAGE ); | |
| 149 | 149 | Toolkit::PushButton layoutButton = Toolkit::PushButton::New(); |
| 150 | 150 | layoutButton.SetBackgroundImage(imageLayout); |
| 151 | 151 | layoutButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnLayoutButtonClicked); |
| ... | ... | @@ -174,7 +174,7 @@ public: |
| 174 | 174 | // Motion stretched actor |
| 175 | 175 | // |
| 176 | 176 | |
| 177 | - Image image = Image::New( MOTION_STRETCH_ACTOR_IMAGE1 ); | |
| 177 | + Image image = ResourceImage::New( MOTION_STRETCH_ACTOR_IMAGE1 ); | |
| 178 | 178 | mMotionStretchImageActor = ImageActor::New(image); |
| 179 | 179 | mMotionStretchImageActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 180 | 180 | mMotionStretchImageActor.SetAnchorPoint( AnchorPoint::CENTER ); |
| ... | ... | @@ -390,7 +390,7 @@ public: |
| 390 | 390 | mCurrentImage = 0; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - Image stretchImage = Image::New( MOTION_STRETCH_ACTOR_IMAGES[mCurrentImage] ); | |
| 393 | + Image stretchImage = ResourceImage::New( MOTION_STRETCH_ACTOR_IMAGES[mCurrentImage] ); | |
| 394 | 394 | mMotionStretchImageActor.SetImage(stretchImage); |
| 395 | 395 | } |
| 396 | 396 | ... | ... |
examples/new-window/new-window-example.cpp
| ... | ... | @@ -16,6 +16,8 @@ |
| 16 | 16 | |
| 17 | 17 | #include <dali-toolkit/dali-toolkit.h> |
| 18 | 18 | #include "../shared/view.h" |
| 19 | +#include <cstdio> | |
| 20 | +#include <iostream> | |
| 19 | 21 | |
| 20 | 22 | using namespace Dali; |
| 21 | 23 | using namespace Dali::Toolkit; |
| ... | ... | @@ -145,7 +147,7 @@ void NewWindowController::Create( Application& app ) |
| 145 | 147 | } |
| 146 | 148 | |
| 147 | 149 | mLoseContextButton = Toolkit::PushButton::New(); |
| 148 | - mLoseContextButton.SetBackgroundImage( Image::New( LOSE_CONTEXT_IMAGE ) ); | |
| 150 | + mLoseContextButton.SetBackgroundImage( ResourceImage::New( LOSE_CONTEXT_IMAGE ) ); | |
| 149 | 151 | mLoseContextButton.ClickedSignal().Connect( this, &NewWindowController::OnLoseContextButtonClicked ); |
| 150 | 152 | mToolBar.AddControl( mLoseContextButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 151 | 153 | |
| ... | ... | @@ -156,7 +158,7 @@ void NewWindowController::Create( Application& app ) |
| 156 | 158 | logoLayoutActor.SetScale(0.5f); |
| 157 | 159 | mContentLayer.Add(logoLayoutActor); |
| 158 | 160 | |
| 159 | - Image image = Image::New(DALI_IMAGE_DIR "dali-logo.png"); | |
| 161 | + Image image = ResourceImage::New(DALI_IMAGE_DIR "dali-logo.png"); | |
| 160 | 162 | mImageActor = ImageActor::New(image); |
| 161 | 163 | mImageActor.SetName("dali-logo"); |
| 162 | 164 | mImageActor.SetParentOrigin(ParentOrigin::CENTER); |
| ... | ... | @@ -191,7 +193,7 @@ bool NewWindowController::OnLoseContextButtonClicked( Toolkit::Button button ) |
| 191 | 193 | |
| 192 | 194 | void NewWindowController::CreateMeshActor() |
| 193 | 195 | { |
| 194 | - mEffectImage = Image::New(EFFECT_IMAGE); | |
| 196 | + mEffectImage = ResourceImage::New(EFFECT_IMAGE); | |
| 195 | 197 | |
| 196 | 198 | Material baseMaterial = Material::New( "Material1" ); |
| 197 | 199 | Dali::MeshActor meshActor = MeshActor::New( CreateMesh(true, baseMaterial) ); |
| ... | ... | @@ -217,7 +219,7 @@ void NewWindowController::CreateMeshActor() |
| 217 | 219 | FrameBufferImage NewWindowController::CreateMirrorImage(const char* imageName) |
| 218 | 220 | { |
| 219 | 221 | FrameBufferImage fbo; |
| 220 | - Image image = Image::New(imageName); | |
| 222 | + Image image = ResourceImage::New(imageName); | |
| 221 | 223 | fbo = CreateFrameBufferForImage(imageName, image, ShaderEffect()); |
| 222 | 224 | return fbo; |
| 223 | 225 | } |
| ... | ... | @@ -225,8 +227,8 @@ FrameBufferImage NewWindowController::CreateMirrorImage(const char* imageName) |
| 225 | 227 | ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName) |
| 226 | 228 | { |
| 227 | 229 | FrameBufferImage fbo; |
| 228 | - Image image = Image::New( imageName ); | |
| 229 | - Vector2 FBOSize = Image::GetImageSize(imageName); | |
| 230 | + Image image = ResourceImage::New( imageName ); | |
| 231 | + Vector2 FBOSize = ResourceImage::GetImageSize(imageName); | |
| 230 | 232 | fbo = FrameBufferImage::New( FBOSize.width, FBOSize.height, Pixel::RGBA8888); |
| 231 | 233 | GaussianBlurView gbv = GaussianBlurView::New(5, 2.0f, Pixel::RGBA8888, 0.5f, 0.5f, true); |
| 232 | 234 | gbv.SetBackgroundColor(Color::TRANSPARENT); |
| ... | ... | @@ -244,7 +246,7 @@ ImageActor NewWindowController::CreateBlurredMirrorImage(const char* imageName) |
| 244 | 246 | FrameBufferImage NewWindowController::CreateFrameBufferForImage(const char* imageName, Image image, ShaderEffect shaderEffect) |
| 245 | 247 | { |
| 246 | 248 | Stage stage = Stage::GetCurrent(); |
| 247 | - Vector2 FBOSize = Image::GetImageSize(imageName); | |
| 249 | + Vector2 FBOSize = ResourceImage::GetImageSize(imageName); | |
| 248 | 250 | |
| 249 | 251 | FrameBufferImage framebuffer = FrameBufferImage::New(FBOSize.x, FBOSize.y ); |
| 250 | 252 | |
| ... | ... | @@ -285,10 +287,10 @@ FrameBufferImage NewWindowController::CreateFrameBufferForImage(const char* imag |
| 285 | 287 | void NewWindowController::CreateBubbles(Vector2 stageSize) |
| 286 | 288 | { |
| 287 | 289 | mEmitter = Toolkit::BubbleEmitter::New( stageSize, |
| 288 | - Image::New( DALI_IMAGE_DIR "bubble-ball.png" ), | |
| 290 | + ResourceImage::New( DALI_IMAGE_DIR "bubble-ball.png" ), | |
| 289 | 291 | 1000, Vector2( 5.0f, 5.0f ) ); |
| 290 | 292 | |
| 291 | - Image background = Image::New(BACKGROUND_IMAGE); | |
| 293 | + Image background = ResourceImage::New(BACKGROUND_IMAGE); | |
| 292 | 294 | mEmitter.SetBackground( background, mHSVDelta ); |
| 293 | 295 | Actor bubbleRoot = mEmitter.GetRootActor(); |
| 294 | 296 | mContentLayer.Add( bubbleRoot ); |
| ... | ... | @@ -373,7 +375,7 @@ void NewWindowController::CreateBlending() |
| 373 | 375 | blendShader.SetEffectImage( fb2 ); |
| 374 | 376 | blendShader.SetUniform("alpha", 0.5f); |
| 375 | 377 | |
| 376 | - mBaseImage = Image::New(BASE_IMAGE); | |
| 378 | + mBaseImage = ResourceImage::New(BASE_IMAGE); | |
| 377 | 379 | mBlendActor = ImageActor::New( mBaseImage ); |
| 378 | 380 | mBlendActor.SetParentOrigin(ParentOrigin::CENTER); |
| 379 | 381 | mBlendActor.SetPosition(Vector3(150.0f, 200.0f, 0.0f)); | ... | ... |
examples/page-turn-view/page-turn-view-example.cpp
| ... | ... | @@ -15,11 +15,12 @@ |
| 15 | 15 | * |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | +#include <dali/dali.h> | |
| 19 | +#include <dali-toolkit/dali-toolkit.h> | |
| 18 | 20 | #include <assert.h> |
| 19 | 21 | #include <cstdlib> |
| 20 | 22 | #include <string.h> |
| 21 | -#include <dali/dali.h> | |
| 22 | -#include <dali-toolkit/dali-toolkit.h> | |
| 23 | +#include <iostream> | |
| 23 | 24 | |
| 24 | 25 | using namespace Dali; |
| 25 | 26 | using namespace Dali::Toolkit; |
| ... | ... | @@ -79,11 +80,11 @@ class PortraitPageFactory : public PageFactory |
| 79 | 80 | { |
| 80 | 81 | if( pageId == 0 ) |
| 81 | 82 | { |
| 82 | - return ImageActor::New( Image::New( BOOK_COVER_PORTRAIT ) ); | |
| 83 | + return ImageActor::New( ResourceImage::New( BOOK_COVER_PORTRAIT ) ); | |
| 83 | 84 | } |
| 84 | 85 | else |
| 85 | 86 | { |
| 86 | - return ImageActor::New( Image::New( PAGE_IMAGES_PORTRAIT[ (pageId-1) % NUMBER_OF_PORTRAIT_IMAGE ] ) ); | |
| 87 | + return ImageActor::New( ResourceImage::New( PAGE_IMAGES_PORTRAIT[ (pageId-1) % NUMBER_OF_PORTRAIT_IMAGE ] ) ); | |
| 87 | 88 | } |
| 88 | 89 | } |
| 89 | 90 | }; |
| ... | ... | @@ -109,14 +110,14 @@ class LandscapePageFactory : public PageFactory |
| 109 | 110 | ImageActor pageBack; |
| 110 | 111 | if( pageId == 0 ) |
| 111 | 112 | { |
| 112 | - pageFront = ImageActor::New( Image::New( BOOK_COVER_LANDSCAPE ) ); | |
| 113 | - pageBack = ImageActor::New( Image::New( BOOK_COVER_BACK_LANDSCAPE ) ); | |
| 113 | + pageFront = ImageActor::New( ResourceImage::New( BOOK_COVER_LANDSCAPE ) ); | |
| 114 | + pageBack = ImageActor::New( ResourceImage::New( BOOK_COVER_BACK_LANDSCAPE ) ); | |
| 114 | 115 | } |
| 115 | 116 | else |
| 116 | 117 | { |
| 117 | 118 | unsigned int imageId = (pageId-1)*2; |
| 118 | - pageFront = ImageActor::New( Image::New( PAGE_IMAGES_LANDSCAPE[ imageId % NUMBER_OF_LANDSCAPE_IMAGE ] ) ); | |
| 119 | - pageBack = ImageActor::New( Image::New( PAGE_IMAGES_LANDSCAPE[ (imageId+1) % NUMBER_OF_LANDSCAPE_IMAGE ] ) ); | |
| 119 | + pageFront = ImageActor::New( ResourceImage::New( PAGE_IMAGES_LANDSCAPE[ imageId % NUMBER_OF_LANDSCAPE_IMAGE ] ) ); | |
| 120 | + pageBack = ImageActor::New( ResourceImage::New( PAGE_IMAGES_LANDSCAPE[ (imageId+1) % NUMBER_OF_LANDSCAPE_IMAGE ] ) ); | |
| 120 | 121 | } |
| 121 | 122 | pageFront.Add(pageBack); |
| 122 | 123 | return pageFront; | ... | ... |
examples/radial-menu/radial-menu-example.cpp
| ... | ... | @@ -135,8 +135,8 @@ void RadialMenuExample::OnInit(Application& app) |
| 135 | 135 | TOOLBAR_IMAGE, |
| 136 | 136 | APPLICATION_TITLE ); |
| 137 | 137 | |
| 138 | - mIconPlay = Image::New( PLAY_ICON ); | |
| 139 | - mIconStop = Image::New( STOP_ICON ); | |
| 138 | + mIconPlay = ResourceImage::New( PLAY_ICON ); | |
| 139 | + mIconStop = ResourceImage::New( STOP_ICON ); | |
| 140 | 140 | mPlayStopButton = Toolkit::PushButton::New(); |
| 141 | 141 | mPlayStopButton.SetBackgroundImage( mIconStop ); |
| 142 | 142 | |
| ... | ... | @@ -147,7 +147,7 @@ void RadialMenuExample::OnInit(Application& app) |
| 147 | 147 | Toolkit::Alignment::HorizontalRight, |
| 148 | 148 | DemoHelper::DEFAULT_PLAY_PADDING ); |
| 149 | 149 | |
| 150 | - Vector2 imgSize = Image::GetImageSize(TEST_OUTER_RING_FILENAME); | |
| 150 | + Vector2 imgSize = ResourceImage::GetImageSize(TEST_OUTER_RING_FILENAME); | |
| 151 | 151 | Vector2 stageSize = stage.GetSize(); |
| 152 | 152 | float minStageDimension = std::min(stageSize.width, stageSize.height); |
| 153 | 153 | |
| ... | ... | @@ -163,7 +163,7 @@ void RadialMenuExample::OnInit(Application& app) |
| 163 | 163 | mRadialSweepView3.SetInitialActorAngle(Degree(-110)); |
| 164 | 164 | mRadialSweepView3.SetFinalActorAngle(Degree(0)); |
| 165 | 165 | |
| 166 | - Image dial = Image::New( TEST_DIAL_FILENAME ); | |
| 166 | + Image dial = ResourceImage::New( TEST_DIAL_FILENAME ); | |
| 167 | 167 | mDialActor = ImageActor::New( dial ); |
| 168 | 168 | mDialActor.SetPositionInheritanceMode(USE_PARENT_POSITION); |
| 169 | 169 | mDialActor.SetScale(scale); |
| ... | ... | @@ -238,13 +238,13 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName, |
| 238 | 238 | Degree finalAngle) |
| 239 | 239 | { |
| 240 | 240 | // Create the image |
| 241 | - Image image = Image::New(imageName); | |
| 241 | + Image image = ResourceImage::New(imageName); | |
| 242 | 242 | mImageActor = ImageActor::New(image); |
| 243 | 243 | mImageActor.SetParentOrigin(ParentOrigin::CENTER); |
| 244 | 244 | mImageActor.SetAnchorPoint(AnchorPoint::CENTER); |
| 245 | 245 | |
| 246 | 246 | // Create the stencil |
| 247 | - Vector2 imageSize = Image::GetImageSize(imageName); | |
| 247 | + Vector2 imageSize = ResourceImage::GetImageSize(imageName); | |
| 248 | 248 | float diameter = std::max(imageSize.width, imageSize.height); |
| 249 | 249 | RadialSweepView radialSweepView = RadialSweepView::New(); |
| 250 | 250 | radialSweepView.SetDiameter( diameter ); | ... | ... |
examples/scroll-view/scroll-view-example.cpp
| ... | ... | @@ -194,11 +194,11 @@ public: |
| 194 | 194 | TOOLBAR_IMAGE, |
| 195 | 195 | "" ); |
| 196 | 196 | |
| 197 | - mEffectIcon[ DepthEffect ] = Image::New( EFFECT_DEPTH_IMAGE ); | |
| 198 | - mEffectIcon[ CubeEffect ] = Image::New( EFFECT_INNER_CUBE_IMAGE ); | |
| 199 | - mEffectIcon[ PageCarouselEffect ] = Image::New( EFFECT_CAROUSEL_IMAGE ); | |
| 200 | - mEffectIcon[ PageCubeEffect ] = Image::New( EFFECT_CAROUSEL_IMAGE ); | |
| 201 | - mEffectIcon[ PageSpiralEffect ] = Image::New( EFFECT_CAROUSEL_IMAGE ); | |
| 197 | + mEffectIcon[ DepthEffect ] = ResourceImage::New( EFFECT_DEPTH_IMAGE ); | |
| 198 | + mEffectIcon[ CubeEffect ] = ResourceImage::New( EFFECT_INNER_CUBE_IMAGE ); | |
| 199 | + mEffectIcon[ PageCarouselEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); | |
| 200 | + mEffectIcon[ PageCubeEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); | |
| 201 | + mEffectIcon[ PageSpiralEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); | |
| 202 | 202 | |
| 203 | 203 | // Create a effect change button. (right of toolbar) |
| 204 | 204 | mEffectChangeButton = Toolkit::PushButton::New(); |
| ... | ... | @@ -298,7 +298,7 @@ private: |
| 298 | 298 | Actor CreatePage() |
| 299 | 299 | { |
| 300 | 300 | Actor page = Actor::New(); |
| 301 | - page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 301 | + page.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 302 | 302 | page.SetParentOrigin( ParentOrigin::CENTER ); |
| 303 | 303 | page.SetAnchorPoint( AnchorPoint::CENTER ); |
| 304 | 304 | |
| ... | ... | @@ -450,7 +450,7 @@ private: |
| 450 | 450 | void ApplyEffectToPage(Actor page) |
| 451 | 451 | { |
| 452 | 452 | page.RemoveConstraints(); |
| 453 | - page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 453 | + page.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 454 | 454 | |
| 455 | 455 | switch( mEffectMode ) |
| 456 | 456 | { |
| ... | ... | @@ -563,7 +563,7 @@ private: |
| 563 | 563 | |
| 564 | 564 | attributes.SetSize(width, height); |
| 565 | 565 | attributes.SetScalingMode(ImageAttributes::ShrinkToFit); |
| 566 | - Image img = Image::New(filename, attributes); | |
| 566 | + Image img = ResourceImage::New(filename, attributes); | |
| 567 | 567 | ImageActor actor = ImageActor::New(img); |
| 568 | 568 | actor.SetName( filename ); |
| 569 | 569 | actor.SetParentOrigin(ParentOrigin::CENTER); | ... | ... |
examples/shader-effect/bubble-effect-example.cpp
| ... | ... | @@ -94,7 +94,7 @@ private: |
| 94 | 94 | |
| 95 | 95 | // Add a button to change background. (right of toolbar) |
| 96 | 96 | mChangeBackgroundButton = Toolkit::PushButton::New(); |
| 97 | - mChangeBackgroundButton.SetBackgroundImage( Image::New( CHANGE_BACKGROUND_ICON ) ); | |
| 97 | + mChangeBackgroundButton.SetBackgroundImage( ResourceImage::New( CHANGE_BACKGROUND_ICON ) ); | |
| 98 | 98 | mChangeBackgroundButton.ClickedSignal().Connect( this, &BubbleEffectExample::OnChangeIconClicked ); |
| 99 | 99 | toolBar.AddControl( mChangeBackgroundButton, |
| 100 | 100 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, |
| ... | ... | @@ -102,7 +102,7 @@ private: |
| 102 | 102 | DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 103 | 103 | // Add a button to change bubble shape. ( left of bar ) |
| 104 | 104 | mChangeBubbleShapeButton = Toolkit::PushButton::New(); |
| 105 | - mChangeBubbleShapeButton.SetBackgroundImage( Image::New( CHANGE_BUBBLE_SHAPE_ICON ) ); | |
| 105 | + mChangeBubbleShapeButton.SetBackgroundImage( ResourceImage::New( CHANGE_BUBBLE_SHAPE_ICON ) ); | |
| 106 | 106 | mChangeBubbleShapeButton.ClickedSignal().Connect( this, &BubbleEffectExample::OnChangeIconClicked ); |
| 107 | 107 | toolBar.AddControl( mChangeBubbleShapeButton, |
| 108 | 108 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, |
| ... | ... | @@ -111,10 +111,10 @@ private: |
| 111 | 111 | |
| 112 | 112 | // Create and initialize the BubbleEmitter object |
| 113 | 113 | mBubbleEmitter = Toolkit::BubbleEmitter::New( stageSize, |
| 114 | - Image::New( BUBBLE_SHAPE_IMAGES[mCurrentBubbleShapeImageId] ), | |
| 114 | + ResourceImage::New( BUBBLE_SHAPE_IMAGES[mCurrentBubbleShapeImageId] ), | |
| 115 | 115 | DEFAULT_NUMBER_OF_BUBBLES, |
| 116 | 116 | DEFAULT_BUBBLE_SIZE); |
| 117 | - mBackgroundImage = Image::New( BACKGROUND_IMAGES[mCurrentBackgroundImageId] ); | |
| 117 | + mBackgroundImage = ResourceImage::New( BACKGROUND_IMAGES[mCurrentBackgroundImageId] ); | |
| 118 | 118 | mBubbleEmitter.SetBackground( mBackgroundImage, mHSVDelta ); |
| 119 | 119 | |
| 120 | 120 | // Get the root actor of all bubbles, and add it to stage. |
| ... | ... | @@ -235,7 +235,7 @@ private: |
| 235 | 235 | { |
| 236 | 236 | if(button == mChangeBackgroundButton) |
| 237 | 237 | { |
| 238 | - mBackgroundImage = Image::New( BACKGROUND_IMAGES[ ++mCurrentBackgroundImageId % NUM_BACKGROUND_IMAGES ] ); | |
| 238 | + mBackgroundImage = ResourceImage::New( BACKGROUND_IMAGES[ ++mCurrentBackgroundImageId % NUM_BACKGROUND_IMAGES ] ); | |
| 239 | 239 | |
| 240 | 240 | mBubbleEmitter.SetBackground( mBackgroundImage, mHSVDelta ); |
| 241 | 241 | |
| ... | ... | @@ -243,7 +243,7 @@ private: |
| 243 | 243 | } |
| 244 | 244 | else if( button == mChangeBubbleShapeButton ) |
| 245 | 245 | { |
| 246 | - mBubbleEmitter.SetShapeImage( Image::New( BUBBLE_SHAPE_IMAGES[ ++mCurrentBubbleShapeImageId % NUM_BUBBLE_SHAPE_IMAGES ] ) ); | |
| 246 | + mBubbleEmitter.SetShapeImage( ResourceImage::New( BUBBLE_SHAPE_IMAGES[ ++mCurrentBubbleShapeImageId % NUM_BUBBLE_SHAPE_IMAGES ] ) ); | |
| 247 | 247 | } |
| 248 | 248 | return true; |
| 249 | 249 | } | ... | ... |
examples/shader-effect/dissolve-effect-example.cpp
| ... | ... | @@ -138,6 +138,7 @@ private: |
| 138 | 138 | Toolkit::View mView; |
| 139 | 139 | Toolkit::ToolBar mToolBar; |
| 140 | 140 | Layer mContent; |
| 141 | + Actor mParent; | |
| 141 | 142 | |
| 142 | 143 | ImageActor mCurrentImage; |
| 143 | 144 | ImageActor mNextImage; |
| ... | ... | @@ -191,8 +192,8 @@ void DissolveEffectApp::OnInit( Application& application ) |
| 191 | 192 | mContent = DemoHelper::CreateView( application, mView,mToolBar, "", TOOLBAR_IMAGE, "" ); |
| 192 | 193 | |
| 193 | 194 | // Add an effect-changing button on the right of the tool bar. |
| 194 | - mIconHighP = Image::New( EFFECT_HIGHP_IMAGE ); | |
| 195 | - mIconMediumP = Image::New( EFFECT_MEDIUMP_IMAGE ); | |
| 195 | + mIconHighP = ResourceImage::New( EFFECT_HIGHP_IMAGE ); | |
| 196 | + mIconMediumP = ResourceImage::New( EFFECT_MEDIUMP_IMAGE ); | |
| 196 | 197 | mEffectChangeButton = Toolkit::PushButton::New(); |
| 197 | 198 | mEffectChangeButton.SetBackgroundImage(mIconHighP); |
| 198 | 199 | mEffectChangeButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnEffectButtonClicked ); |
| ... | ... | @@ -202,8 +203,8 @@ void DissolveEffectApp::OnInit( Application& application ) |
| 202 | 203 | // TODO |
| 203 | 204 | |
| 204 | 205 | // Add an slide-show button on the right of the title |
| 205 | - mIconPlay = Image::New( PLAY_ICON ); | |
| 206 | - mIconStop = Image::New( STOP_ICON ); | |
| 206 | + mIconPlay = ResourceImage::New( PLAY_ICON ); | |
| 207 | + mIconStop = ResourceImage::New( STOP_ICON ); | |
| 207 | 208 | mPlayStopButton = Toolkit::PushButton::New(); |
| 208 | 209 | mPlayStopButton.SetBackgroundImage( mIconPlay ); |
| 209 | 210 | mPlayStopButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnSildeshowButtonClicked ); |
| ... | ... | @@ -217,18 +218,24 @@ void DissolveEffectApp::OnInit( Application& application ) |
| 217 | 218 | mCurrentImageEffect = Toolkit::DissolveEffect::New(mUseHighPrecision); |
| 218 | 219 | mNextImageEffect = Toolkit::DissolveEffect::New(mUseHighPrecision); |
| 219 | 220 | |
| 220 | - | |
| 221 | 221 | mViewTimer = Timer::New( VIEWINGTIME ); |
| 222 | 222 | mViewTimer.TickSignal().Connect( this, &DissolveEffectApp::OnTimerTick ); |
| 223 | 223 | mTimerReady = true; |
| 224 | 224 | |
| 225 | + // Set size to stage size to avoid seeing a black border on transition | |
| 226 | + mParent = Actor::New(); | |
| 227 | + mParent.SetSize( Stage::GetCurrent().GetSize() ); | |
| 228 | + mParent.SetPositionInheritanceMode( USE_PARENT_POSITION ); | |
| 229 | + mContent.Add( mParent ); | |
| 230 | + | |
| 225 | 231 | mSizeConstraint= Constraint::New<Vector3>( Actor::SCALE, LocalSource( Actor::SIZE ), ParentSource( Actor::SIZE ), ScaleToFitKeepAspectRatioConstraint() ); |
| 226 | 232 | |
| 227 | 233 | // show the first image |
| 228 | - mCurrentImage = ImageActor::New( Image::New( IMAGES[mIndex] ) ); | |
| 234 | + mCurrentImage = ImageActor::New( ResourceImage::New( IMAGES[mIndex] ) ); | |
| 229 | 235 | mCurrentImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION); |
| 230 | 236 | mCurrentImage.ApplyConstraint( mSizeConstraint ); |
| 231 | - mContent.Add(mCurrentImage); | |
| 237 | + mParent.Add( mCurrentImage ); | |
| 238 | + | |
| 232 | 239 | mPanGestureDetector.Attach( mCurrentImage ); |
| 233 | 240 | } |
| 234 | 241 | |
| ... | ... | @@ -252,12 +259,12 @@ void DissolveEffectApp::OnPanGesture( Actor actor, const PanGesture& gesture ) |
| 252 | 259 | mIndex = (mIndex + NUM_IMAGES -1)%NUM_IMAGES; |
| 253 | 260 | } |
| 254 | 261 | |
| 255 | - Image image = Image::New( IMAGES[ mIndex ] ); | |
| 262 | + Image image = ResourceImage::New( IMAGES[ mIndex ] ); | |
| 256 | 263 | mNextImage = ImageActor::New( image ); |
| 257 | 264 | mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION); |
| 258 | 265 | mNextImage.ApplyConstraint( mSizeConstraint ); |
| 259 | 266 | mNextImage.SetZ(INITIAL_DEPTH); |
| 260 | - mContent.Add(mNextImage); | |
| 267 | + mParent.Add( mNextImage ); | |
| 261 | 268 | Vector2 size = Vector2( mCurrentImage.GetCurrentSize() ); |
| 262 | 269 | StartTransition( gesture.position / size, gesture.displacement * Vector2(1.0, size.x/size.y)); |
| 263 | 270 | } |
| ... | ... | @@ -325,7 +332,7 @@ bool DissolveEffectApp::OnSildeshowButtonClicked( Toolkit::Button button ) |
| 325 | 332 | if( mSlideshow ) |
| 326 | 333 | { |
| 327 | 334 | mPlayStopButton.SetBackgroundImage( mIconStop ); |
| 328 | - mPanGestureDetector.Detach( mContent ); | |
| 335 | + mPanGestureDetector.Detach( mParent ); | |
| 329 | 336 | mViewTimer.Start(); |
| 330 | 337 | mTimerReady = false; |
| 331 | 338 | } |
| ... | ... | @@ -333,7 +340,7 @@ bool DissolveEffectApp::OnSildeshowButtonClicked( Toolkit::Button button ) |
| 333 | 340 | { |
| 334 | 341 | mPlayStopButton.SetBackgroundImage( mIconPlay ); |
| 335 | 342 | mTimerReady = true; |
| 336 | - mPanGestureDetector.Attach( mContent ); | |
| 343 | + mPanGestureDetector.Attach( mParent ); | |
| 337 | 344 | } |
| 338 | 345 | return true; |
| 339 | 346 | } |
| ... | ... | @@ -342,7 +349,7 @@ void DissolveEffectApp::OnTransitionCompleted( Animation& source ) |
| 342 | 349 | { |
| 343 | 350 | mCurrentImage.RemoveShaderEffect(); |
| 344 | 351 | mNextImage.RemoveShaderEffect(); |
| 345 | - mContent.Remove(mCurrentImage); | |
| 352 | + mParent.Remove( mCurrentImage ); | |
| 346 | 353 | mPanGestureDetector.Detach( mCurrentImage ); |
| 347 | 354 | mCurrentImage = mNextImage; |
| 348 | 355 | mPanGestureDetector.Attach( mCurrentImage ); |
| ... | ... | @@ -361,13 +368,13 @@ bool DissolveEffectApp::OnTimerTick() |
| 361 | 368 | if(mSlideshow) |
| 362 | 369 | { |
| 363 | 370 | mIndex = (mIndex + 1)%NUM_IMAGES; |
| 364 | - Image image = Image::New( IMAGES[ mIndex ] ); | |
| 371 | + Image image = ResourceImage::New( IMAGES[ mIndex ] ); | |
| 365 | 372 | mNextImage = ImageActor::New( image ); |
| 366 | 373 | mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION); |
| 367 | 374 | mNextImage.ApplyConstraint( mSizeConstraint ); |
| 368 | 375 | mNextImage.SetZ(INITIAL_DEPTH); |
| 369 | - mContent.Add(mNextImage); | |
| 370 | - switch(mCentralLineIndex%4) | |
| 376 | + mParent.Add( mNextImage ); | |
| 377 | + switch( mCentralLineIndex%4 ) | |
| 371 | 378 | { |
| 372 | 379 | case 0: |
| 373 | 380 | { | ... | ... |
examples/shader-effect/refraction-effect-example.cpp
| ... | ... | @@ -318,7 +318,7 @@ private: |
| 318 | 318 | |
| 319 | 319 | // Add a button to change background. (right of toolbar) |
| 320 | 320 | mChangeTextureButton = Toolkit::PushButton::New(); |
| 321 | - mChangeTextureButton.SetBackgroundImage( Image::New( CHANGE_TEXTURE_ICON ) ); | |
| 321 | + mChangeTextureButton.SetBackgroundImage( ResourceImage::New( CHANGE_TEXTURE_ICON ) ); | |
| 322 | 322 | mChangeTextureButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeTexture ); |
| 323 | 323 | toolBar.AddControl( mChangeTextureButton, |
| 324 | 324 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, |
| ... | ... | @@ -326,7 +326,7 @@ private: |
| 326 | 326 | DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 327 | 327 | // Add a button to change mesh pattern. ( left of bar ) |
| 328 | 328 | mChangeMeshButton = Toolkit::PushButton::New(); |
| 329 | - mChangeMeshButton.SetBackgroundImage( Image::New( CHANGE_MESH_ICON ) ); | |
| 329 | + mChangeMeshButton.SetBackgroundImage( ResourceImage::New( CHANGE_MESH_ICON ) ); | |
| 330 | 330 | mChangeMeshButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeMesh ); |
| 331 | 331 | toolBar.AddControl( mChangeMeshButton, |
| 332 | 332 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, |
| ... | ... | @@ -338,7 +338,7 @@ private: |
| 338 | 338 | mNoEffect = NoEffect::New(); // used in the other situations, basic render shader |
| 339 | 339 | // Create the mesh from the obj file and add to stage |
| 340 | 340 | mMaterial = Material::New( "Material" ) ; |
| 341 | - mMaterial.SetDiffuseTexture(Image::New(TEXTURE_IMAGES[mCurrentTextureId])); | |
| 341 | + mMaterial.SetDiffuseTexture(ResourceImage::New(TEXTURE_IMAGES[mCurrentTextureId])); | |
| 342 | 342 | CreateSurface( MESH_FILES[mCurrentMeshId] ); |
| 343 | 343 | |
| 344 | 344 | // Connect the callback to the touch signal on the mesh actor |
| ... | ... | @@ -371,7 +371,7 @@ private: |
| 371 | 371 | bool OnChangeTexture( Toolkit::Button button ) |
| 372 | 372 | { |
| 373 | 373 | mCurrentTextureId = ( mCurrentTextureId + 1 ) % NUM_TEXTURE_IMAGES; |
| 374 | - mMaterial.SetDiffuseTexture(Image::New(TEXTURE_IMAGES[mCurrentTextureId])); | |
| 374 | + mMaterial.SetDiffuseTexture(ResourceImage::New(TEXTURE_IMAGES[mCurrentTextureId])); | |
| 375 | 375 | |
| 376 | 376 | return true; |
| 377 | 377 | } | ... | ... |
examples/shadows/shadow-bone-lighting-example.cpp
| ... | ... | @@ -20,6 +20,7 @@ |
| 20 | 20 | |
| 21 | 21 | #include <dali/dali.h> |
| 22 | 22 | #include <dali-toolkit/dali-toolkit.h> |
| 23 | +#include <iostream> | |
| 23 | 24 | |
| 24 | 25 | using namespace Dali; |
| 25 | 26 | using namespace Dali::Toolkit; |
| ... | ... | @@ -28,9 +29,6 @@ using namespace DemoHelper; |
| 28 | 29 | |
| 29 | 30 | namespace |
| 30 | 31 | { |
| 31 | -const char* gModelFile = DALI_MODEL_DIR "AlbumCute.dae"; | |
| 32 | -const char* gBinaryModelFile = DALI_MODEL_DIR "AlbumCute.dali-bin"; | |
| 33 | - | |
| 34 | 32 | const char* BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-default.png" ); |
| 35 | 33 | const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 36 | 34 | |
| ... | ... | @@ -41,6 +39,10 @@ const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 41 | 39 | const char* CHANGE_EFFECT_IMAGE( DALI_IMAGE_DIR "icon-change.png" ); |
| 42 | 40 | const char* RESET_ICON( DALI_IMAGE_DIR "icon-reset.png" ); |
| 43 | 41 | |
| 42 | +const char* SCENE_IMAGE_1( DALI_IMAGE_DIR "gallery-small-10.jpg"); | |
| 43 | +const char* SCENE_IMAGE_2( DALI_IMAGE_DIR "gallery-small-42.jpg"); | |
| 44 | +const char* SCENE_IMAGE_3( DALI_IMAGE_DIR "gallery-small-48.jpg"); | |
| 45 | + | |
| 44 | 46 | const Quaternion JAUNTY_ROTATION(Math::PI/5.0f, Math::PI/5.0f, 0.0f); // Euler angles |
| 45 | 47 | const float MIN_PINCH_SCALE( 0.3f ); |
| 46 | 48 | const float MAX_PINCH_SCALE( 2.05f ); |
| ... | ... | @@ -56,7 +58,7 @@ const Vector2 DEFAULT_STAGE_SIZE( 480.0f, 800.0f ); |
| 56 | 58 | } |
| 57 | 59 | |
| 58 | 60 | /** |
| 59 | - * This example shows a fixed point light onto an animating model | |
| 61 | + * This example shows a fixed point light onto an animating set of images | |
| 60 | 62 | * casting a shadow onto a wall. The whole scene can be rotated. |
| 61 | 63 | */ |
| 62 | 64 | |
| ... | ... | @@ -118,6 +120,21 @@ public: |
| 118 | 120 | } |
| 119 | 121 | }; |
| 120 | 122 | |
| 123 | + struct RotationConstraint | |
| 124 | + { | |
| 125 | + RotationConstraint(float sign) | |
| 126 | + : mSign(sign) | |
| 127 | + { | |
| 128 | + } | |
| 129 | + | |
| 130 | + Quaternion operator()( const Quaternion& current, const PropertyInput& property ) | |
| 131 | + { | |
| 132 | + Degree angle(property.GetFloat()); | |
| 133 | + return Quaternion( Radian(angle) * mSign, Vector3::YAXIS ); | |
| 134 | + } | |
| 135 | + | |
| 136 | + float mSign; | |
| 137 | + }; | |
| 121 | 138 | |
| 122 | 139 | /** |
| 123 | 140 | * This method gets called once the main loop of application is up and running |
| ... | ... | @@ -128,11 +145,9 @@ public: |
| 128 | 145 | |
| 129 | 146 | Stage::GetCurrent().KeyEventSignal().Connect(this, &TestApp::OnKeyEvent); |
| 130 | 147 | |
| 131 | - mModel = Model::New(gBinaryModelFile); // trigger model load | |
| 132 | - mModel.LoadingFinishedSignal().Connect(this, &TestApp::BinaryModelLoaded); | |
| 133 | - | |
| 134 | 148 | CreateToolbarAndView(app); |
| 135 | 149 | CreateShadowViewAndLights(); |
| 150 | + CreateScene(); | |
| 136 | 151 | } |
| 137 | 152 | |
| 138 | 153 | void CreateToolbarAndView(Application& app) |
| ... | ... | @@ -148,7 +163,7 @@ public: |
| 148 | 163 | "" ); |
| 149 | 164 | |
| 150 | 165 | // Add an effect-changing button on the right of the tool bar. |
| 151 | - Image imageChangeEffect = Image::New( CHANGE_EFFECT_IMAGE ); | |
| 166 | + Image imageChangeEffect = ResourceImage::New( CHANGE_EFFECT_IMAGE ); | |
| 152 | 167 | Toolkit::PushButton effectChangeButton = Toolkit::PushButton::New(); |
| 153 | 168 | effectChangeButton.SetBackgroundImage(imageChangeEffect); |
| 154 | 169 | effectChangeButton.ClickedSignal().Connect( this, &TestApp::OnEffectButtonClicked ); |
| ... | ... | @@ -158,7 +173,7 @@ public: |
| 158 | 173 | // TODO |
| 159 | 174 | |
| 160 | 175 | //Add a reset button |
| 161 | - Image resetImage = Image::New( RESET_ICON ); | |
| 176 | + Image resetImage = ResourceImage::New( RESET_ICON ); | |
| 162 | 177 | Toolkit::PushButton resetButton = Toolkit::PushButton::New(); |
| 163 | 178 | resetButton.SetBackgroundImage( resetImage ); |
| 164 | 179 | resetButton.ClickedSignal().Connect( this, &TestApp::OnResetPressed ); |
| ... | ... | @@ -184,42 +199,7 @@ public: |
| 184 | 199 | mTapGestureDetector.DetectedSignal().Connect(this, &TestApp::OnTap); |
| 185 | 200 | } |
| 186 | 201 | |
| 187 | - /** | |
| 188 | - * This method gets called once the model is loaded by the resource manager | |
| 189 | - */ | |
| 190 | - void BinaryModelLoaded(Model model) | |
| 191 | - { | |
| 192 | - if( model.GetLoadingState() == ResourceLoadingSucceeded ) | |
| 193 | - { | |
| 194 | - std::cout << "Succeeded loading binary model" << std::endl; | |
| 195 | - | |
| 196 | - ModelReady(); | |
| 197 | - } | |
| 198 | - else | |
| 199 | - { | |
| 200 | - std::cout << "Failed loading binary model" << std::endl; | |
| 201 | - | |
| 202 | - mModel = Model::New(gModelFile); | |
| 203 | - mModel.LoadingFinishedSignal().Connect(this, &TestApp::ModelLoaded); | |
| 204 | - } | |
| 205 | - } | |
| 206 | - | |
| 207 | - void ModelLoaded(Model model) | |
| 208 | - { | |
| 209 | - if( model.GetLoadingState() == ResourceLoadingSucceeded ) | |
| 210 | - { | |
| 211 | - std::cout << "Succeeded loading collada model" << std::endl; | |
| 212 | - | |
| 213 | - model.Save(gBinaryModelFile); | |
| 214 | - ModelReady(); | |
| 215 | - } | |
| 216 | - else | |
| 217 | - { | |
| 218 | - std::cout << "Failed loading collada model" << std::endl; | |
| 219 | 202 | |
| 220 | - mApp.Quit(); | |
| 221 | - } | |
| 222 | - } | |
| 223 | 203 | |
| 224 | 204 | void CreateShadowViewAndLights() |
| 225 | 205 | { |
| ... | ... | @@ -227,11 +207,11 @@ public: |
| 227 | 207 | mShadowView.SetName("Container"); |
| 228 | 208 | mShadowView.SetParentOrigin(ParentOrigin::CENTER); |
| 229 | 209 | mShadowView.SetAnchorPoint(AnchorPoint::CENTER); |
| 230 | - mShadowView.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); | |
| 210 | + mShadowView.SetSizeMode( SIZE_EQUAL_TO_PARENT ); | |
| 231 | 211 | mShadowView.SetPointLightFieldOfView( Math::PI / 2.0f); |
| 232 | 212 | mContents.Add(mShadowView); |
| 233 | 213 | |
| 234 | - Image brickWall = Image::New(DALI_IMAGE_DIR "brick-wall.jpg"); | |
| 214 | + Image brickWall = ResourceImage::New(DALI_IMAGE_DIR "brick-wall.jpg"); | |
| 235 | 215 | mShadowPlaneBg = ImageActor::New(brickWall); |
| 236 | 216 | mShadowPlaneBg.SetParentOrigin(ParentOrigin::CENTER); |
| 237 | 217 | mShadowPlaneBg.SetAnchorPoint(AnchorPoint::CENTER); |
| ... | ... | @@ -249,7 +229,7 @@ public: |
| 249 | 229 | mLightAnchor.SetRotation(CalculateWorldRotation(Radian(mLightLongitudinal), Radian(mLightAxisTilt))); |
| 250 | 230 | |
| 251 | 231 | // Work out a scaling factor as the initial light position was calculated for desktop |
| 252 | - // Need to scale light position as model size is based on stage size (i.e. much bigger on device) | |
| 232 | + // Need to scale light position as scene actor size is based on stage size (i.e. much bigger on device) | |
| 253 | 233 | Vector2 stageSize( Stage::GetCurrent().GetSize() ); |
| 254 | 234 | float scaleFactor = stageSize.x / DEFAULT_STAGE_SIZE.x; |
| 255 | 235 | |
| ... | ... | @@ -264,44 +244,51 @@ public: |
| 264 | 244 | mShadowView.SetPointLight(mCastingLight); |
| 265 | 245 | } |
| 266 | 246 | |
| 267 | - void ModelReady() | |
| 247 | + void CreateScene() | |
| 268 | 248 | { |
| 269 | - mModelActor = ModelActorFactory::BuildActorTree(mModel, ""); // Gets root actor | |
| 249 | + mSceneActor = Actor::New(); | |
| 250 | + mSceneActor.SetParentOrigin(ParentOrigin::CENTER); | |
| 270 | 251 | |
| 271 | - if (mModelActor) | |
| 272 | - { | |
| 273 | - Vector2 stageSize(Stage::GetCurrent().GetSize()); | |
| 252 | + // Create and add images to the scene actor: | |
| 253 | + mImageActor1 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_1) ); | |
| 254 | + mImageActor2 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_2) ); | |
| 255 | + mImageActor3 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_3) ); | |
| 274 | 256 | |
| 275 | - mModelActor.SetSize(250.0f, 250.0f); | |
| 276 | - mModelActor.SetPosition(0.0f, 0.0f, 130.0f); | |
| 277 | 257 | |
| 278 | - //Create a Key light | |
| 279 | - Light keylight = Light::New("KeyLight"); | |
| 280 | - keylight.SetFallOff(Vector2(10000.0f, 10000.0f)); | |
| 281 | - //keylight.SetSpecularColor(Vector3::ZERO); | |
| 282 | - mKeyLightActor = LightActor::New(); | |
| 283 | - mKeyLightActor.SetParentOrigin(ParentOrigin::CENTER); | |
| 284 | - mKeyLightActor.SetName(keylight.GetName()); | |
| 258 | + mImageActor2.SetParentOrigin(ParentOrigin::CENTER); | |
| 285 | 259 | |
| 286 | - //Add all the actors to the stage | |
| 287 | - mCastingLight.Add(mKeyLightActor); | |
| 288 | - mKeyLightActor.SetLight(keylight); | |
| 260 | + mImageActor1.SetParentOrigin(ParentOrigin::CENTER_LEFT); | |
| 261 | + mImageActor1.SetAnchorPoint(AnchorPoint::CENTER_RIGHT); | |
| 289 | 262 | |
| 290 | - mShadowView.Add(mModelActor); | |
| 263 | + mImageActor3.SetParentOrigin(ParentOrigin::CENTER_RIGHT); | |
| 264 | + mImageActor3.SetAnchorPoint(AnchorPoint::CENTER_LEFT); | |
| 291 | 265 | |
| 266 | + mSceneActor.Add(mImageActor2); | |
| 267 | + mImageActor2.Add(mImageActor1); | |
| 268 | + mImageActor2.Add(mImageActor3); | |
| 292 | 269 | |
| 293 | - if (mModel.NumberOfAnimations()) | |
| 294 | - { | |
| 295 | - mModelAnimation = ModelActorFactory::BuildAnimation(mModel, mModelActor, 0); | |
| 296 | - mModelAnimation.SetDuration(4.0f); | |
| 297 | - mModelAnimation.SetLooping(true); | |
| 298 | - mModelAnimation.Play(); | |
| 299 | - } | |
| 270 | + Property::Index angleIndex = mImageActor2.RegisterProperty("angle", Property::Value(30.0f)); | |
| 271 | + Source angleSrc( mImageActor2, angleIndex ); | |
| 272 | + mImageActor1.ApplyConstraint(Constraint::New<Quaternion>( Actor::ROTATION, angleSrc, | |
| 273 | + RotationConstraint(-1.0f))); | |
| 274 | + mImageActor3.ApplyConstraint(Constraint::New<Quaternion>( Actor::ROTATION, angleSrc, | |
| 275 | + RotationConstraint(+1.0f))); | |
| 300 | 276 | |
| 301 | - //StartAnimation(); | |
| 302 | - } | |
| 277 | + mSceneAnimation = Animation::New(2.5f); | |
| 278 | + | |
| 279 | + // Want to animate angle from 30 => -30 and back again smoothly. | |
| 280 | + | |
| 281 | + mSceneAnimation.AnimateTo( Property( mImageActor2, angleIndex ), Property::Value(-30.0f), AlphaFunctions::Sin ); | |
| 282 | + | |
| 283 | + mSceneAnimation.SetLooping(true); | |
| 284 | + mSceneAnimation.Play(); | |
| 285 | + | |
| 286 | + mSceneActor.SetSize(250.0f, 250.0f); | |
| 287 | + mSceneActor.SetPosition(0.0f, 0.0f, 130.0f); | |
| 288 | + mShadowView.Add(mSceneActor); | |
| 303 | 289 | } |
| 304 | 290 | |
| 291 | + | |
| 305 | 292 | Quaternion CalculateWorldRotation(Radian longitude, Radian axisTilt ) |
| 306 | 293 | { |
| 307 | 294 | Quaternion q(longitude, Vector3::YAXIS); |
| ... | ... | @@ -311,17 +298,18 @@ public: |
| 311 | 298 | |
| 312 | 299 | void OnTap(Dali::Actor actor, const TapGesture& gesture) |
| 313 | 300 | { |
| 314 | - if( ! mPaused ) | |
| 315 | - { | |
| 316 | - //mAnimation.Pause(); | |
| 317 | - mModelAnimation.Pause(); | |
| 318 | - mPaused = true; | |
| 319 | - } | |
| 320 | - else | |
| 301 | + if( mSceneAnimation ) | |
| 321 | 302 | { |
| 322 | - //mAnimation.Play(); | |
| 323 | - mModelAnimation.Play(); | |
| 324 | - mPaused = false; | |
| 303 | + if( ! mPaused ) | |
| 304 | + { | |
| 305 | + mSceneAnimation.Pause(); | |
| 306 | + mPaused = true; | |
| 307 | + } | |
| 308 | + else | |
| 309 | + { | |
| 310 | + mSceneAnimation.Play(); | |
| 311 | + mPaused = false; | |
| 312 | + } | |
| 325 | 313 | } |
| 326 | 314 | } |
| 327 | 315 | |
| ... | ... | @@ -363,7 +351,7 @@ public: |
| 363 | 351 | mObjectLongitudinal += gesture.displacement.x/4.0f; |
| 364 | 352 | mObjectAxisTilt -= gesture.displacement.y/6.0f; |
| 365 | 353 | mObjectAxisTilt = Clamp<float>(mObjectAxisTilt, -90.0f, 90.0f); |
| 366 | - mModelActor.SetRotation(CalculateWorldRotation(Radian(mObjectLongitudinal), Radian(mObjectAxisTilt))); | |
| 354 | + mSceneActor.SetRotation(CalculateWorldRotation(Radian(mObjectLongitudinal), Radian(mObjectAxisTilt))); | |
| 367 | 355 | break; |
| 368 | 356 | } |
| 369 | 357 | } |
| ... | ... | @@ -392,13 +380,9 @@ public: |
| 392 | 380 | |
| 393 | 381 | void Terminate(Application& app) |
| 394 | 382 | { |
| 395 | - if( mModelActor ) | |
| 396 | - { | |
| 397 | - Stage::GetCurrent().Remove(mModelActor); | |
| 398 | - } | |
| 399 | - if( mKeyLightActor ) | |
| 383 | + if( mSceneActor ) | |
| 400 | 384 | { |
| 401 | - Stage::GetCurrent().Remove(mKeyLightActor); | |
| 385 | + Stage::GetCurrent().Remove(mSceneActor); | |
| 402 | 386 | } |
| 403 | 387 | if( mView ) |
| 404 | 388 | { |
| ... | ... | @@ -427,6 +411,7 @@ public: |
| 427 | 411 | // Reset translation |
| 428 | 412 | mTranslation = Vector3::ZERO; |
| 429 | 413 | mContents.SetPosition(mTranslation); |
| 414 | + | |
| 430 | 415 | // Align scene so that light anchor orientation is Z Axis |
| 431 | 416 | mAxisTilt = -mLightAxisTilt; |
| 432 | 417 | mLongitudinal = -mLightLongitudinal; |
| ... | ... | @@ -439,18 +424,18 @@ private: |
| 439 | 424 | Application& mApp; |
| 440 | 425 | Toolkit::View mView; |
| 441 | 426 | Layer mContents; |
| 442 | - Model mModel; | |
| 443 | - Actor mModelActor; | |
| 444 | - LightActor mKeyLightActor; | |
| 427 | + Actor mSceneActor; | |
| 445 | 428 | Animation mAnimation; |
| 446 | - Animation mModelAnimation; | |
| 429 | + Animation mSceneAnimation; | |
| 447 | 430 | bool mPaused; |
| 448 | 431 | Toolkit::ShadowView mShadowView; |
| 449 | 432 | ImageActor mShadowPlaneBg; |
| 450 | 433 | ImageActor mShadowPlane; |
| 451 | 434 | Actor mCastingLight; |
| 452 | 435 | Actor mLightAnchor; |
| 453 | - | |
| 436 | + ImageActor mImageActor1; | |
| 437 | + ImageActor mImageActor2; | |
| 438 | + ImageActor mImageActor3; | |
| 454 | 439 | PanGestureDetector mPanGestureDetector; |
| 455 | 440 | PinchGestureDetector mPinchGestureDetector; |
| 456 | 441 | TapGestureDetector mTapGestureDetector; |
| ... | ... | @@ -464,6 +449,9 @@ private: |
| 464 | 449 | float mPinchScale; |
| 465 | 450 | float mScaleAtPinchStart; |
| 466 | 451 | |
| 452 | + Property::Index mAngle1Index; | |
| 453 | + Property::Index mAngle3Index; | |
| 454 | + | |
| 467 | 455 | enum PanState |
| 468 | 456 | { |
| 469 | 457 | PAN_SCENE, | ... | ... |
examples/shared/view.h
| ... | ... | @@ -72,14 +72,14 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, |
| 72 | 72 | toolBarLayer.RaiseToTop(); |
| 73 | 73 | |
| 74 | 74 | // Tool bar |
| 75 | - Dali::Image image = Dali::Image::New( toolbarImagePath ); | |
| 75 | + Dali::Image image = Dali::ResourceImage::New( toolbarImagePath ); | |
| 76 | 76 | Dali::ImageActor toolBarBackground = Dali::ImageActor::New( image ); |
| 77 | 77 | toolBar = Dali::Toolkit::ToolBar::New(); |
| 78 | 78 | toolBar.SetBackground( toolBarBackground ); |
| 79 | 79 | toolBar.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER ); |
| 80 | 80 | toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); |
| 81 | - toolBar.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::EqualToConstraint() ) ); | |
| 82 | 81 | toolBar.SetSize( 0.0f, style.mToolBarHeight ); |
| 82 | + toolBar.SetSizeMode( Dali::SIZE_EQUAL_TO_PARENT ); | |
| 83 | 83 | toolBarBackground.SetSortModifier(1.0f); |
| 84 | 84 | |
| 85 | 85 | // Add the tool bar to the too bar layer. |
| ... | ... | @@ -113,7 +113,7 @@ Dali::Layer CreateView( Dali::Application& application, |
| 113 | 113 | // Set background image. |
| 114 | 114 | if ( ! backgroundImagePath.empty() ) |
| 115 | 115 | { |
| 116 | - Dali::Image backgroundImage = Dali::Image::New( backgroundImagePath ); | |
| 116 | + Dali::Image backgroundImage = Dali::ResourceImage::New( backgroundImagePath ); | |
| 117 | 117 | Dali::ImageActor backgroundImageActor = Dali::ImageActor::New( backgroundImage ); |
| 118 | 118 | view.SetBackground( backgroundImageActor ); |
| 119 | 119 | } |
| ... | ... | @@ -134,7 +134,7 @@ Dali::Layer CreateView( Dali::Application& application, |
| 134 | 134 | Dali::Layer contentLayer = Dali::Layer::New(); |
| 135 | 135 | contentLayer.SetAnchorPoint( Dali::AnchorPoint::CENTER ); |
| 136 | 136 | contentLayer.SetParentOrigin( Dali::ParentOrigin::CENTER ); |
| 137 | - contentLayer.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::EqualToConstraint() ) ); | |
| 137 | + contentLayer.SetSizeMode( Dali::SIZE_EQUAL_TO_PARENT ); | |
| 138 | 138 | view.AddContentLayer( contentLayer ); |
| 139 | 139 | contentLayer.LowerBelow( toolBarLayer ); |
| 140 | 140 | ... | ... |
examples/transition/cube-transition-effect-example.cpp
| ... | ... | @@ -120,7 +120,7 @@ private: |
| 120 | 120 | * Start the transition |
| 121 | 121 | * @param[in] image The image content of the imageActor for transition |
| 122 | 122 | */ |
| 123 | - void OnImageLoaded(Image image); | |
| 123 | + void OnImageLoaded(ResourceImage image); | |
| 124 | 124 | /** |
| 125 | 125 | * Main key event handler |
| 126 | 126 | */ |
| ... | ... | @@ -208,17 +208,17 @@ void CubeTransitionApp::OnInit( Application& application ) |
| 208 | 208 | mContent = DemoHelper::CreateView( application, mView, mToolBar, "", TOOLBAR_IMAGE, "" ); |
| 209 | 209 | |
| 210 | 210 | // Add an effect-changing button on the right of the tool bar. |
| 211 | - mImageWave = Image::New( EFFECT_WAVE_IMAGE ); | |
| 212 | - mImageCross = Image::New( EFFECT_CROSS_IMAGE ); | |
| 213 | - mImageFold = Image::New( EFFECT_FOLD_IMAGE ); | |
| 211 | + mImageWave = ResourceImage::New( EFFECT_WAVE_IMAGE ); | |
| 212 | + mImageCross = ResourceImage::New( EFFECT_CROSS_IMAGE ); | |
| 213 | + mImageFold = ResourceImage::New( EFFECT_FOLD_IMAGE ); | |
| 214 | 214 | mEffectChangeButton = Toolkit::PushButton::New(); |
| 215 | 215 | mEffectChangeButton.SetBackgroundImage(mImageWave); |
| 216 | 216 | mEffectChangeButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnEffectButtonClicked ); |
| 217 | 217 | mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 218 | 218 | |
| 219 | 219 | //Add an slideshow icon on the right of the title |
| 220 | - mIconSlideshowStart = Image::New( SLIDE_SHOW_START_ICON ); | |
| 221 | - mIconSlideshowStop = Image::New( SLIDE_SHOW_STOP_ICON ); | |
| 220 | + mIconSlideshowStart = ResourceImage::New( SLIDE_SHOW_START_ICON ); | |
| 221 | + mIconSlideshowStop = ResourceImage::New( SLIDE_SHOW_STOP_ICON ); | |
| 222 | 222 | mSlideshowButton = Toolkit::PushButton::New(); |
| 223 | 223 | mSlideshowButton.SetBackgroundImage( mIconSlideshowStart ); |
| 224 | 224 | mSlideshowButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnSildeshowButtonClicked ); |
| ... | ... | @@ -261,7 +261,7 @@ void CubeTransitionApp::OnInit( Application& application ) |
| 261 | 261 | // show the first image |
| 262 | 262 | mImageConstraint = Constraint::New<Vector3>( Actor::SCALE, LocalSource( Actor::SIZE ), ParentSource( Actor::SIZE ), ScaleToFitKeepAspectRatioConstraint() ); |
| 263 | 263 | |
| 264 | - mCurrentImage = ImageActor::New( Image::New( IMAGES[mIndex] ) ); | |
| 264 | + mCurrentImage = ImageActor::New( ResourceImage::New( IMAGES[mIndex] ) ); | |
| 265 | 265 | mCurrentImage.SetPositionInheritanceMode( USE_PARENT_POSITION ); |
| 266 | 266 | mCurrentImage.ApplyConstraint( mImageConstraint ); |
| 267 | 267 | mParent.Add( mCurrentImage ); |
| ... | ... | @@ -298,23 +298,24 @@ void CubeTransitionApp::OnPanGesture( Actor actor, const PanGesture& gesture ) |
| 298 | 298 | |
| 299 | 299 | void CubeTransitionApp::GoToNextImage() |
| 300 | 300 | { |
| 301 | - Image image = Image::New( IMAGES[ mIndex ] ); | |
| 301 | + ResourceImage image = ResourceImage::New( IMAGES[ mIndex ] ); | |
| 302 | 302 | mNextImage = ImageActor::New( image ); |
| 303 | 303 | mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION); |
| 304 | 304 | mNextImage.ApplyConstraint( mImageConstraint ); |
| 305 | 305 | mCurrentEffect.SetTargetImage(mNextImage); |
| 306 | - mIsImageLoading = true; | |
| 307 | 306 | if( image.GetLoadingState() == ResourceLoadingSucceeded ) |
| 308 | 307 | { |
| 309 | - OnImageLoaded( image ); | |
| 308 | + mIsImageLoading = false; | |
| 309 | + OnImageLoaded( image ); | |
| 310 | 310 | } |
| 311 | 311 | else |
| 312 | 312 | { |
| 313 | + mIsImageLoading = true; | |
| 313 | 314 | image.LoadingFinishedSignal().Connect( this, &CubeTransitionApp::OnImageLoaded ); |
| 314 | 315 | } |
| 315 | 316 | } |
| 316 | 317 | |
| 317 | -void CubeTransitionApp::OnImageLoaded(Image image) | |
| 318 | +void CubeTransitionApp::OnImageLoaded(ResourceImage image) | |
| 318 | 319 | { |
| 319 | 320 | mIsImageLoading = false; |
| 320 | 321 | mCurrentEffect.StartTransition( mPanPosition, mPanDisplacement ); | ... | ... |
packaging/com.samsung.dali-demo.spec
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | Name: com.samsung.dali-demo |
| 4 | 4 | Summary: The OpenGLES Canvas Core Demo |
| 5 | -Version: 1.0.29 | |
| 5 | +Version: 1.0.30 | |
| 6 | 6 | Release: 1 |
| 7 | 7 | Group: System/Libraries |
| 8 | 8 | License: Apache-2.0 |
| ... | ... | @@ -52,7 +52,7 @@ LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -fPIC" |
| 52 | 52 | CXXFLAGS+=" -D_ARCH_ARM_" |
| 53 | 53 | %endif |
| 54 | 54 | |
| 55 | -cd %{_builddir}/%{name}-%{version}/build/tizen-cmake && cmake -DDALI_APP_DIR=%{dali_app_ro_dir} . | |
| 55 | +cd %{_builddir}/%{name}-%{version}/build/tizen && cmake -DDALI_APP_DIR=%{dali_app_ro_dir} . | |
| 56 | 56 | |
| 57 | 57 | make %{?jobs:-j%jobs} |
| 58 | 58 | |
| ... | ... | @@ -64,9 +64,6 @@ rm -rf %{buildroot} |
| 64 | 64 | cd build/tizen |
| 65 | 65 | %make_install DALI_APP_DIR=%{dali_app_ro_dir} |
| 66 | 66 | |
| 67 | -mkdir -p %{buildroot}/%{dali_app_exe_dir} | |
| 68 | -mv %{buildroot}/%{_bindir}/* %{buildroot}/%{dali_app_exe_dir} | |
| 69 | - | |
| 70 | 67 | mkdir -p %{buildroot}%{dali_xml_file_dir} |
| 71 | 68 | cp -f %{_builddir}/%{name}-%{version}/%{name}.xml %{buildroot}%{dali_xml_file_dir} |
| 72 | 69 | ... | ... |