Jump to content

melonJS 6.4.0


obiot
 Share

Recommended Posts

Hello, shortly after the Chinese new year, here is a new release of melonJS,

High-Level Changes :

  • New documentation format, including a better, more modern, layout and search feature. http://melonjs.github.io/melonJS/docs/index.html 
  • Support for Multiple Texture Packer Textures
  • Added Colour Tint support for Renderable (WebGL mode only for now)
  • Bunch of small fix and improvements on Renderable,  Animations, Isometric rendering, and System renderers

See here for a more detailed changelog, there is no API change this time (just some internal re-factoring), so you can safely upgrade without breaking your game :)

Have fun guys, and let us know what you think about the new documentation ! (it certainly can be further tweaked/improved)

--- the melonJS team 

Link to comment
Share on other sites

  • 3 weeks later...

Yes I agree, I found scaling the individual sprites difficult when I wanted manual control over the scaling.  I created my own Image Renderable class to solve the problem.  For me It may have been an issue with not fully understanding the scaling implementation.

 

here's an example of my scaling function that probably describes what sistem wants... However, I have the me.video autoscale to false when I use it.  (this object is a me.Renderable not a me.Sprite FYI)

scale: function(scaleFactor /* <1 width is scaled, otherwise > 0 width is set*/)
        {
            if (scaleFactor > 0 && scaleFactor < 1) {
                this.width = this.image.naturalWidth * scaleFactor;
                this.height = this.image.naturalHeight * this.width / this.image.naturalWidth; // preserves aspect ratio
            }
            else if (scaleFactor > 1)
            {
                this.width = scaleFactor;
                this.height = this.image.naturalHeight * this.width / this.image.naturalWidth; // preserves aspect ratio
            }
            else if (scaleFactor === 1) { // unscale
                this.width = this.image.naturalWidth;
                this.height = this.image.naturalHeight;
            }
            this.updated = true;
        }

 

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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