Jump to content


spiderhund

Member Since 06 Feb 2009
Offline Last Active Mar 14 2012 03:05 PM

Topics I've Started

Corrupted Memory

14 March 2012 - 03:04 PM

Hello.

I'm trying to compile a game as HTML5.
Everytime I try it gives me this error right before it's about to generate the sprite texture.

If I compile the game to a new folder each time it works fine.. Also compiling for Windows works as well.

Any advice regarding this?


Thanks.

string_char_at & string_pos not working

06 March 2012 - 09:32 AM

Hello.

I've recently just gotton my hands on GM:HTML5 to work on a project for a company.
I wrote a small extension which allows me to display text using a bitmap font (Sprite).

This works perfectly when compiling as an .exe but not when compiling the HTML5. I did some testing and it seems the functions "string_char_at(str, index);" and "string_pos(substr, str);" doesn't return anything in HTML5.

Is there any replacement code or workarounds to this?


Here's the code that displays the text using a bitmap:
(arg0 = sprite, arg1 = string, arg2 = x, arg3 = y)
datalen = (string_length(argument1));

if(argument_relative){
    posX = x + argument2;
    posY = y + argument3;
}
else {
    posX = argument2;
    posY = argument3;
}

charwidth = sprite_get_width(argument0);

for(i=0;i<datalen;i+=1){
    charat = string_char_at(argument1, i+1);
    pos = string_pos(charat, sprite_get_name(argument0));
    draw_sprite(argument0, pos-1, posX+(charwidth*i), posY);
}

Thanks.

Compiled Image Texture

05 March 2012 - 01:35 PM

Hello There.

I've just gotton my hands on GM:HTML5 and I've been tasked with recreating a java game in HTML5 for a company.
Now I've noticed that when compiling a game it creates one or more texture files containing all images/sprites/backgrounds used by the game.

This is not an optimal choice for my project so my question is if there is a way to prevent this and just have the game read a whole bunch of small image files instead?