shvalb

Creating a Progress bar using sprite.scale

Recommended Posts

Hi guys,

I'm trying to create a progress bar.
I have 2 images:
1. Black frame
2. The bar itself which is a linear horizontal gradient (or something close to that).

Because I'm trying to keep the gradient effect I'm not using a mask but a scaling the bar itself from zero to 1.

Here is how it looks:
https://demo-project-shvalb.c9users.io/Phaser.io/index.html

If you pay close attention to the first 5 seconds at the left of the scrollbar you see that it starts outside of the frame and fixes itself afterwards.

I'm trying to fix this problem by using a BitmapData.alphaMask, just cutting a mask from the bg image. but it doesn't work.

If someone has an idea, please share...

Thanks!

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.