Sign in to follow this  

Scaling loading bar not works correctly

Recommended Posts

Bowmasters.Preloader = function(game){


Bowmasters.Preloader.prototype = {
    preload: function() {
        let logo = this.add.sprite( -120, - 100, 'logo').scale.setTo(scaleRatio, scaleRatio);

        let bar = this.add.sprite(,, 'bar');

        bar.scale.setTo(scaleRatio, scaleRatio);

        //without next line loading sprite looks good, not cropped

        this.load.image('background', 'assets/Resources/BG/bm_bg.png');
        this.load.image('ground', 'assets/Resources/BG/bm_ground.png');
        this.load.image('icon_thor', 'assets/Resources/UI/icon_thor_odinson.png');
        this.load.image('icon_loki', 'assets/Resources/UI/icon_upgrade_loki.png');

    create: function() {



this.load.setPreloadSprite(bar)   sprite looks good.



After using bar.scale.setTo it becomes like:



This is my code, i am gonna to create loadind scene but i have a problem with loading bar. This was too big, and when i try to scale it becomes cropped  as on the screenshots. Give me the hint please how to repair it.

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.