Forum Libraries, Components, and Plugins

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.




  • 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.