Hello, I'm encountering some issues with my app.
I'm actually building a map with point of interests over it for a 2D application. I'm aiming to keep the POI on the same spot and at the same size whether I'm zooming or moving the map. The POI are set on a world canvas as they are UI Buttons, which opens information UI-Popup and my map is a 2D Sprite. I tried two ways. **First way **
Organizing my map like this :
**-->MapContainer**
----->MyMap
----->CanvasMapRessources
--------->POI
Using this method, I can move the map and zoom, the POI will stay approximately in the field where they were set and at the same size. So while zooming, I only re-scale "MyMap" and while moving the map I act on the "MapContainer". The POI are set on the CanvasMapRessources. **Second way,**
**-->MapContainer**
----->MyMap
---------->CanvasMapRessources
-------------->POI
CanvasMapRessources is a child under "MyMap"
Effect : The POI behaves as expected, they keep the exact position they are set on, but they are re-scaled. So, in order to continue, I need to know if I can get the new size of the canvas rescaled by it's parent (the map). I already tried to get the new scale using the sizeDelta of the canvas, it's lossyscale or localscale, but it looks like even though it has been rescaled it hasn't. At least that's what the values are telling. As a unity beginner, I thank you in advance.
I'm actually building a map with point of interests over it for a 2D application. I'm aiming to keep the POI on the same spot and at the same size whether I'm zooming or moving the map. The POI are set on a world canvas as they are UI Buttons, which opens information UI-Popup and my map is a 2D Sprite. I tried two ways. **First way **
Organizing my map like this :
**-->MapContainer**
----->MyMap
----->CanvasMapRessources
--------->POI
Using this method, I can move the map and zoom, the POI will stay approximately in the field where they were set and at the same size. So while zooming, I only re-scale "MyMap" and while moving the map I act on the "MapContainer". The POI are set on the CanvasMapRessources. **Second way,**
**-->MapContainer**
----->MyMap
---------->CanvasMapRessources
-------------->POI
CanvasMapRessources is a child under "MyMap"
Effect : The POI behaves as expected, they keep the exact position they are set on, but they are re-scaled. So, in order to continue, I need to know if I can get the new size of the canvas rescaled by it's parent (the map). I already tried to get the new scale using the sizeDelta of the canvas, it's lossyscale or localscale, but it looks like even though it has been rescaled it hasn't. At least that's what the values are telling. As a unity beginner, I thank you in advance.