Another way of creating display objects is using vector objects. You can use vector objects to create shapes, such as a rectangle, rounded rectangle, and circle by using the following:
display.newRect( [parentGroup,] left, top, width, height )
creates a rectangle usingwidth
byheight
. Location starts from the top-left corner of the device screen usingleft
andtop
as your coordinates of placement.display.newRoundedRect( [parentGroup,] left, top, width, height, cornerRadius )
creates a rounded rectangle usingwidth
byheight
. Location starts from the top-left corner of the device screen usingleft
andtop
as your coordinates of placement. Rounding off the corners usescornerRadius
.display.newCircle( [parentGroup,] xCenter, yCenter, radius )
creates a circle usingradius
centered atxCenter
,yCenter
.