Green Outline Around Sprites NEED HELP

T

Tem Matthews

Guest
My player seems to have a green outline around it even though there is no green outline around the sprite in the editor. I have no idea how to fix this could someone please help me out?

Images of green outline

upload_2016-6-23_7-39-55.png

upload_2016-6-23_7-40-27.png
 
F

faissaloo

Guest
Rub out the areas where the green outline appears when you play the game even though you can't see it in the sprite editor with a rubber of opacity 255. Also, can you post your draw event code.
 
T

Tem Matthews

Guest
I
Rub out the areas where the green outline appears when you play the game even though you can't see it in the sprite editor with a rubber of opacity 255. Also, can you post your draw event code.
I have deleted all opaque pixels that shouldn't be there but I am still having the same issue. I don't have a draw event for my player, would a draw event be better instead of this code I have in a Step Event:
{
if(keyboard_check(ord('D')) && place_free(x+4,y)){
x+=4;
if (gun = 0) {if (face = 1)sprite_index = spr_player_run_back else sprite_index = spr_player_run;}
if (gun = 1) {if (face = 1)sprite_index = spr_player_gun_run_back else sprite_index = spr_player_gun_run;}
image_speed = .2;
if (gun = 0) {image_xscale = 1;}
if (gun = 1) && (mouse_check_button(!mb_left)) {image_xscale = 1} else if (mouse_check_button(mb_left)) && (!image_xscale = -1) {image_xscale = 1} else if (!image_xscale = 1) {image_xscale = -1}
}

if(keyboard_check(ord('A')) && place_free(x-4,y)){
x-=4;
if (gun = 0) {if (face = 1)sprite_index = spr_player_run_back else sprite_index = spr_player_run;}
if (gun = 1) {if (face = 1)sprite_index = spr_player_gun_run_back else sprite_index = spr_player_gun_run;}
image_speed = .2;
if (gun = 0) {image_xscale = -1;}
if (gun = 1) && (mouse_check_button(!mb_left)) {image_xscale = -1} else if (mouse_check_button(mb_left)) && (!image_xscale = 1) {image_xscale = -1} else if (!image_xscale = -1) {image_xscale = 1}
}

if(keyboard_check(ord('W')) && place_free(x,y-4)){
y-=4;
face = 1
if (gun = 0) {sprite_index = spr_player_run_back;}
if (gun = 1) {sprite_index = spr_player_gun_run_back;}
image_speed = .2;
}

if(keyboard_check(ord('S')) && place_free(x,y+4)){
y+=4;
face = 0
if (gun = 0) {sprite_index = spr_player_run;}
if (gun = 1) {sprite_index = spr_player_gun_run;}
image_speed = .2;

}
if(!keyboard_check(ord('D')) && !keyboard_check(ord('A')) && !keyboard_check(ord('W')) && !keyboard_check(ord('S'))){
image_speed = 0;
if (gun = 0) && (mouse_check_button(!mb_left))
{
if (face = 1)sprite_index = spr_player_stand_back else sprite_index = spr_player_stand;
}
else
{
sprite_index = sprite69
}
if (gun = 1) {if (face = 1)sprite_index = spr_stand_gun_back else sprite_index = spr_stand_laser_gun;}
}}
 
is the green outline there all the time or just some of the times?

You could try redrawing over the transparent pixels using a gray color, no opacity, and "replace" instead of "blend" color mode. Actually a better idea might be to use the color of a nearby opaque pixel, instead of using gray.
 

lolslayer

Member
Maybe it's some kind of optical effect

Try to change the background, instead of grass green maybe something like crimson red, then you should look if the line is still green or red
 
S

SoulTie

Guest
Hmm...Weird. If you have tried all the other suggestions to no avail, then this could be a bug. However, I doubt it. If all else fails, then make a shader to get rid of the green border.
 
S

sparksinfinite

Guest
Some possible problems and solutions:

- Are you drawing on a self defined surface ? This causes transparency issues
- Is the character 'snapped' to pixels or does he move with subpixel speed (maybe due to acceleration/damp somewhere)? make sure its placed with integers in room editor
- This also applies to the view movement (check the view pos and player pos with debug info), how are your view size and port? Maybe some little distortion
- Are you allowing crop to your sprite? Check sprite editor and texture page settings
- Try: Draw the sprite with texture_set_interpolation(false);
 
S

Snail Man

Guest
Have you tried going into global game settings and disabling 'Interpolate colors between pixels'?
 

Tthecreator

Your Creator!
This could be a possible scaling issue try to do what the snail man said. If that was the issue, you might need to create some code to correctly scale your game.
 
T

Tem Matthews

Guest
Have you tried going into global game settings and disabling 'Interpolate colors between pixels'?
Thanks Snail Man, turning interpolate colours off fixed my problem but the game looks lower resolution when in fullscreen. This shouldn't be much of a problem but is this meant to happen?
 
Last edited by a moderator:
T

Tem Matthews

Guest
is the green outline there all the time or just some of the times?

You could try redrawing over the transparent pixels using a gray color, no opacity, and "replace" instead of "blend" color mode. Actually a better idea might be to use the color of a nearby opaque pixel, instead of using gray.
Its only there sometimes
 
T

Tem Matthews

Guest
Thank you to everyone who gave suggestions on this issue. I really appreciate it :D
 
R

Robert

Guest
Why dont you try swapping the player sprite with some other sprite and see if it still happens. My first step would be trying to distinguish the source, as in if its coming from the sprite, the code, or GM itself. So swap the sprite and see what happens.
 
T

Tem Matthews

Guest
Why dont you try swapping the player sprite with some other sprite and see if it still happens. My first step would be trying to distinguish the source, as in if its coming from the sprite, the code, or GM itself. So swap the sprite and see what happens.
Swapping the sprite worked. The green outline only appears on my run animation for the player not any other sprite
 
T

Tem Matthews

Guest
Thanks to all of your suggestions I managed to fix the problem(without turning off interpolate colours between pixels). It turned out there was a strange green background with an opacity of 0 in some of my animated and still sprites for the player. I could only detect them with the colour picker. I couldn't erase them even with replace mode on. So i used a fill bucket to fill the background behind the player with purple and then delete the purple colour with the magic wand. Thank you for your help.
 
Top