nesbox / emulator

Emulator of NES, Super Nintendo, Sega Mega Drive, GameBoy video consoles
http://nesbox.com/emulator/
MIT License
592 stars 247 forks source link

Can I embed the emulator without jQuery? #50

Open perelowski opened 7 years ago

perelowski commented 7 years ago

Hello,

I'd like to know if there is a way to make the emulator work within the simple HTML, like:

nesbox.txt

I tried the above code but the game did not work. What syntax should I use for URL to the game?

nesbox commented 7 years ago

don't know, maybe try to urlencode rom url, like %2Froms%2FFlappy%20Bird%20(PD)%20v1.0.gen

perelowski commented 7 years ago

Thanks for info, it really works without jQuery. I have another question, though - how to make the emulator fit the 100% width and height to the enclosing div? For example, in GBA mode the emulator window has default size of 480x320 pixels. I'd like to put that in the div and make it fit that div using <OBJECT style="width: 100%; height: 100%;">

nesbox commented 7 years ago

I'm not good in html, sorry.

perelowski commented 7 years ago

Hi, thanks for info. In other words - are there any parameters, flashvars etc. that can be sent to the emulator to set it to desired width / height?

nesbox commented 7 years ago

there are no such parameters, the emulator calls 'resizeOwnEmulator(width, height)' on your JS where you should resize the emulator object

perelowski commented 7 years ago

Thanks for info, it's clear. A bit off-topic: where can I find info on embedding the JavaScript version of Nesbox? I'd like to try that but there seems to be no docs on its site.

nesbox commented 7 years ago

JS is just a demo and I'm going to remove it.