[Request] Open a window inside the game that shows a webpage (for example: show game news, patch lis

Hello again, if I remember well someone made a script for show any webpage inside the game but sadly I don't remember its name and I'm having issues for finding it...


...or I'm remembering wrong and this doesn't exist yet?


I need that plugin for show the news of my games, show a gacha list, display patch notes and more things, and it must be directly on a window inside the game and not opening the webpages on a browser.


Does someone know about this plugin? Or if it doesn't exist yet, can someone make it?


Thank you in advance.
Easy to do!


This is a snippet taken from a plugin i wrote for the game agar.io. The plugin creates an iframe within the agar webpage to load my own chat system - so that there is an in game chat system for me yo use with friends during gameplay.


The code looks somewhat like this:


var iframe = document.createElement('iframe');
iframe.src = '//http://dac.dekyde.com';
iframe.className = 'DekitaChatFrame'
iframe.style.zIndex = '500';
iframe.style.position = 'fixed';
iframe.style.left = (100) + 'px'; // x position
iframe.style.top = (100) + 'px'; // y position
iframe.width = (400) + 'px';
iframe.height = (600) + 'px';
iframe.style.border = 'none';

div.appendChild(iframe);
$('body').append(div);




it would have to be modified a little - due to my solution above using jquery, but its really not a difficult change.


Edit:


I made some changes and got this working in mv. I'll likely write it into a real plugin, but here it is for now.


(function(){

var SETTINGS = {
site: '//http://dac.dekyde.com',
x: 0,
y: 0,
w: 200,
h: 300,
};

var div = document.createElement("div");
div.style.zIndex = '2';
div.style.opacity = '0.5';
div.style.position = 'fixed';
div.style.background = 'black';
div.style.color = 'white';
div.style.left = SETTINGS.x + 'px';
div.style.top = SETTINGS.y + 'px';
div.style.width = SETTINGS.w + 'px';
div.style.height = SETTINGS.h + 'px';

var iframe = document.createElement('iframe');
iframe.src = SETTINGS.site;
iframe.className = 'DekitaChatFrame'
iframe.style.zIndex = '3';
iframe.style.position = 'fixed';
iframe.style.left = SETTINGS.x + 'px';
iframe.style.top = SETTINGS.y + 'px';
iframe.width = SETTINGS.w + 'px';
iframe.height = SETTINGS.h + 'px';
iframe.style.border = 'none';

// Appennd iframe to div
div.appendChild(iframe);

// Alias for Graphics.initialize
var initialize = Graphics.initialize;
Graphics.initialize = function() {
initialize.apply(this, arguments);
// Must append the div to document AFTER other elements have been created.
// Oteriwse the element seems to be created underneath the game canvas.
document.body.appendChild(div);
};

})();





Put that into a new .js file and make sure it is loaded in your project. Let me know if you have any issues.
Easy to do!


This is a snippet taken from a plugin i wrote for the game agar.io. The plugin creates an iframe within the agar webpage to load my own chat system - so that there is an in game chat system for me yo use with friends during gameplay.


The code looks somewhat like this:



var iframe = document.createElement('iframe');
iframe.src = '//http://dac.dekyde.com';
iframe.className = 'DekitaChatFrame'
iframe.style.zIndex = '500';
iframe.style.position = 'fixed';
iframe.style.left = (100) + 'px'; // x position
iframe.style.top = (100) + 'px'; // y position
iframe.width = (400) + 'px';
iframe.height = (600) + 'px';
iframe.style.border = 'none';

div.appendChild(iframe);
$('body').append(div);




it would have to be modified a little - due to my solution above using jquery, but its really not a difficult change.



Oh, that's amazing! Glad to know that is an "easy thing" to do for you 🙂 how much time would take you to make it?


Also, this is a bit unrelated to the request but maybe you can help me with it.


Another use I was thinking for was also a chat system, some friends are going to test my game on mobile phones, and being able to chat right inside the game makes things easier, though I don't know yet how to make a chat website, all I found was a thing for make a "temporal chat" which everything is deleted once the person leaves it, and it isn't useful for me, I need a kind of chat that stores the chat, and allows even upload files or at least attach photos, and what I find on google are Live Chat Systems x_x


Do you have any idea of where I can find something for make a chat system like this? If you want we can talk about it on Skype or Twitter, I would send you my id by PM.


Thank you in advance.
I edited my post with a more functional version, here is is again for convenience:

Spoiler
Code:
	(function(){
	  var SETTINGS = {
	    site: '//http://dac.dekyde.com',
	    x: 0,
	    y: 0,
	    w: 200,
	    h: 300,
	  };
	  var div = document.createElement("div");
	  div.style.zIndex = '2';
	  div.style.opacity = '0.5';
	  div.style.position = 'fixed';
	  div.style.background = 'black';
	  div.style.color = 'white';
	  div.style.left   = SETTINGS.x + 'px';
	  div.style.top    = SETTINGS.y + 'px';
	  div.style.width  = SETTINGS.w + 'px';
	  div.style.height = SETTINGS.h + 'px';
	  var iframe = document.createElement('iframe');
	  iframe.src = SETTINGS.site;
	  iframe.className = 'DekitaChatFrame'
	  iframe.style.zIndex = '3';
	  iframe.style.position = 'fixed';
	  iframe.style.left = SETTINGS.x + 'px';
	  iframe.style.top  = SETTINGS.y + 'px';
	  iframe.width  = SETTINGS.w + 'px';
	  iframe.height = SETTINGS.h + 'px';
	  iframe.style.border = 'none';
	  // Appennd iframe to div
	  div.appendChild(iframe);
	  // Alias for Graphics.initialize
	  var initialize = Graphics.initialize;
	  Graphics.initialize = function() {
	    initialize.apply(this, arguments);
	    // Must append the div to document AFTER other elements have been created.
	    // Oteriwse the element seems to be created underneath the game canvas.
	    document.body.appendChild(div);
	  };
	})();



For a chat system that remembers the previous conversion, you would have to have a database implementation to store said information. For example, an amazon account to host the pictures, or a dedicated server to hold text files for each person (that would be a very simple implementation of remembering things).


I mean, its not an impossible, or even a 'difficult' thing to do, it just involves a fair bit of tedious work. 🙂
Thank you, what I must do for use this plugin? It has a plugin command? And about the chat system... well, I'm using a free Hostinger account which let me make up to two SQL Database and I have up to 2GB storage which is really enough for me, because we are few people testing my game. However I still don't find how to make a 'persistent' chat system, and even less how to attach images on the chat, aaaand that is compatible in mobile browsers... I've been using Google a lot but I have no luck, it is always showing me very expensive Live Chat Systems or even softwares, ugh, Google's Accuracy becomes worse everyday...
Well, this isnt really a plugin, it just makes an iframe and attaches it onto the game. you would have to code everything yourself for handling logic and showing/hiding the window and such, then you would also need a website to contact that is a chat website that remembers messages.

Original thread: https://forums.rpgmakerweb.com/threads/request-open-a-window-inside-the-game-that-shows-a-webpage-for-example-show-game-news-patch-lis.61587/