1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

HTML5 How to add some HTML code in the index, not replace it entirely?

Discussion in 'GameMaker Studio 2 Community Tech Support' started by CombatCalamity, Sep 3, 2019.

  1. CombatCalamity

    CombatCalamity Member

    Joined:
    Feb 16, 2019
    Posts:
    67
    For now what you can do is replace the index.html file to be your own .html file that you included. The problem with this is that it replaces the original html file, which has a line that imports the game output .js file. So every time you start a project with this template, you have to go to your custom index html file and edit that part to match the file name with the current project file.

    Not the best experience, especially if it was an project extension other people would purchase.

    So I need either:
    - to add some HTML code without replacing the OG one
    Or
    - any GML functionality to somehow get the string of the project name.yyp, which I'll then parse into JS.
     
  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,607
    Try injecting the HTML code using JS via Options > HTML5 > General > Prepend output .js.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice