Jump to content

Fill a shape (ellipse) with a gradient


Recommended Posts

Hi, I am facing a problem that I can't seem to find a solution online.

I have a basic game app with an ellipse that goes up and down automatically. What I try to accomplish is to have a gradient that fills the background and another that fills the ellipse. It is mostly for cosmetic purposes, but it is to fit the overall style I am looking for. I wanted to join an image of the style I am looking for, but there's a bug on the forum that prevents me from doing it. Sorry.

I basically created my ellipse as a shape, but I can't seem to find how to add more than a flat color. How can I create a gradient to fill shapes? 

this.ellipse = this.add.ellipse(game.config.width / 2game.config.height / 2sizesize, color);
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...