Commit b8abf2a0097b3545815a5bd31eeb45fdc76ffa4b
1 parent
53d36e45
Fixes for demos following change of default behaviour in Layer.
Change-Id: I5757490feb24c9cd1e6eee38139fbae848f0255a
Showing
2 changed files
with
15 additions
and
5 deletions
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
| @@ -211,16 +211,19 @@ public: | @@ -211,16 +211,19 @@ public: | ||
| 211 | mDesiredBox.SetParentOrigin( ParentOrigin::CENTER ); | 211 | mDesiredBox.SetParentOrigin( ParentOrigin::CENTER ); |
| 212 | mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER ); | 212 | mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER ); |
| 213 | mDesiredBox.SetPosition( 0, 0, -1 ); | 213 | mDesiredBox.SetPosition( 0, 0, -1 ); |
| 214 | + mDesiredBox.SetSortModifier(4.f); | ||
| 214 | 215 | ||
| 215 | mHeightBox.SetSize( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height ); | 216 | mHeightBox.SetSize( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height ); |
| 216 | mHeightBox.SetParentOrigin( ParentOrigin::CENTER ); | 217 | mHeightBox.SetParentOrigin( ParentOrigin::CENTER ); |
| 217 | mHeightBox.SetAnchorPoint( AnchorPoint::CENTER ); | 218 | mHeightBox.SetAnchorPoint( AnchorPoint::CENTER ); |
| 218 | mHeightBox.SetPosition( 0, 0, -1 ); | 219 | mHeightBox.SetPosition( 0, 0, -1 ); |
| 220 | + mHeightBox.SetSortModifier(3.f); | ||
| 219 | 221 | ||
| 220 | mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height ); | 222 | mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height ); |
| 221 | mWidthBox.SetParentOrigin( ParentOrigin::CENTER ); | 223 | mWidthBox.SetParentOrigin( ParentOrigin::CENTER ); |
| 222 | mWidthBox.SetAnchorPoint( AnchorPoint::CENTER ); | 224 | mWidthBox.SetAnchorPoint( AnchorPoint::CENTER ); |
| 223 | mWidthBox.SetPosition( 0, 0, -1 ); | 225 | mWidthBox.SetPosition( 0, 0, -1 ); |
| 226 | + mWidthBox.SetSortModifier(2.f); | ||
| 224 | 227 | ||
| 225 | // Make a grab-handle for resizing the image: | 228 | // Make a grab-handle for resizing the image: |
| 226 | mGrabCorner = Toolkit::PushButton::New(); | 229 | mGrabCorner = Toolkit::PushButton::New(); |
| @@ -233,9 +236,14 @@ public: | @@ -233,9 +236,14 @@ public: | ||
| 233 | mGrabCorner.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); | 236 | mGrabCorner.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); |
| 234 | mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); | 237 | mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); |
| 235 | mGrabCorner.SetSize( Vector2( stage.GetSize().width*0.08f, stage.GetSize().width*0.08f ) ); | 238 | mGrabCorner.SetSize( Vector2( stage.GetSize().width*0.08f, stage.GetSize().width*0.08f ) ); |
| 236 | - mGrabCorner.SetZ( 1.0f ); | ||
| 237 | mGrabCorner.SetOpacity( 0.6f ); | 239 | mGrabCorner.SetOpacity( 0.6f ); |
| 238 | - mDesiredBox.Add( mGrabCorner ); | 240 | + |
| 241 | + Layer grabCornerLayer = Layer::New(); | ||
| 242 | + grabCornerLayer.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); | ||
| 243 | + grabCornerLayer.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); | ||
| 244 | + | ||
| 245 | + grabCornerLayer.Add( mGrabCorner ); | ||
| 246 | + mDesiredBox.Add( grabCornerLayer ); | ||
| 239 | mPanGestureDetector = PanGestureDetector::New(); | 247 | mPanGestureDetector = PanGestureDetector::New(); |
| 240 | mPanGestureDetector.Attach( mGrabCorner ); | 248 | mPanGestureDetector.Attach( mGrabCorner ); |
| 241 | mPanGestureDetector.DetectedSignal().Connect( this, &ImageScalingAndFilteringController::OnPan ); | 249 | mPanGestureDetector.DetectedSignal().Connect( this, &ImageScalingAndFilteringController::OnPan ); |
| @@ -246,6 +254,7 @@ public: | @@ -246,6 +254,7 @@ public: | ||
| 246 | // Reposition the actor | 254 | // Reposition the actor |
| 247 | mImageActor.SetParentOrigin( ParentOrigin::CENTER ); | 255 | mImageActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 248 | mImageActor.SetAnchorPoint( AnchorPoint::CENTER ); | 256 | mImageActor.SetAnchorPoint( AnchorPoint::CENTER ); |
| 257 | + mImageActor.SetSortModifier(5.f); | ||
| 249 | 258 | ||
| 250 | // Display the actor on the stage | 259 | // Display the actor on the stage |
| 251 | stage.Add( mImageActor ); | 260 | stage.Add( mImageActor ); |
| @@ -700,9 +709,9 @@ private: | @@ -700,9 +709,9 @@ private: | ||
| 700 | 709 | ||
| 701 | private: | 710 | private: |
| 702 | Application& mApplication; | 711 | Application& mApplication; |
| 703 | - Actor mDesiredBox; //< Background rectangle to show requested image size. | ||
| 704 | - Actor mHeightBox; //< Background horizontal stripe to show requested image height. | ||
| 705 | - Actor mWidthBox; //< Background vertical stripe to show requested image width. | 712 | + ImageActor mDesiredBox; //< Background rectangle to show requested image size. |
| 713 | + ImageActor mHeightBox; //< Background horizontal stripe to show requested image height. | ||
| 714 | + ImageActor mWidthBox; //< Background vertical stripe to show requested image width. | ||
| 706 | Toolkit::PushButton mFittingModeButton; | 715 | Toolkit::PushButton mFittingModeButton; |
| 707 | Toolkit::PushButton mSamplingModeButton; | 716 | Toolkit::PushButton mSamplingModeButton; |
| 708 | Toolkit::Popup mPopup; | 717 | Toolkit::Popup mPopup; |
examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp
| @@ -167,6 +167,7 @@ public: | @@ -167,6 +167,7 @@ public: | ||
| 167 | // Setup | 167 | // Setup |
| 168 | mView.SetPosition(Vector3(0.0f, 0.0f, -50)); | 168 | mView.SetPosition(Vector3(0.0f, 0.0f, -50)); |
| 169 | 169 | ||
| 170 | + mContents.SetBehavior(Layer::LAYER_3D); | ||
| 170 | mContents.SetPosition(mTranslation); | 171 | mContents.SetPosition(mTranslation); |
| 171 | mContents.SetOrientation( CalculateWorldRotation( mSceneXRotation, mSceneYRotation ) ); | 172 | mContents.SetOrientation( CalculateWorldRotation( mSceneXRotation, mSceneYRotation ) ); |
| 172 | mContents.SetScale(mPinchScale, mPinchScale, mPinchScale); | 173 | mContents.SetScale(mPinchScale, mPinchScale, mPinchScale); |