Conectar-se
Quem está conectado
38 usuários online :: Nenhum usuário registrado, Nenhum Invisível e 38 Visitantes

Nenhum

Ver toda a lista


Compartilhe
Ir em baixo
avatar
Data de inscrição : 15/08/2010
Número de Mensagens : 1599
Insígnias de JAM :

Insignia 1x 0 Insignia 2x 0 Insignia 3x 0
Reputação : 147

Prêmios
   : 0
   : 0
   : 0
Ver perfil do usuáriohttp://spyreserver.16mb.com

Ajuda com surfaces

em Ter 14 Out 2014, 03:43
Bom, criei um sistema que "gera" sprites a partir de partes, a logica e a seguinte:

1: desenho as partes bem posicionadas (cabeça, corpo, pes, etc...) em uma surface.
2: transformo a surface em um sprite.
3: surface_free()

mais ta avendo um erro... parece que mesmo que eu crie varias surfaces, elas sao desenhadas umas em cima das outras...

Alguem pode me ajudar a resolver?

Eis o codigo que uso:

CODE:

Código:
count=0
//if(frame=0){
_AS[count]=surface_create(71,100) surface_set_target(_AS[count])//draw_clear(c_purple)
draw_sprite_ext(cabeca[0,0],-1,35+3,99+-71,-1,1,0,cabeca[0,1],1)
draw_sprite_ext(cabelo[0,0],-1,35+3,99+-71,-1,1,0,cabelo[0,1],1)
draw_sprite_ext(chapeu[0,0],-1,35+3,99+-71,-1,1,0,chapeu[0,1],1)
draw_sprite_ext(olho[0,0],-1,35+3,99+-71,-1,1,0,olho[0,1],1)
draw_sprite_ext(oculos[0,0],-1,35+3,99+-71,-1,1,0,oculos[0,1],1)
draw_sprite_ext(boca[0,0],-1,35+3,99+-71,-1,1,0,boca[0,1],1)

draw_sprite_ext(corpo[0,0],-1,35+0,99+-34,1,1,0,corpo[0,1],1)

draw_sprite_ext(pes[0,0],-1,35+6,99+-8,1,1,0,pes[0,1],1)

draw_sprite_ext(pes[0,0],-1,35+-5,99+-8,1,1,0,pes[0,1],1)

surface_reset_target()
sprite[count]=sprite_create_from_surface(_AS[count],0,0,500,500,1,0,0,0)
surface_free(_AS[count])
count+=1
//}//if(frame=1){
_AS[count]=surface_create(71,100) surface_set_target(_AS[count])//draw_clear(c_purple)
draw_sprite_ext(cabeca[0,0],-1,35+3,99+-74,-1,1,0,cabeca[0,1],1)
draw_sprite_ext(cabelo[0,0],-1,35+3,99+-74,-1,1,0,cabelo[0,1],1)
draw_sprite_ext(chapeu[0,0],-1,35+3,99+-74,-1,1,0,chapeu[0,1],1)
draw_sprite_ext(olho[0,0],-1,35+3,99+-74,-1,1,0,olho[0,1],1)
draw_sprite_ext(oculos[0,0],-1,35+3,99+-74,-1,1,0,oculos[0,1],1)
draw_sprite_ext(boca[0,0],-1,35+3,99+-74,-1,1,0,boca[0,1],1)

draw_sprite_ext(corpo[0,0],-1,35+0,99+-37,1,1,0,corpo[0,1],1)

draw_sprite_ext(pes[0,0],-1,35+14.50,99+-12,1,1,27.01,pes[0,1],1)

draw_sprite_ext(pes[0,0],-1,35+-15.50,99+-14,1,1,316.81,pes[0,1],1)

surface_reset_target()
sprite[count]=sprite_create_from_surface(_AS[count],0,0,500,500,1,0,0,0)
surface_free(_AS[count])
count+=1
//}//if(frame=2){
_AS[count]=surface_create(71,100) surface_set_target(_AS[count])//draw_clear(c_purple)
draw_sprite_ext(cabeca[0,0],-1,35+3,99+-74,-1,1,0,cabeca[0,1],1)
draw_sprite_ext(cabelo[0,0],-1,35+3,99+-74,-1,1,0,cabelo[0,1],1)
draw_sprite_ext(chapeu[0,0],-1,35+3,99+-74,-1,1,0,chapeu[0,1],1)
draw_sprite_ext(olho[0,0],-1,35+3,99+-74,-1,1,0,olho[0,1],1)
draw_sprite_ext(oculos[0,0],-1,35+3,99+-74,-1,1,0,oculos[0,1],1)
draw_sprite_ext(boca[0,0],-1,35+3,99+-74,-1,1,0,boca[0,1],1)

draw_sprite_ext(corpo[0,0],-1,35+0,99+-38,1,1,0,corpo[0,1],1)

draw_sprite_ext(pes[0,0],-1,35+21.50,99+-28,1,1,48.21,pes[0,1],1)

draw_sprite_ext(pes[0,0],-1,35+-23,99+-26,1,1,287,pes[0,1],1)

surface_reset_target()
sprite[count]=sprite_create_from_surface(_AS[count],0,0,500,500,1,0,0,0)
surface_free(_AS[count])
count+=1
//}//if(frame=3){
_AS[count]=surface_create(71,100) surface_set_target(_AS[count])//draw_clear(c_purple)
draw_sprite_ext(cabeca[0,0],-1,35+3,99+-73,-1,1,0,cabeca[0,1],1)
draw_sprite_ext(cabelo[0,0],-1,35+3,99+-73,-1,1,0,cabelo[0,1],1)
draw_sprite_ext(chapeu[0,0],-1,35+3,99+-73,-1,1,0,chapeu[0,1],1)
draw_sprite_ext(olho[0,0],-1,35+3,99+-73,-1,1,0,olho[0,1],1)
draw_sprite_ext(oculos[0,0],-1,35+3,99+-73,-1,1,0,oculos[0,1],1)
draw_sprite_ext(boca[0,0],-1,35+3,99+-73,-1,1,0,boca[0,1],1)

draw_sprite_ext(corpo[0,0],-1,35+0,99+-37,1,1,0,corpo[0,1],1)

draw_sprite_ext(pes[0,0],-1,35+16.50,99+-18,1,1,30.55,pes[0,1],1)

draw_sprite_ext(pes[0,0],-1,35+-18.50,99+-18,1,1,304.11,pes[0,1],1)

surface_reset_target()
sprite[count]=sprite_create_from_surface(_AS[count],0,0,500,500,1,0,0,0)
surface_free(_AS[count])
count+=1
//}

meio bagunçado, mais e pq eu uso um outro aplicativo para gerar o codigo todo...

[edit]
eu ja tentei arrumar de diversas formas, mais, nao deu certo. como podem ver, algumas linhas foram transformadas em comentario, isso, devido as minhas tentativas de arrumar isso...
Voltar ao Topo
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum