User Tag List

Results 1 to 9 of 9

Thread: Ability to scale html5 canvas while keeping aspect ratio

  1. #1
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Burfelt's Avatar
    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    525
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Lightbulb Ability to scale html5 canvas while keeping aspect ratio

    Even though html5 exporter comes with the options "resize display to fill window size" and "Fit inside (black bars)". "Fit inside (black bars)" makes no difference whether on or off.

    It's only possible to resize the to entire size of the browser window, thus not keeping aspect ratio.

    For resizing to have any use, I would like to suggest that a way be added to keep aspect ratio on resizing. It could be made simply by making the "Fit inside (black bars)" work.

    I've tried to work around this with javascript that resizes the canvas (with aspect ratio kept) when window size updates. But unfortunately it breaks hitboxes on objects. They seem to be calculated from the default gamewindow and not current canvas size.

    Putting the html5 canvas in an iframe and scaling that, is not an option for me.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    973
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    If I understand correctly this is something I've been wanting to have as well.

    I did get around this by loading the game from another html file inside an <iframe> tag and from there I can put whatever size I want. Although I used fixed sizes there should be no issue using relative size values as well I believe.

    The catch is that if you click outside the game frame the keyboard will no longer respond to input until you refresh and reload the game. So it's not a great workaround unless your game is mouse controlled only.

    Maybe it's a feature request for the bug box?

  3. #3
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Burfelt's Avatar
    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    525
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Thanks for the input.
    Iframe is not an option for me though and as you also pointed out - It raises other issues like focus and input.

    I'm not sure what has gone wrong with the exporter, and if it perhaps is a bug.

    I found this game made by Olivier.
    http://oliverpearl.com/media/treasures/dZdVJZQKRPpg4kj/

    This does exactly what I want, but I cannot for the life of me create a setup like that in the current runtime? If anyone can (Olivier?) do speak up.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    973
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    It would definitely be interesting to see if this is in fact a bug or if we are just missing something.

  5. #5
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,824
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)
    Lets ask Olivier how he did it

  6. #6
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)
    I'm afraid that yes, you must be missing something Burfelt. I'm just rebuilt my game using the build 285.2 and the scaling whilst keeping the apect ratio worked great. I've also uploaded 2 test apps (source attached), they both use the default HTML file generated by Fusion:
    http://oliverpearl.com/FDmXyHZbg9296...480/index.html
    http://oliverpearl.com/FDmXyHZbg9296...640/index.html

    In these apps ALL the properties are set to default, except the following ones under the Window tab > Options that I have checked:
    - Resize display to fill window size
    - Fit inside (black bars)
    - Anti-aliasing when resizing

    Also I confirm that "Fit inside (black bars)" seems to have no effect.KeepRatio_480x640.mfaKeepRatio_640x480.mfa

  7. #7
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Burfelt's Avatar
    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    525
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Hi Olivier,

    Thanks for your answer.

    The links to oliverpearl.com you post works great and as intended when I test them in my browsers.

    I was using your options but they do not work, and I have tried again without success.
    I've have double checked that I'm on build 285.2 and it says it's up to date when I check for updates.

    The 2 mfa you include, I have tried to build, but they do not keep aspect ratio at all..

    Finally I have found the latest html5 installer version (Build 283.5 it seems) and installed that manually, but that also fails to correct the problem.

    Seeing as your uploaded creations work in my browsers. It must be my setup here. But I cannot see that it should be any different from yours?


  8. #8
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)
    That's weird. I suggest to reinstall the Fusion Build 285.2 or 285.3, doing this will also update all your installed exporters:
    http://community.clickteam.com/threads/84521

    You shouldn't need to use an installer specific to an exporter, except for the first installation of said exporter.

  9. #9
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Burfelt's Avatar
    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    525
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I reinstalled Fusion. It works now - thanks for the help!

Similar Threads

  1. Replies: 12
    Last Post: 4th February 2016, 11:33 PM
  2. Resolution like 780 x 520 with the same aspect ratio
    By iamjot in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 25th May 2014, 06:29 PM
  3. Keeping Aspect Ratio
    By Game_Master in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 24th May 2009, 08:26 PM
  4. aspect ratio question
    By Golds in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th September 2008, 05:15 AM
  5. Ratio Aspect Stretching
    By BrandonC in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 11th May 2008, 11:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •