Hi,
Trying to do something incredibly simple. I just want to put a rectangle on each side of the screen for use with physics. The app is set to zoomEven
.
I have tried every display parameter on the list, but cannot get a consistant result. Hopefully someone can enlighten me.
This is my final code before giving up. The left and top are working fine, but the right, bottom is a severe pain in my rear.
local side_box_width = 120
local side_box_height = 0 --will come from screen size
local top_bottom_box_width = 0 --will come from screen size
local top_bottom_box_height = 120
-- Create a vector rectangle sized exactly to the "screen area"
local area = display.newRect(
display.screenOriginX,
display.screenOriginY,
display.contentWidth,
display.contentHeight
)
print(area.x, area.y, area.width, area.height)
area.isVisible = false
local left_box = display.newRect(area.x, area.y, side_box_width, area.height)
local right_box = display.newRect(area.width, area.y, side_box_width, area.height)
local top_box = display.newRect(area.x, area.y, area.width, top_bottom_box_height)
local bottom_box = display.newRect(area.x, area.height, area.width, top_bottom_box_height)
Note: They are not centered at the moment, but that is intentional for the testing.
Config snippet:
width = 640,
height = 960,
scale = "zoomEven",
Thanks in advance for any tips.
-dev