Game Development Reference
In-Depth Information
Tiling a background using a filled shape
With this example, if the rectangle were larger, we would see the image surrounded by blank space.
But Gideros Studio also has an option for tiling images in the background. To use this feature, we
simply modify the line in which we load our texture to the following:
local img = Texture.new(imgName, false, {wrap=Texture.REPEAT})
Now we can try the same with this example:
newImgRectangle(10, 10, 220, 220, 1, nil, "myImage2.png")
We can even create complete background images, like so:
newImgRectangle(0,0,application:getDeviceWidth(),application:getDeviceWidth(), 0, nil, "tile.png")
Drawing Other Shapes
Because Gideros Studio offers the user a canvas to draw any shape, there are no built-in API
functions for lines, rectangles, circles, or arcs. However, you can use moveTo and lineTo to draw any
shape you want. This allows you to create your own Bezier curves, arcs, ovals, circles, and so on.
 
Search WWH ::




Custom Search