is there any topic that covers how vertexes work in gamemaker???
VERtexes
Started by flxp, Mar 03 2012 03:59 AM
6 replies to this topic
#1
Posted 03 March 2012 - 03:59 AM
#2
Posted 03 March 2012 - 04:57 AM
Did you start with the manual?
#3
Posted 03 March 2012 - 05:36 AM
yes, and since the first reply wasn't a tutorial all about vertexes, i will just straight ask.Did you start with the manual?
How do i make the draw_vertex_texture or draw_primitive_texture to work??
#4
Posted 03 March 2012 - 06:13 AM
So you read the manual, but it wasn't enough? What parts didn't you understand? Let's work from there.
#5
Posted 03 March 2012 - 06:42 AM
well i know how to draw vertices (without textures...)
here is an example:
here is an example:
draw_primitive_begin_texture(pr_trianglestrip,sprite_get_texture(Apple_spr,0))
for (i=0; i<360; i+=5)
{
draw_vertex_texture(x,y,0,0)
draw_vertex_texture(x+lengthdir_x(16,i),y+lengthdir_y(16,i),0,0)
}
draw_primitive_end()
when i don't use the texture part it will show a black circle, but this doesn't show anything...
#6
Posted 03 March 2012 - 08:01 AM
draw_set_color(c_white) // have to set color to white, as one have to do in 3d mode
draw_primitive_begin_texture(pr_trianglestrip,sprite_get_texture(Apple_spr,0))
for (i=0; i<=360; i+=5)
{
draw_vertex_texture(x,y,.5,.5) // center of the texture is at (.5,.5) top left is (0,0) .. while bottom right is (1,1)
draw_vertex_texture(x+lengthdir_x(32,i),y+lengthdir_y(32,i),.5+lengthdir_x(.5,i+1),.5+lengthdir_y(.5,i+1))
// so for texture you kinda have to draw a circle that got the center at (.5,.5) with a radius of .5
}
draw_primitive_end()hope that made sence ^^
#7
Posted 03 March 2012 - 09:32 AM
thank you
and for xtex and ytex it is 0.5 as you said for 100% of the sprite's width/height
now i understand it all :D thx
and for xtex and ytex it is 0.5 as you said for 100% of the sprite's width/height
now i understand it all :D thx
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











