A
AgentD
Guest
Hi there,
I've been experiencing some graphical glitches in my game with sprites drawing at complete random. Clearing the cache doesn't change anything. Here's a video to show one example of what I mean:
https://drive.google.com/file/d/0B7Uw15XguKhHdUpoS0VsUDZacFk/view?usp=sharing
Here's the code that governs that textbox, it's a texture drawn over a primitive with an alarm controlling the texture's scrolling. I assumed it had something to do with the UV value of my primitive's texture being larger than 1, but according to the manual, as long as my texture_set_repeat is true, it should work correctly:
Does anyone have any ideas about what might cause this and how I can fix it?
Thanks!
I've been experiencing some graphical glitches in my game with sprites drawing at complete random. Clearing the cache doesn't change anything. Here's a video to show one example of what I mean:
https://drive.google.com/file/d/0B7Uw15XguKhHdUpoS0VsUDZacFk/view?usp=sharing
Here's the code that governs that textbox, it's a texture drawn over a primitive with an alarm controlling the texture's scrolling. I assumed it had something to do with the UV value of my primitive's texture being larger than 1, but according to the manual, as long as my texture_set_repeat is true, it should work correctly:
Code:
scrollx = alarm[1]/60;
scrolly = alarm[1]/60;
texture_set_repeat(true);
if attribute[line, 1] = 1
{
//draw shape behind animation
draw_primitive_begin(pr_trianglestrip)
draw_vertex(0, 148);
draw_vertex(0, 340);
draw_vertex(434, 148);
draw_vertex(434, 340);
draw_vertex(542, 148);
draw_primitive_end();
//draw animation
draw_set_alpha(1);
draw_set_colour(c_white);
draw_primitive_begin_texture(pr_trianglestrip, sprite_get_texture(dialogueanimation_spr, -1));
draw_vertex_texture(0, 148, scrollx, 0);
draw_vertex_texture(0, 340, scrollx, 1);
draw_vertex_texture(217, 148, scrollx+1, 0);
draw_vertex_texture(217, 340, scrollx+1, 1);
draw_primitive_end()
draw_primitive_begin_texture(pr_trianglestrip, sprite_get_texture(dialogueanimation_spr, -1));
draw_vertex_texture(217, 148, scrollx, 0);
draw_vertex_texture(217, 340, scrollx, 1);
draw_vertex_texture(434, 148, scrollx+1, 0);
draw_vertex_texture(434, 340, scrollx+1, 1);
draw_primitive_end()
draw_primitive_begin_texture(pr_trianglestrip, sprite_get_texture(dialogueanimation_spr, -1));
draw_vertex_texture(434, 148, scrollx, 0);
draw_vertex_texture(434, 340, scrollx, 1);
draw_vertex_texture(542, 148, scrollx+.5, 0);
draw_primitive_end()
}
Thanks!