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 | 211 | mDesiredBox.SetParentOrigin( ParentOrigin::CENTER ); |
| 212 | 212 | mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER ); |
| 213 | 213 | mDesiredBox.SetPosition( 0, 0, -1 ); |
| 214 | + mDesiredBox.SetSortModifier(4.f); | |
| 214 | 215 | |
| 215 | 216 | mHeightBox.SetSize( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height ); |
| 216 | 217 | mHeightBox.SetParentOrigin( ParentOrigin::CENTER ); |
| 217 | 218 | mHeightBox.SetAnchorPoint( AnchorPoint::CENTER ); |
| 218 | 219 | mHeightBox.SetPosition( 0, 0, -1 ); |
| 220 | + mHeightBox.SetSortModifier(3.f); | |
| 219 | 221 | |
| 220 | 222 | mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height ); |
| 221 | 223 | mWidthBox.SetParentOrigin( ParentOrigin::CENTER ); |
| 222 | 224 | mWidthBox.SetAnchorPoint( AnchorPoint::CENTER ); |
| 223 | 225 | mWidthBox.SetPosition( 0, 0, -1 ); |
| 226 | + mWidthBox.SetSortModifier(2.f); | |
| 224 | 227 | |
| 225 | 228 | // Make a grab-handle for resizing the image: |
| 226 | 229 | mGrabCorner = Toolkit::PushButton::New(); |
| ... | ... | @@ -233,9 +236,14 @@ public: |
| 233 | 236 | mGrabCorner.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); |
| 234 | 237 | mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); |
| 235 | 238 | mGrabCorner.SetSize( Vector2( stage.GetSize().width*0.08f, stage.GetSize().width*0.08f ) ); |
| 236 | - mGrabCorner.SetZ( 1.0f ); | |
| 237 | 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 | 247 | mPanGestureDetector = PanGestureDetector::New(); |
| 240 | 248 | mPanGestureDetector.Attach( mGrabCorner ); |
| 241 | 249 | mPanGestureDetector.DetectedSignal().Connect( this, &ImageScalingAndFilteringController::OnPan ); |
| ... | ... | @@ -246,6 +254,7 @@ public: |
| 246 | 254 | // Reposition the actor |
| 247 | 255 | mImageActor.SetParentOrigin( ParentOrigin::CENTER ); |
| 248 | 256 | mImageActor.SetAnchorPoint( AnchorPoint::CENTER ); |
| 257 | + mImageActor.SetSortModifier(5.f); | |
| 249 | 258 | |
| 250 | 259 | // Display the actor on the stage |
| 251 | 260 | stage.Add( mImageActor ); |
| ... | ... | @@ -700,9 +709,9 @@ private: |
| 700 | 709 | |
| 701 | 710 | private: |
| 702 | 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 | 715 | Toolkit::PushButton mFittingModeButton; |
| 707 | 716 | Toolkit::PushButton mSamplingModeButton; |
| 708 | 717 | Toolkit::Popup mPopup; | ... | ... |
examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp
| ... | ... | @@ -167,6 +167,7 @@ public: |
| 167 | 167 | // Setup |
| 168 | 168 | mView.SetPosition(Vector3(0.0f, 0.0f, -50)); |
| 169 | 169 | |
| 170 | + mContents.SetBehavior(Layer::LAYER_3D); | |
| 170 | 171 | mContents.SetPosition(mTranslation); |
| 171 | 172 | mContents.SetOrientation( CalculateWorldRotation( mSceneXRotation, mSceneYRotation ) ); |
| 172 | 173 | mContents.SetScale(mPinchScale, mPinchScale, mPinchScale); | ... | ... |