Jump to content


Photo

HTML Extension


  • Please log in to reply
47 replies to this topic

#21 beatson

beatson

    GMC Member

  • GMC Member
  • 317 posts
  • Version:GM8

Posted 25 January 2012 - 02:08 PM

Which folder within the whole setup did you place ad_test.html in?

Sorry, I meant the ad_test.html wasn't local, the GM:HTML5 project was ran locally. So the Iframe looked like this:
<iframe src="http://myhost.com/ad_test.html">...

  • 0

#22 True Valhalla

True Valhalla

    ಠ_ಠ

  • Retired Staff
  • 4880 posts
  • Version:GM:Studio

Posted 26 January 2012 - 01:16 AM

Ah I see what you mean now - thanks. Will give it a another go soon.
  • 0

#23 autukill

autukill

    GMC Member

  • GMC Member
  • 9 posts

Posted 27 February 2012 - 12:23 PM

:wacko: I find the canvas_html_set_x() and canvas_html_set_y() could not to run.
eg:
////////////////////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.

  • 0

#24 stoneyftw

stoneyftw

    GMC Member

  • GMC Member
  • 112 posts
  • Version:GM:Studio

Posted 01 May 2012 - 02:39 PM

I'm using this extension in my game, and it's allowing me to pull the user's custom avatar image from my database using my php database extension, and into the game using this HTML extension. Big thanks to OP.

I'll post a tutorial on how to import images dynamically when I have a few minutes to spare. Thanks again!
  • 0

#25 _261131

_261131

    GMC Member

  • New Member
  • 1 posts

Posted 01 May 2012 - 09:55 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?
  • 0

#26 stoneyftw

stoneyftw

    GMC Member

  • GMC Member
  • 112 posts
  • Version:GM:Studio

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?


I would imagine that the destruction code only destroys the gamemaker object. I don't think there's code for destroying HTML elemeents.
  • 0

#27 stoneyftw

stoneyftw

    GMC Member

  • GMC Member
  • 112 posts
  • Version:GM:Studio

Posted 02 May 2012 - 05:44 PM

I should add that there is a very nasty bug in this extension, that makes objects unclickable when browsing an HTML5 game on an iPad. I would love for the author to fix this, but I have not been able to contact him.

Bummer.
  • 0

#28 iceshield

iceshield

    GMC Member

  • GMC Member
  • 393 posts

Posted 02 May 2012 - 08:08 PM

Best extension for html5 ! Solves lots of problems :)
  • 0

#29 iceshield

iceshield

    GMC Member

  • GMC Member
  • 393 posts

Posted 12 May 2012 - 12:16 PM

How to make input fields work ? It seems that gm gets character keys for himself and input elements are left with nothing :(
  • 0

#30 wickedsunny

wickedsunny

    GMC Member

  • GMC Member
  • 128 posts
  • Version:Unknown

Posted 16 May 2012 - 12:53 AM

I wish to put my game on a blogger.

I am not a coder and your documentation is going over my head :)

Any help of how to use this with drag and drop?

Will credit you, Games Beta done, just need to publish on my blog and check.
  • 0

#31 Fireball16

Fireball16

    Indie Developer

  • GMC Member
  • 1006 posts
  • Version:GM:Studio

Posted 02 June 2012 - 07:01 AM

Hi :) does this work with studio yet?
  • 0

#32 waxbulletgames

waxbulletgames

    GMC Member

  • New Member
  • 25 posts

Posted 10 June 2012 - 06:13 AM


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 put
canvas_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.

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
  • 0

#33 rickster

rickster

    GMC Member

  • GMC Member
  • 18 posts

Posted 21 June 2012 - 03:06 AM

Hi :) does 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)
  • 0

#34 felipejoaozinho

felipejoaozinho

    GMC Member

  • GMC Member
  • 2 posts
  • Version:GM:Studio

Posted 11 July 2012 - 05:07 PM


Hi :) does 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)


same with me, right at the end of the loading. I haven't even put any code in yet, but the extension itself causes it to hang...
  • 0

#35 mmuziek

mmuziek

    GMC Member

  • GMC Member
  • 188 posts

Posted 07 August 2012 - 01:53 PM

as soon as i add this extention even without using it.
the game does not load anymore
it seems many have this issue . so ex maker please take a look
  • 0

#36 jawojawo

jawojawo

    GMC Member

  • New Member
  • 67 posts
  • Version:GM:HTML5

Posted 27 August 2012 - 05:26 PM

Posted ImageHTML 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.

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?
  • 0

#37 tgames

tgames

    GMC Member

  • GMC Member
  • 15 posts
  • Version:Unknown

Posted 10 October 2012 - 12:52 PM

Shame that this doesn't work with Studio. Would love to see an alternative.
  • 0

#38 Maxinston

Maxinston

    Epic Phail

  • GMC Member
  • 1230 posts
  • Version:Unknown

Posted 06 November 2012 - 12:21 PM

Shame that this doesn't work with Studio. Would love to see an alternative.


Seems to work pretty great for me with Studio.
  • 0

#39 ShaunS

ShaunS

    GMC Member

  • GMC Member
  • 70 posts
  • Version:Unknown

Posted 19 November 2012 - 08:25 AM

My games are currently crashing just by having the extension installed. Any idea what could be causing this?
  • 1

#40 ShaunS

ShaunS

    GMC Member

  • GMC Member
  • 70 posts
  • Version:Unknown

Posted 21 November 2012 - 03:17 PM

My games are currently crashing just by having the extension installed. Any idea what could be causing this?

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.

But the live example clearly works. Is the version of the extension linked in the OP damaged or flawed? The code is all condensed down to a single line which makes it unreadable.
  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users