All apologies, yes always use SetDisplayAspect(-1) that fills the screen. That's what you want. (I shouldn't have answered so late)
Behdad - you need to think through your calculations a bit more.
If GetDeviceWidth = 800 then you divide by 800 you get 1, multiply that by 100 and you get... 100... so your W# = 100 percent of the screen... Also your saying you want a width of 1200 but then trying to use 800 in your calculation. Also I'd suggest always operating on floats with floats. So W# = 100.0 * GetDeviceWidth() / 1200.0. But I'm not sure what you're trying to accomplish with these.
If you want a single pixel width and pixel height then you'd use something like this:
pixel_W# = 100.0 * 1.0 / GetDeviceWidth()
pixel_H# = 100.0 * 1.0 / GetDeviceHeight()
Those read 1 pixel out of the total width times 100 to convert to a percentage.
Those may be useful to you.
Here's what it should be:
rem Landscape App
SetDisplayAspect(-1)
//this is way wrong
//spr = CreateSprite(0) // returns spr = 10001
//LoadImage (spr, "apple.png") // now you're assigning the image to IMAGE ID 10001
//image IDs and sprite IDs are completely different!
//should be this - you just had a blank texture sprite
image = LoadImage("apple.png")
spr = CreateSprite(image)
//setting the sprite to 100% x 100%??
//SetSpriteSize (spr, W#, H#)
// offsets always start in the center - no need for something like this - especially if you're not using SetSpritePositionByOffset!
//SetSpriteOffset (spr,W#/2,H#/2)
//So now you did have a big white sprite, but you moved it off screen to coordinate
// of x = 200% and y = 400%...
//SetSpritePosition ( spr, 200, 400 )
//should have been
//I'm assuming you want the sprite to be 512 pixels wide when at resolution 1200x800
spr_w# = 100.0 * 512.0 / 1200.0
//that's the percent at 1200 pixels - i.e. about 50% on ALL screen sizes.
SetSpriteSize(spr , spr_w# , -1) //use -1 to automatically calculate the correct height of the sprite based on the image's dimensions. Super easy.
SetSpritePositionByOffset(spr , 50.0 , 50.0) //x and y = 50 percent of screen - i.e. center
//OR
SetSpritePosition(spr , 50.0 - 0.5 * spr_w# , 50.0 - 0.5 * GetSpriteHeight(spr))
rem A Wizard Did It!
do
Print("hello world")
Sync()
loop
You need to think percentages. They're really easy, 100% is the right/bottom, 50% is the center, etc.
If you make a layout mockup in Photoshop of a 1200x800 image to position your images to see what they will look like you can also set Photoshop's rulers to percent and simply ready the coordinates.