ppeccin / javatari.js

Javatari - Online Atari 2600 Emulator
https://javatari.org
GNU Affero General Public License v3.0
215 stars 54 forks source link

[Request] Image loading and manipulation through JS #13

Closed Leorivasc closed 1 year ago

Leorivasc commented 5 years ago

Hi, The software is amazing, I tried to build a small website with it, but the only way I found to load and start games is through the URL in a new window or iframe. Is it possilble to add a feature such that the emulator could remain in the same page as the games list, and exchanging cartridge images without having to open a new page, maybe using click events? (sorry if the feature is already there, the doc doesn't mention or I didn't understand). Thanks

ppeccin commented 5 years ago

Hi! Thanks for using Javatari!

Yes, there are some functions for that, but they are not official yet, and not documented. I will check in the code if the API is working as expected, and get back to you soon.

Regards, Paulo

On Sun, Sep 15, 2019 at 5:13 AM Leorivasc notifications@github.com wrote:

Hi, The software is amazing, I tried to build a small website with it, but the only way I found to load and start games is through the URL in a new window or iframe. Is it possilble to add a feature such that the emulator could remain in the same page as the games list, and exchanging cartridge images without having to open a new page, maybe using click events? (sorry if the feature is already there, the doc doesn't mention or I didn't understand). Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ppeccin/javatari.js/issues/13?email_source=notifications&email_token=AAFOLIBBRHFBRG7GQE3EH43QJXVB3A5CNFSM4IWZUUD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HLNM22A, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFOLIBGVWJKXUFAWO7FM23QJXVB3ANCNFSM4IWZUUDQ .

ppeccin commented 5 years ago

Hi... Just checked the API.

You can achieve what you want (loading new ROMs dynamically) by calling the File Loader method:

Javatari.fileLoader.readFromURL(String url)

The "url" parameter is relative to your current directory, so you can use relative paths like for example:

Javatari.fileLoader.readFromURL("mygames/Game.bin")

Hope that works for you!

Paulo

On Tue, Sep 17, 2019 at 2:38 PM Paulo Peccin ppeccin@gmail.com wrote:

Hi! Thanks for using Javatari!

Yes, there are some functions for that, but they are not official yet, and not documented. I will check in the code if the API is working as expected, and get back to you soon.

Regards, Paulo

On Sun, Sep 15, 2019 at 5:13 AM Leorivasc notifications@github.com wrote:

Hi, The software is amazing, I tried to build a small website with it, but the only way I found to load and start games is through the URL in a new window or iframe. Is it possilble to add a feature such that the emulator could remain in the same page as the games list, and exchanging cartridge images without having to open a new page, maybe using click events? (sorry if the feature is already there, the doc doesn't mention or I didn't understand). Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ppeccin/javatari.js/issues/13?email_source=notifications&email_token=AAFOLIBBRHFBRG7GQE3EH43QJXVB3A5CNFSM4IWZUUD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HLNM22A, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFOLIBGVWJKXUFAWO7FM23QJXVB3ANCNFSM4IWZUUDQ .

Zibri commented 1 year ago

@ppeccin If the cartridge has already been loaded so it's stored in locastorage, how to load it from there (by javascript, not by the menu)?