Autor Tema: get image by name (from fpg)  (Leído 1596 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado Grew

  • Full Member
  • ***
  • Mensajes: 123
  • Karma: 3
    • Ver Perfil
get image by name (from fpg)
« en: Julio 24, 2015, 12:41:16 pm »

Hi.I suggest a function that returns the graph number from the name of it (the name you can see in the FPg editor).
For exemple :


graph = "my_graph_name";


Bennu automatically search the identifier of the graph in the GIF assigned to the process.


Wouldn't that be wonderful? :)
My game developer instagram :
https://www.instagram.com/ben_dev_game/

Conectado panreyes

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 2007
  • Karma: 64
  • Sexo: Masculino
    • Ver Perfil
    • panreyes.com
Re:get image by name (from fpg)
« Respuesta #1 en: Julio 24, 2015, 03:49:38 pm »
It could be, but it could also be terrifyingly slow and unoptimized.

If you're interested in something like that, I recommend you to create a function to sort it out.

It would be something like this:
Código: [Seleccionar]
function graph_me(int file,string name);
begin
 father.file=file;
 from x=1 to 999;
  if(map_exists(file,x))
   if(MAP_GET_NAME(file,x)==name)
    return x;
   end
  end
 end
 return 0;
end

Process something();
Begin
 graph_me(fpg_character,"stand1");
End

But.... there's no function to retrieve the name of the graphic from the FPG, so that way won't directly work (I think)

Desconectado SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12457
  • Karma: 367
  • Sexo: Masculino
    • Ver Perfil
Re:get image by name (from fpg)
« Respuesta #2 en: Julio 28, 2015, 05:25:14 am »
maybe a function like "map_get_by_name" or "map_get" or "map_find", that use "name" as parameter...
Download Lastest BennuGD Release: http://www.bennugd.org/node/2