Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hello again Yal! This time i'm back with more general questions that I can't seem to figure out yet. 

I'm using the framework of msh_spawn_inventory and how it conveniently lets players tab through multiple pages. The way i'm trying to use it, I need certain items to be different font colors but I cant seem to figure out how as this  uses ggui_fill_arbtext. any advice appreciated :) 

Also, could you give tips on how we might be able to display animated sprites within the menus/cutscenes. They all seem static from what I can tell. 


Thanks so much as usual! 

Let's start with the easy bit, animated sprites. Just create a GGUI sprite element with the subimage set to -1, and it should work (draw_sprite uses the current animation subimage of the object if you draw a sprite with subimage -1, and sprite elements are drawn with draw_sprite passing through all parameters as-is). Potentially you might need to give the menu object an animated sprite as well (by assigning sprite_index) but I think it'll work even without it.


Now for "certain items with a different color": It's a bit unclear what you mean by "items" here? Items in the inventory or GGUI elements?

The idea with (Scrollable) Arbitrary Text elements is that you have a text field that reads data from the currently highlighted menu item rather than being a preset text (they're "arbitrary" as opposed to the Description field which originally was the only per-element-changeable text, and hardcoded text strings - I added the arbitrary text fields because I realized sometimes you need more than one per-element text field).

So basically, the element itself has no text, just a reference to the Arbitrary Text Array for that menu. But the Arbitrary Text Element owns the formatting (font, color, alignment) so by default, it can't change depending on what's highlighted - you'll need to make a new type of element which accesses an array of both text and formatting information (studying how gguielt_ARBTEXT works internally and copying the behavior for a new gguielt_ARBTEXTWITHFORMATTING might help here - you'd use an array similar to menu_arbtxt but rather than just storing text, you'd store a tuple [text, font, color, halign, valign]).

But if you just want different fields to be different colors (e.g. HP is red, money is yellow) it's very simple, use ggui_element_text_settings to change formatting parameters (all further text elements are created using these settings until you change them again).

Thanks Yal :D The frames do animate at -1, but it seems to animate very fast. (maybe 60 fps fast? lol) any thing we can do to set the speed? 

(+1)

Hmm, I guess this is a side effect of the menu not having a sprite, so it doesn't use the sprite's animation speed... welp, it's easy to fix at least.

Set image_speed to a value lesser than 1 from the menu object's perspective (i.e. inside the block that starts with the "with(instance_create_depth(...obj_gguimenu)" call).

I find values between 0.1 and 0.2 work the best for legacy sprites that default to 60 fps, so start off with 0.15 and adjust as needed until you're happy with the result?