Skip to main content

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

Hi, I am on 2024.6.1 but it didn't work at first.
I had to put the "UI" object manually in the first room and delete the lines

// Check if UI object exists, if not create it
if (!instance_exists(UI)) {
   var _id = room_instance_add(room_first, -1, -1, UI);
}

when I didn't delete those lines, I had two "UI" objects, one had not variables/functions at all in it. And that one was trying to be referenced by other objects.

I am not shure, but those lines are in a script, when this gets executed, is it possible that there are instances already created? I think they are executed before any instances are created, so checking if an instances exists makes no sense?

Hi and thanks for using the library.

What gooey version are you on? I reckon 2024.6, over Gamemaker's 2024.6.1, right?

In any case, it seems there is indeed a bug when you try to use a UI widget in the same frame as creating the gooey object automatically. Given there's been an Scribble update just today, I've gone ahead and released 2024.7, which should fix the above. Can you please try and let me know if it works?

Thanks

(5 edits)

Thanks for your reply,

yes I was on gooey 2024.6 / Gamemaker 2024.6.1, just downloaded gooey for the first time the other day. I was trying out some other libraries before and gooey was the first one that (almost) worked without bugs on the first try and was the only one I could understand good enough to fix things myself. So thanks for making gooey :)

I tried gooey 2024.7 and now it works out of the box, thanks.

When I built my first UI a ran into some minor problems:
I made a panel, added a grid and added buttons +extra sprites on the left and UIText on the right column. When I try to make the text left-aligned it looks like this:

It places the text on the left side on the cell, but the text itself is centered.
So I wanted to change the _text_format of the UIText to "[fa_left][fa_middle]", but UIText has no _text_format property and no setTextFormat method. As a workaround I can set it back to UI_RELATIVE_TO.MIDDLE_CENTER, or is there another possibility/approach I don't see?

So my current wishes for gooeys future are:
- "setTextFormat" method for every element that has text
- extra "secondary" sprite for buttons (for icons instead of text on buttons independend of the button sprite itself)
- "setScaleMouseover", "setScaleClick"... for buttons
[EDIT] - window_set_cursor does not work reliable, so for now an option to disable it would be nice  found the configurations
- The YT video is great but a example project would be great for starting out

Of course I can try to implement it myself, but that would only make sense if I would use your repo and I am not very experienced with GIT...

Hi and thanks!

Not entirely sure of what are you trying to do with UIText. However, I *think* you are trying to create a button that has an icon and text on it, right?

If so, you can easily do this with the UIButton and leveraging Scribble's inline images:

on mouseover:


However, in case you *do* want to use UIText for other uses (for example, for creating a text label to display the price of the upgrade, on the right grid cells) you can use it:

Indeed, the UIText does *not* currently have a .setTextFormat() method (I will consider adding it or at least mentioning it in the docu, however the text string itself can be formatted with any Scribble tag. For example:

Note also that this formatting is independent of the position of the UIText within the grid cell, which you can control using the relative_to argument when creating the UIText element.


Here's a sample project with all the code.

Hope it helps, let me know,

Thank you very much, this helped me a lot.
Yes you are right, I wanted Button with a sprite and text, I didn't think about scribbles inline sprites, that was exactly the hint I needed. Now it looks like I wanted it:

Now I can continiue prototyping before I begin to tackle the next UI challenges like scrolling and Tooltips.
I already took a look at your scrolling example you posted in the comments, I am excited to see if I can make a working scrollbar, too.

Glad to know! That game prototype is looking sick!

Thanks, although theres not much to see yet.
I think I fould a little mistake in your code:
self.setSurface = function(_color)            { self.__background_color = _color; return self; }

Yep, that's a blunder! Thanks for pointing it out. Obviously it should be:

self.setSurface = function(_surface)			{ self.__surface_id = _surface; return self; }

I will release a small fix soon.