--Set vars imageWidthNew = tileSize * mapData.gridW * scale imageHeightOld = tileSize * mapData.gridH * mapGrp.yScale imageHeightNew = tileSize * mapData.gridH * scale screenWidth = 480 screenHeight = 320 --Get a number between 0 and 1 based position within bounds pX = mapGrp.x / (imageWidthOld - screenWidth) pY = mapGrp.y / (imageHeightOld - screenHeight) --Set New Position mapGrp.x = -pX * (screenWidth - imageWidthNew) mapGrp.x = -pY * (screenHeight - imageHeightNew)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)