get image by name (from fpg)

Started by Grew, July 24, 2015, 08:41:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Grew


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/

panreyes

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:

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)

SplinterGU

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