Jump to content


Photo

No surface support?


  • Please log in to reply
5 replies to this topic

#1 snelson87

snelson87

    GMC Member

  • New Member
  • 7 posts
  • Version:GM:HTML5

Posted 22 February 2012 - 09:24 PM

In my HTML5 version of my game it seems like surfaces do not work correctly, while in Window mode they do.

Also what about scripts? Does HTML5 read scripts because my scripts dont work in the browser. Specifically when I move my mouse wheel it calls my weapon change script and should change weapons...but it does not, while in window mode it does.

Edited by snelson87, 22 February 2012 - 09:35 PM.

  • 0

#2 Artaex Media

Artaex Media

    Artaex Media

  • GMC Member
  • 1531 posts
  • Version:Unknown

Posted 22 February 2012 - 09:52 PM

Surfaces are not supported in GM:HTML5, but your scripts should work fine.
Why don't you post your script?
  • 0

#3 snelson87

snelson87

    GMC Member

  • New Member
  • 7 posts
  • Version:GM:HTML5

Posted 22 February 2012 - 10:04 PM

Surfaces are not supported in GM:HTML5, but your scripts should work fine.
Why don't you post your script?

dang I figured sufaces wouldnt work, no big deal I will just have to take a few things out. Here the weapons switch script that gets called

/* ARGUMENT LIST:
argument0 -> Weapon index (from 0 to infinity : D)
            Other possible values:
            -1 -> Switch to last used weapon
            -2 -> Switch to previous weapon (used also when the current weapon runs out of bullets)
                    If the first one is currently selected it will switch to the last one
            -3 -> Switch to next weapon -> If the last one is currently selected it will switch to the first one
            
This function returns "true" if a weapon was successfully switched to or "false" when it fails to switch

PS:
I know the if-s after the returns are pointless. I will remove them at some point : D
*/
if (argument0 = -1) {
    if (ws_weapon_last != ws_weapon_current) { // if the last weapon isn't the current one
        if (ws_weapon_bullets_loaded[ws_weapon_last] != 0 || ws_weapon_bullets[ws_weapon_last] != 0) {
            ws_temp1 = ws_weapon_current;
            ws_weapon_switch(ws_weapon_last); // switch the weapon
            ws_weapon_last = ws_temp1;
        }
    }
} else if (argument0 = -2) {
    ws_temp1 = false; // the following loops check if all previous weapons one by one for bullets. if none of them has it starts from the last one down to the current one
    for (i = ws_weapon_current - 1; i >= 0 ; i -= 1) {
        if (ws_weapon_bullets_loaded[i] = 0 && ws_weapon_bullets[i] = 0) {
            continue;
        } else {
            ws_temp1 = true;
            ws_weapon_switch(i);
            return true;
        }
    }
    if (ws_temp1 = false) {
        for (i = ws_weapon_number - 1; i > ws_weapon_current ; i -= 1) {
            if (ws_weapon_bullets_loaded[i] = 0 && ws_weapon_bullets[i] = 0) {
                continue;
            } else {
                ws_temp1 = true;
                ws_weapon_switch(i);
                return true;
            }
        }
        if (ws_temp1 = false) { // if there is absolutely no weapon with bullets
            show_message("There are no weapons with bullets to switch to. To avoid this message add at least 1 weapon with unlimited bullets.");
            return false;
        }
    }
} else if (argument0 = -3) {
    ws_temp1 = false; // the following loops check if all next weapons one by one for bullets. if none of them has it starts from the first one up to the current one
    for (i = ws_weapon_current + 1; i < ws_weapon_number ; i += 1) {
        if (ws_weapon_bullets_loaded[i] = 0 && ws_weapon_bullets[i] = 0) {
            continue;
        } else {
            ws_temp1 = true;
            ws_weapon_switch(i);
            return true;
        }
    }
    if (ws_temp1 = false) {
        for (i = 0; i < ws_weapon_current ; i -= 1) {
            if (ws_weapon_bullets_loaded[i] = 0 && ws_weapon_bullets[i] = 0) {
                continue;
            } else {
                ws_temp1 = true;
                ws_weapon_switch(i);
                return true;
            }
        }
        if (ws_temp1 = false) { // if there is absolutely no weapon with bullets
            show_message("There are no weapons with bullets to switch to. To avoid this message add at least 1 weapon with unlimited bullets.");
            return false;
        }
    }
} else {
    if (argument0 < ws_weapon_number) { // if we want to switch to a specific weapon we check if the provided weapon index exists
        if (ws_weapon_bullets_loaded[argument0] != 0 || ws_weapon_bullets[argument0] != 0) { // if it has bullets we switch
            ws_weapon_switch(argument0);
        }
    } else {
        show_message("There is no such weapon with this index - " + argument0);
    }
}

  • 0

#4 Mike.Dailly

Mike.Dailly

    Evil YoYo Games Employee

  • Administrators
  • 3325 posts
  • Version:GM:Studio

Posted 22 February 2012 - 10:53 PM

Eh? Surfaces are FULLY supported in HTML5
  • 0

#5 snelson87

snelson87

    GMC Member

  • New Member
  • 7 posts
  • Version:GM:HTML5

Posted 22 February 2012 - 11:16 PM

Eh? Surfaces are FULLY supported in HTML5


(╯°□°)╯︵ ┻━┻

Well for whatever reason surfaces are not working correctly when deployed in HTML5. I set them up the normal way

sprite_set_alpha_from_sprite(puddle_Sprite,puddle_Sprite); //Sets the puddle sprite alpha...
//sprite_set_alpha_from_sprite(spr_logAlpha,spr_logAlpha);

global.blend=0; //This is for the blending colour. Delete and set in the puddle object if needed...

//For lower memory use and lower quality use this... Delete if not used...
//global.surf=surface_create(room_width/2,room_height/2); //Creates the surface...

//For normal memory use and normal quality use this... Delete if not used...
global.surf=surface_create(room_width,room_height); //Creates the surface...

surface_set_target(global.surf); //Select the surface...
draw_clear_alpha(c_black,0); //Clean the surface of buffer noise...
surface_reset_target(); //Reset drawing target from surface...

//For normal memory use and normal quality use this... Delete if not used...
global.surf_two=surface_create(room_width,room_height); //Creates the surface...

surface_set_target(global.surf_two); //Select the surface...
draw_clear_alpha(c_black,0); //Clean the surface of buffer noise...
surface_reset_target(); //Reset drawing target from surface...


then when I call my blood splatter object it does not look right at all.....heres some screens

BAD(HTML5)
Posted Image



GOOD(WINDOWS)
Posted Image

Edited by snelson87, 22 February 2012 - 11:26 PM.

  • 0

#6 Maxinston

Maxinston

    Epic Phail

  • GMC Member
  • 1248 posts
  • Version:Unknown

Posted 04 May 2012 - 04:10 PM


Eh? Surfaces are FULLY supported in HTML5


(╯□)╯︵ ┻━┻

Well for whatever reason surfaces are not working correctly when deployed in HTML5. I set them up the normal way

sprite_set_alpha_from_sprite(puddle_Sprite,puddle_Sprite); //Sets the puddle sprite alpha...
//sprite_set_alpha_from_sprite(spr_logAlpha,spr_logAlpha);

global.blend=0; //This is for the blending colour. Delete and set in the puddle object if needed...

//For lower memory use and lower quality use this... Delete if not used...
//global.surf=surface_create(room_width/2,room_height/2); //Creates the surface...

//For normal memory use and normal quality use this... Delete if not used...
global.surf=surface_create(room_width,room_height); //Creates the surface...

surface_set_target(global.surf); //Select the surface...
draw_clear_alpha(c_black,0); //Clean the surface of buffer noise...
surface_reset_target(); //Reset drawing target from surface...

//For normal memory use and normal quality use this... Delete if not used...
global.surf_two=surface_create(room_width,room_height); //Creates the surface...

surface_set_target(global.surf_two); //Select the surface...
draw_clear_alpha(c_black,0); //Clean the surface of buffer noise...
surface_reset_target(); //Reset drawing target from surface...


then when I call my blood splatter object it does not look right at all.....heres some screens

BAD(HTML5)
Posted Image



GOOD(WINDOWS)
Posted Image


Blend modes aren't supported.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users