GUI Issues


#1

Hello,

I am trying to implement a HUD for a game using the Anura engine, but I have stumbled on a couple of issues:

  1. How do I make hearts be animated? I gave animations like “heart_full” and “heart_half” 4 frames and a duration of 6, but only the first frame of the heart graphics I’m using appears. Is it impossible to make a non-static graphic through draw_animation?

  2. How do I change the graphics used by the numbers in the gold HUD (draw_number function)? In Frogatto, the /gui/number-font-scrolling.png numbers seem to be used, but this file isn’t referenced anywhere, and creating a file with the same name in a different module doesn’t change the graphics used by the numbers, either.


#2

I suggest you get on IRC; we’re regularly on irc.freenode.net, in the channel #frogatto. http://webchat.freenode.net/ is one way to do so if you’re not familiar with IRC (never can tell if people will be, tbh).

I don’t know the answers to these questions in particular, though I’ve worked with the HUD a decent amount; these are two things I haven’t yet tried to do. We’re usually on during USA evenings, though there’s a pretty big crowd in there all the time. Do try to stay on as long as you can - we’d be an invaluable source of information, and it’s always a bit tragic when someone asks a question, disappears an hour later, and then I get back and there’s no way for me to contact them with the answer to their question.

I can safely say that we’d like the engine to be capable of both of the items you want. Krista’s got a new widget system she wants us to replace the current HUD with, and what you want to do with your HUD might be a great guinea pig, if you’re using the latest anura.


#3

For the record, here is how the resulting conversation on IRC went.
[hr]
[02:22:54] I am having some issues implementing a HUD in the Anura engine
[02:23:18] I posted in the forums and Jetrel answered recommending me to come here and ask about it
[02:24:23] I had two issues. The first one was that I couldn’t get HUD animations like heart_full or heart_half to be animated
[02:24:56] Is it impossible to create non-static HUD animation through draw_animation?
[02:26:42] I am using the Anura executable that comes with Frogatto 1.3
[02:28:06] roSievers1 [~rolf@vpn-3108.gwdg.de] has joined #frogatto
[02:29:36] roSievers [~rolf@ersc136.goemobile.de] has quit IRC: Ping timeout: 240 seconds
[02:29:39] Hm. I don’t actually have too much experience with the HUD stuff. :confused:
[02:30:29] Our resident experts, Jetrel and/or Sirp, probably have been asleep for a few hours.
[02:32:56] Ah ok, thanks anyway :slight_smile:
[02:34:06] A possible work-around I can suggest is to set use_absolute_screen_coordinates: true in an object; and then use that object like a UI element. (I think it’s a touch more flexable, too, though I’m not sure.)
[02:35:19] The use_absolute_screen_coordinates thing just means it’s drawn relative to the upper-left corner of the window, not relative to the point of origin of the level.
[02:36:43] Dearon [~Dearon@g198193.upc-g.chello.nl] has joined #frogatto
[02:36:51] Thanks! I’ll try that
[02:37:21] Good luck! I’m like 90% sure that’s in 1.3.
[02:38:30] The second issue I’m having is with replacing the graphics for the “gold” numbers. In Frogatto they seem to be located in /gui/number-font-scrolling.png, but I couldn’t find any references to that file, and adding a similarly named file to my module doesn’t work for changing those graphics, either.
[02:38:42] Do you have any idea on how to solve that?
[02:40:11] Let me have a look, here…
[02:43:39] Andrettin: those gold-“slot machine” style numbers in the HUD are currently still a hard-coded thing in the engine, dating from time immemorial.
[02:44:14] Andrettin: however, I’ve definitely got it pegged as a feature for the upcoming v4 that we’re going to replace them with something (anything) that’s done in FFL; probably via a widget.
[02:44:39] So, no, you can’t customize them “as-is”, but the whole system is going to replaced, and that replacement, you will be able to customize.
[02:44:52] Andrettin: we expect to be doing this fairly soon - within the next month or two.
[02:46:12] I believe the engine code is already in-place to do this, I just haven’t had the time, myself, to replace what we’ve got because I’m really the “only guy doing full-time work on, specifically, frogatto itself”, so I’ve got a bunch of more content-driven stuff I want to tie off before I start attacking that.
[02:46:19] ~/anura/modules/frogatto/data/gui/hud.cfg:28 seems to direct the drawing of the number font, but as Jetrel says, it’s ancient and not very configurable.
[02:46:33] Thanks, Jetrel! That sounds quite good :slight_smile:
[02:46:57] (We’ve got at least 2+ people hacking away and doing awesome things on anura, but as far as content-creation goes for frogatto, it’s “1+”, and I’m the “1”.)
[02:47:22] Andrettin: so, KristaS is probably the person who really knows what you’d need to do to replace this.


#4

Any news on this issue (whether the engine has been modified to make the HUD more configurable)?


#5

The GUI has been rewritten for the next version, it should be considerably easier to figure out now. It used to be more of a configuration of the gui the engine rendered, but now it’s a configuration of the in-game objects the engine renders.