[GCompris-devel] Scaling images based on screen size

Bruno Coudoin bruno.coudoin at gcompris.net
Tue Dec 2 08:38:41 UTC 2014


Le 02/12/2014 07:35, amit tomar a écrit :
> Is there a standard way this is handled in GCompris? Any particular 
> activity I could look into the code of which to get an idea ?
Hi,

You are getting close. There are many activities in GCompris having the 
same need. In fact it is quiet simple. You just have to set 
sourceSize.width _or_ sourceSize.height and the ratio of the image will 
be kept. You can then play with a Math.min and max to keep the image 
into reasonable size.

Bruno.





More information about the GCompris-devel mailing list