User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 20 of 20

Thread: "resize display to fill window size" and sharpness in html5!?

  1. #11
    Clicker Fusion 2.5
    Gigatron's Avatar
    Join Date
    Jun 2020
    Location
    France
    Posts
    50
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by CruddyBuddy View Post
    Do you know where you bought the resizing script? I would pay for something like that. The apps I work with are published on client websites, not game websites, so I would need something I can use to edit the index.html.
    Try this code to play with an old source ;

    Code:
    (function resizeGame() {
        var gameArea = document.getElementById('MMFCanvas');
        var widthToHeight = window.innerWidth / window.innerHeight; // OR 4/3 ratio  or 6.4/4.8 if you have 640*480
        var newWidth = window.innerWidth;
        var newHeight = window.innerHeight;
        var newWidthToHeight = newWidth / newHeight;
    
        if (newWidthToHeight > widthToHeight) {
            newWidth = newHeight * widthToHeight;
            gameArea.style.height = newHeight + 'px';
            gameArea.style.width = newWidth + 'px';
        } else {
            newHeight = newWidth / widthToHeight;
            gameArea.style.width = newWidth + 'px';
            gameArea.style.height = newHeight + 'px';
        }
     
     
    
    window.addEventListener('resize', resizeGame, false);
    window.addEventListener('orientationchange', resizeGame, false);
    })();
    This code is self run code this mean it's running it self; the canvas element MMFCanvas is just under body not on MMFDiv;

  2. #12
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    CruddyBuddy's Avatar
    Join Date
    May 2010
    Posts
    169
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Gigatron View Post
    Try this code to play with an old source ;


    This code is self run code this mean it's running it self; the canvas element MMFCanvas is just under body not on MMFDiv;
    I appreciate the suggestion. Unfortunately it doesn't affect the edit objects the way it does the strings and graphics.

    Original size:
    edit_object_before.jpg

    Changed browser window size:
    edit_object_after.jpg

  3. #13
    Clicker Fusion 2.5
    Gigatron's Avatar
    Join Date
    Jun 2020
    Location
    France
    Posts
    50
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by CruddyBuddy View Post
    I appreciate the suggestion. Unfortunately it doesn't affect the edit objects the way it does the strings and graphics.

    Original size:
    edit_object_before.jpg

    Changed browser window size:
    edit_object_after.jpg
    Sure , the button or edit text are not canvas elements but there are in <div> element ... i will check this ;

  4. #14
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    janpier's Avatar
    Join Date
    Dec 2014
    Posts
    218
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by CruddyBuddy View Post
    Do you know where you bought the resizing script? I would pay for something like that. The apps I work with are published on client websites, not game websites, so I would need something I can use to edit the index.html.
    this is a script for sites, I don't think the code is the same for the game, although it could be, unfortunately I deleted the site

  5. #15
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)SWF Export Module (Steam)Firefly 3D Module (Steam)

    Join Date
    Feb 2017
    Posts
    394
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    I think this issue should be solved by the designer of this exporter not by the enduser.

  6. #16
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    CruddyBuddy's Avatar
    Join Date
    May 2010
    Posts
    169
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Manuel View Post
    I think this issue should be solved by the designer of this exporter not by the enduser.
    I agree. The more time I spend on this, the more I realize it's something that needs to be corrected in the exporter. Not to mention the buttons and edit objects are all messed up as well.

  7. #17

  8. #18
    Clicker Fusion 2.5
    Gigatron's Avatar
    Join Date
    Jun 2020
    Location
    France
    Posts
    50
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    @CruddyBuddy , i am sure you will like the latest script i've sent

  9. #19
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)SWF Export Module (Steam)Firefly 3D Module (Steam)

    Join Date
    Feb 2017
    Posts
    394
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Hello @Yves , you had already time to look into this issue?

  10. #20
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)SWF Export Module (Steam)Firefly 3D Module (Steam)

    Join Date
    Feb 2017
    Posts
    394
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    I think i know already what is the issue, but i dont know how to fully solve it. Basically the exporter has a check for "window.devicePixelRatio" missing so it does not know what going on.

    If i add code like this

    document.getElementById('MMFCanvas').style.width = 1080 + "px";
    document.getElementById('MMFCanvas').style.height = 1920 + "px";

    document.getElementById('MMFCanvas').width = Math.floor(1080 * window.devicePixelRatio);
    document.getElementById('MMFCanvas').height = Math.floor(1920 * window.devicePixelRatio);

    this._context.scale(sx * window.devicePixelRatio, sy * window.devicePixelRatio);

    to the setScale function in StandartRenderer.js than it works good at 100% browser scale and above, it always stays sharp and crisp, below 100% does not work shrinks the canvas.

    If somebody knows more about canvas scaling help me please lol
    Attached files Attached files

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Replies: 0
    Last Post: 19th February 2016, 12:14 AM
  2. Toggle "Resize display to fill window size" in game (Need help!)
    By fishrod in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 7th January 2014, 02:30 PM
  3. Window size? Or "smart resize display to fill?"
    By Bipolar_Games in forum Android Export Module Version 2.0
    Replies: 4
    Last Post: 29th August 2012, 09:55 PM
  4. "Resize display to fill window size" doesn't work.
    By ASD in forum Hardware Accelerated Runtime
    Replies: 1
    Last Post: 13th March 2009, 06:52 PM
  5. "Resize display to fill window size" question
    By nightofgrim in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 6th January 2009, 01:03 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
  •