Forum Libraries, Components, and Plugins
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

What's the correct way to implement pinch/pull zoom on a CCTileMap?

I apologise if there is an obvious answer, but I'm new to CocosSharp and Xamarin in general! - Lots of programming experience so I'm certainly not a total newb!

I've currently got it sort of working by recreating the camera each time the user pinches or pulls out, which while it works, there must be a better way to implement it than recreating the camera object thousands of times.

TIA.

Tagged:

Answers

  • RamiTabbaraRamiTabbara AUMember, Xamarin Team Xamurai

    Hi Steve,

    Probably the simplest way to achieve this is to alter the scale of the corresponding CCTileMap.TileLayersContainer i.e.

    
    CCTileMap tileMap;
    
    // Initialise map
    // ...
    
    // Within touch event method
    
    float newScale;
    
    // Find new scale
    
    tileMap.TileLayersContainer.Scale = newScale;
    
    
    
  • SteveChildsSteveChilds USMember

    Cheers for that Rami, I'm sure I tried that, but it was saying that Scale didn't have a setter. It was a few days ago though, I could be wrong. I'll give it a try later.

Sign In or Register to comment.