Simply want to put an object in the bottom right corner of a screen regardless of device.

So I thought this was simple, but I can’t figure it out. For starters, I’m in landscape mode and I want a button to always be in the bottom right corner of the screen. But to no avail. Even when doing actualContent, and viewableContent, pixelHeight it just doesn’t want to work for me. 

Here’s a link to a picture of it on the simulator. Anchor is set to (1,1) so in the bottom corner but it still doesn’t sit in the bottom-most corner (black border). The white box above it is a textbox that itself is supposed to span the entire contentWidth of the device

http://imgur.com/y40d4CJ

Any help is much appreciated!

below is when doing iphone6 corona simulator build (750x1334)

[lua]

local testImage7 = display.newImage (“TabBarColor>>FinalBoldGreenGoldAlt.png”)

testImage7.height = display.actualContentHeight/8

testImage7.width = display.actualContentHeight/8   – Using actual content Height for both b/c different screens have different heights and widths 

testImage7.anchorX = 1

testImage7.anchorY = 1

–testImage7.x = display.actualContentWidth/2

testImage7.x = display.contentWidth/1

–testImage7.x = display.viewableContentWidth

–testImage7.x = display.pixelHeight/1      — Height b/c default is portrait mode for pixelHeight

testImage7.y = display.contentHeight/1.02

print (display.contentWidth…“contentWidth”)

print (display.contentHeight…“contentHeight”)

print (display.actualContentWidth…“actualContentWidth”)

print (display.actualContentHeight…“actualContentHeight”)

print (display.viewableContentWidth…“viewableContentWidth”)

print (display.viewableContentHeight…“viewableContentHeight”)

print (display.pixelWidth…“pixelWidth”)

print (display.pixelHeight…“pixelHeight”)

[/lua]

terminal:

[lua]

Jun 16 18:46:59.706: 480contentWidth

Jun 16 18:46:59.706: 320contentHeight

Jun 16 18:46:59.706: 569.17333984375actualContentWidth

Jun 16 18:46:59.706: 320actualContentHeight

Jun 16 18:46:59.706: 480viewableContentWidth

Jun 16 18:46:59.706: 320viewableContentHeight

Jun 16 18:46:59.706: 750pixelWidth

Jun 16 18:46:59.706: 1334pixelHeight

[/lua]

Try this:

local scale0= ((display.actualContentWidth- display.contentWidth)\*.5) local scale0Y= ((display.actualContentHeight- display.contentHeight)\*.5) local myBox = display.newRect( 0, 0, 50, 50 ) myBox.x, myBox.y = (display.actualContentWidth- (myBox.width\*.5)) - scale0, (display.actualContentHeight-(myBox.height\*.5))-scale0Y

Hi.  I’ve answered a lot of questions here, including this one (or one very similar). 

Download this an answer and it should help you achieve your goal for this issue:

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/10/lgg4.zip

lgg4.png

Later, please look at AskEd under my Free Stuff repository for other interesting stuff:

http://github.com/roaminggamer/RG_FreeStuff

Try this:

local scale0= ((display.actualContentWidth- display.contentWidth)\*.5) local scale0Y= ((display.actualContentHeight- display.contentHeight)\*.5) local myBox = display.newRect( 0, 0, 50, 50 ) myBox.x, myBox.y = (display.actualContentWidth- (myBox.width\*.5)) - scale0, (display.actualContentHeight-(myBox.height\*.5))-scale0Y

Hi.  I’ve answered a lot of questions here, including this one (or one very similar). 

Download this an answer and it should help you achieve your goal for this issue:

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/10/lgg4.zip

lgg4.png

Later, please look at AskEd under my Free Stuff repository for other interesting stuff:

http://github.com/roaminggamer/RG_FreeStuff