QuestionEverything
QuestionEverything

Reputation: 65

How to add an image in display.newCircle() in corona SDK

I want to change the color of a circle with a custom image. Is it possible to do so?

Upvotes: 0

Views: 559

Answers (1)

ldurniat
ldurniat

Reputation: 1702

Yes it is possible. Try

-- Create a vector rectangle
local circle = display.newCircle( 200, 200, 300 )

-- Set the fill (paint) to use the bitmap image
local paint = {
    type = "image",
    filename = "texture1.png"
}

-- Fill the circle
circle.fill = paint

More information you can find in documentation.

Upvotes: 2

Related Questions