My app is meant for landscape and it's already setup to force landscape mode. I have an image of 400 x 400 and I want to split it up by 16 pieces (100x100 pixels). When user holds phone portrait mode it splits the image sizes up correctly. When user holds phone landscape mode it doesn't resize it correctly and so I'm getting 16 pieces 100x100 pixels.
Is it possible to always split up the 16 pieces to the same size regardless if users hold phone portrait or landscape?
Below is the code I'm using.
if GetSpriteExists(sprJigsawPuzzleID[0]) then DeleteSprite(sprJigsawPuzzleID[0])
if GetImageExists(imgJigsawPuzzleID)then DeleteImage(imgJigsawPuzzleID)
imgJigsawPuzzleID = LoadImage(imgName)
sprJigsawPuzzleID[0] = CreateSprite(imgJigsawPuzzleID)
ClearScreen()
DrawSprite(sprJigsawPuzzleID[0])
SetSpritePosition(sprJigsawPuzzleID[0],0,0)
SetSpriteDepth(sprJigsawPuzzleID[0],0)
Render()
//create jigsaw outline
if GetImageExists(imgJigsawOutlineID) = 0 then imgJigsawOutlineID = LoadImage("jigsaw_outline.png")
//splice jigsaw image apart and store it into sprites
sprID as integer = 1
size as integer = 100
for j = 1 to 4
for i = 1 to 4
xPosition = (i - 1) * size
yPosition = (j - 1) * size
if GetSpriteExists(sprJigsawOutlineID[sprID]) = 0 then sprJigsawOutlineID[sprID] = CreateSprite(imgJigsawOutlineID)
sprJigsawPuzzleID[sprID] = CreateSprite(GetImage(xPosition, yPosition, size, size))
SetSpriteDepth(sprJigsawPuzzleID[sprID], 5)
inc sprID, 1
next i
next j