CoreEngine Resolution width/height: 100% ?

Discussion in 'Javascript/Plugin Support' started by Freank, Dec 4, 2017.

  1. Freank

    Freank Veteran Veteran

    Messages:
    369
    Likes Received:
    146
    Primarily Uses:
    N/A
    I use many times the YEP_CoreEngine script.
    I use it to edit the resolution of my games. But they are always "fixed" in this new "relative" web.
    My question was: How can I set the width or the height: 100%?

    EDIT:
    I find a solution editing the css/html of the game.

    You have to edit index.html.
    In the <head> you can add this:

    HTML:
    <style>
    #GameCanvas {
    width: 100% !important;
    max-width: 900px;
    height: auto !important;
    }
    </style>
    Then edit the style with:

    HTML:
    <body style="background-color: black; overflow:hidden;">
    BEFORE

    [​IMG]

    AFTER


    [​IMG]


    In this way, if you're adding your game on your website, it will be always responsive.

    I'm still solving a bug linked with the cursor. Stay tuned.
     
    Last edited: Dec 9, 2017
    #1
    Joy Diamond likes this.
  2. Freank

    Freank Veteran Veteran

    Messages:
    369
    Likes Received:
    146
    Primarily Uses:
    N/A
    maybe I solved putting on the <head> of index.html this code (css)

    <style>
    #GameCanvas {
    width: 100% !important;
    max-width: 900px;
    height: auto !important;
    }
    </style>

    Even if now I have a problem with the mouse/touch. Here the game with my test ^^"
     
    #2
  3. Freank

    Freank Veteran Veteran

    Messages:
    369
    Likes Received:
    146
    Primarily Uses:
    N/A
    to a better result, in the style body you have to put overflow: hidden; in this way:

    HTML:
    <body style="background-color: black; overflow:hidden;">
    edited the first post
     
    Last edited: Dec 9, 2017
    #3

Share This Page