How do you display something at the top of a screen

If you wanted to display an ad at the top of the screen, how would you do it?

pretty vague but simply just set the y value of the object

example: youradobject.y = somevalue

Would the ad be at the top of the screen on all android device, if I set the y value at 0?

depends on your config setup and how you are scaling and if your anchors are set for center or top/left etc. and so forth.

if default then i would imagine something like

object.y = (object.contentHeight * .5)

would probably work you just need to goof around with it and jump between different simulators under the “view”->“view as” option.

90% of ui is simply just changing a value and refreshing the window :slight_smile:

how do you set your anchors for center? thanks

Default is center, you can read more about it here.

http://docs.coronalabs.com/guide/graphics/transform-anchor.html

thanks

pretty vague but simply just set the y value of the object

example: youradobject.y = somevalue

Would the ad be at the top of the screen on all android device, if I set the y value at 0?

depends on your config setup and how you are scaling and if your anchors are set for center or top/left etc. and so forth.

if default then i would imagine something like

object.y = (object.contentHeight * .5)

would probably work you just need to goof around with it and jump between different simulators under the “view”->“view as” option.

90% of ui is simply just changing a value and refreshing the window :slight_smile:

how do you set your anchors for center? thanks

Default is center, you can read more about it here.

http://docs.coronalabs.com/guide/graphics/transform-anchor.html

thanks