Sorry, I meant the ad_test.html wasn't local, the GM:HTML5 project was ran locally. So the Iframe looked like this:Which folder within the whole setup did you place ad_test.html in?
<iframe src="http://myhost.com/ad_test.html">...
Posted 25 January 2012 - 02:08 PM
Sorry, I meant the ad_test.html wasn't local, the GM:HTML5 project was ran locally. So the Iframe looked like this:Which folder within the whole setup did you place ad_test.html in?
<iframe src="http://myhost.com/ad_test.html">...
Posted 26 January 2012 - 01:16 AM
Posted 27 February 2012 - 12:23 PM
////////////////////old code
button_click = canvas_html_add_event();
html_code = '<button type="button" onclick="canvas_html_fire_event(' + string(button_click) + ')">Click To Make Ball Bounce!</button>';
html_button = canvas_html_add(32, 32, html_code);
///////////////////insert code
canvas_html_set_x(html_button,52)
Edited by autukill, 27 February 2012 - 12:35 PM.
Posted 01 May 2012 - 02:39 PM
Posted 01 May 2012 - 09:55 PM
Posted 01 May 2012 - 10:05 PM
Hi,
I tried to embed a YouTube video, in the way as shown in the topic,
if i go to the next room and destroy the object which creates the YouTube video player, the YouTube Player is still visable (and still works) so the HTML code doesn't destroy.
I think I need to use the canvas_html_remove(id), but I don't know how to get the id of the youtube-code, and the example and documentation won't help me.
Is there anybody who can help me?
Posted 02 May 2012 - 05:44 PM
Posted 02 May 2012 - 08:08 PM
Posted 12 May 2012 - 12:16 PM
Posted 16 May 2012 - 12:53 AM
Posted 02 June 2012 - 07:01 AM
Posted 10 June 2012 - 06:13 AM
How can i use that? i want to be able to play an audio file (mp4 will work). i need it like if a click on a sprite or press space it will play that sound/vid
Yes. Don't see why not anyway.
The below code will embed http://www.youtube.c...h?v=SbDx3M2YnKc on to your canvas and size it to fit in the room.canvas_html_add(0,0,'<iframe width="' + string(room_width) + '" height="' + string(room_height) + '" src="http://www.youtube.com/embed/SbDx3M2YnKc" frameborder="0" allowfullscreen></iframe>');
if i putcanvas_html_add(0,0,'<video width="' + string(room_width) + '" height="' + string(room_height) + 'controls="controls">' + '<source src="djp1.mp4" type="video/mp4"/> Your browser does not support the video tag.</video>');
then do a Create Application. Should I put the video in the html5game folder?
I made this index.html and put the djp1.mp4 video in the same place to test<!DOCTYPE HTML> <html> <body> <video width="320" height="240" controls="controls"> <source src="djp1.mp4" type="video/mp4" /> Your browser does not support the video tag. </video> </body> </html>
and it works.
Posted 21 June 2012 - 03:06 AM
Hi
does this work with studio yet?
Posted 11 July 2012 - 05:07 PM
Hidoes this work with studio yet?
I tried using this with GM Studio and the games made with it get stuck at the end of loading. Can someone confirm if this works with Studio or not?
Thanks!
(Could be just me)
Posted 07 August 2012 - 01:53 PM
Posted 27 August 2012 - 05:26 PM
i downloaded the file and do the example but the error is unknown function script, why? i create an extension1 and add the gex and gmz file in it, is it wrong procedure?
HTML Extension
This extension package provides HTML functionality for Game Maker HTML5 games. That means you can add snippets of HTML code where you want it. The extension also provides functionality to connect the HTML elements to your code, for example when you press a button made in HTML it can make your character jump.
Functions
canvas_html_add(x,y,html) - Creates a new html element and positions it accordingly. The function returns an integer as an id that must be used in all other functions to access the particular html element.
canvas_html_remove(id) - Destroys the html element, do this when you are done using the element.
canvas_html_hide(id) - Makes the html element invisible.
canvas_html_show(id) - Makes the html element visible.
canvas_html_get_html(id) - Returns the html for the html element.
canvas_html_set_html(id,html) - Sets the html for the html element.
canvas_html_get_x(id) - Returns the x-coordinate for the html element.
canvas_html_get_y(id) - Returns the y-coordinate for the html element.
canvas_html_set_x(id,x) - Sets the x-coordinate for the html element.
canvas_html_set_y(id,y) - Sets the y-coordinate for the html element.
canvas_html_add_event() - Returns the id of the event to be used for other functions. This function must be called first before being able to use events.
canvas_html_callback(id) - This function will return true if the event with the given id has been triggered. If it hasn't been trigger it will return false. This will usually go in the step event of an object.
canvas_html_fire_event(id) - This function is a bit tricky. This "fires" an event with the given id. You would expect this to be in your html code, however can also be used in your game maker project.
Live Example
http://syntaxgames.com/gamemaker/html/
Links
http://syntaxgames.c...L_Extension.zip (direct)
http://www.crocko.co...L_Extension.zip (mirror)
Online Documentation
http://syntaxgames.c...umentation.html
Compatibility
I haven't tested compatability. Please feel free to post what browsers this work/don't work on.
License
Feel free to use and abuse as you wish. Credit appreciated though.
EDIT: Added mirror.
Posted 10 October 2012 - 12:52 PM
Posted 06 November 2012 - 12:21 PM
Shame that this doesn't work with Studio. Would love to see an alternative.
Posted 19 November 2012 - 08:25 AM
Posted 21 November 2012 - 03:17 PM
To further clarify, having the extension in my game without actually using any of its functions causes games to get stuck at a full loading bar.My games are currently crashing just by having the extension installed. Any idea what could be causing this?
0 members, 0 guests, 0 anonymous users