Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

[FIXED] New function

A topic by Nordok created May 13, 2018 Views: 458 Replies: 4
Viewing posts 1 to 4

These asset works great. Tell me please, it possible to create a new function?
I need some like: open_string_as_page(str)
Important! Without somewhere saving a file.

(1 edit)

I have already been told how you can do what I need. To open a line as an HTML page without saving it. Instead of an address, you can use the following lines:
data:text/html;base256,<b>hello world</b>
or
data:text/html;base64,PGI+aGVsbG8gd29ybGQ8L2I+4oCL4oCL
It will be executed as HTML. Also, it works in browser (in the address bar)

Developer

Hi, yes, I think this can be done, I'll try and update later today.

Oh, Thanks for the answer.

Have you tried some optimization? The project consumes a lot of CPU resources 25-70% is very much. Is it possible to use some hardware acceleration?

Developer (1 edit)

I've posted an update, it now has the chromium_set_string() function that will load HTML directly onto the page.  You probably want to set the dummy URL as about:blank.

As transparent rendering is turned on, you may need to make sure a background color is set. There are some odd effects here I haven't quite worked out yet relating to this transparency.

Regarding CPU usage: unfortunately in order to have chromium render frames in the background and send the data over to Gamemaker via a buffer, it can't take advantage of GPU rendering, and so CPU usage is high.  There's no way around this other than to have Chromium pop up as an on-screen overlay (or borderless window) placed exactly over the game, this method is used by some other Chromium GM extensions, but this method does not allow layering or shaders.