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.
Thanks for playing it and your comments. I used a version of the OPTED dictionary and tweaked it.
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,
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
Hi and thanks for using the library! Hope it's useful.
You can use the .setTextFormat() method to fix it:
var _textbox = new UITextBox("Test_Textbox", 80, 30, 150, 50, grey_button08); _textbox.setTextFormat("[fa_left][fa_top][c_black]").setPlaceholderText("Hello World"); _panel.add(_textbox);
Full code for example above:
var _panel = new UIPanel("Test", 40, 40, 300, 400, yellow_panel); _panel.setTitleFormat("[fa_center][fa_top][c_black]").setTitle("NEW GAME"); var _label = new UIText("Test_SeedText", 30, 30, "[fa_left][fa_top][c_black]Seed: "); _panel.add(_label); var _textbox = new UITextBox("Test_Textbox", 80, 30, 150, 50, grey_button08); _textbox.setTextFormat("[fa_left][fa_top][c_black]").setPlaceholderText("Hello World"); _panel.add(_textbox); var _button = new UIButton("Test_Button", 0, -20, 280, 40, "Start game", yellow_button00, UI_RELATIVE_TO.BOTTOM_CENTER); _button.setCallback(UI_EVENT.LEFT_RELEASE, function() { show_message(UI.get("Test_Textbox").getText()); }); _panel.add(_button);
Let me know if there's anything else I can help with!
I just tested in on mobile and it should work. You can:
There's a bug I found where clipped grid elements are still being taken into consideration for mouseover purposes. I'll fix that when I can.
Hi, hope you're fine!
I have published a 2024.1 version which (hopefully) fixes the scroll bug. I also updated the online documentation and generated an offline version of the HTML documentations (you can download it as well).
With this version, using a somewhat "creative" approach, you'll be able to create a scrollable grid like so:
Test code is as follows:
if (!UI.exists("LevelSelectPanel")) { var _num_levels = 30; var _columns = 3; var _panel = new UIPanel("LevelSelectPanel", 500, 200, 500, 500, blue_panel, UI_RELATIVE_TO.MIDDLE_CENTER); _panel.setTitle("Level Select").setTitleAnchor(UI_RELATIVE_TO.MIDDLE_CENTER); var _container = new UIGrid("ContainerGrid", 2, 1); _container.setRowProportions([0.2, 0.8]); _container.setShowGridOverlay(true); _container.getCell(1,0).setClipsContent(true); var _cnt = _container.addToCell(new UIGroup("GridContainer", 0, 0, 500, 1500, red_panel), 1, 0); var _grid = new UIGrid("LevelsGrid", _num_levels div _columns, _columns); _grid.setSpacingHorizontal(20).setSpacingVertical(20).setMarginLeft(50).setMarginRight(50).setMarginTop(10).setMarginBottom(10); for (var _level = 0; _level < _num_levels; _level++) { var _button = new UIButton("Level"+string(_level+1), 0, 0, 0, 0 , "Level "+string(_level+1), blue_button00, UI_RELATIVE_TO.MIDDLE_CENTER); _button.setInheritWidth(true).setInheritHeight(true).setCallback(UI_EVENT.LEFT_RELEASE, method({level: _level}, function() { show_message("You selected level "+string(level+1)); })); _grid.addToCell(_button, _level div _columns, _level % _columns); } _container.addToCell(_cnt, 1, 0); _cnt.add(_grid); _panel.add(_container); } if (keyboard_check(vk_down)) UI.get("ContainerGrid").getCell(1,0).scroll(UI_ORIENTATION.VERTICAL, -1, 5); if (keyboard_check(vk_up)) UI.get("ContainerGrid").getCell(1,0).scroll(UI_ORIENTATION.VERTICAL, 1, 5);
Hope you find it useful!
Hey, I apologize for the delay. Currently, documentation in HTML format is only available online. However, HTML documentation is generated automatically from the JSDoc comments on the Gamemaker script itself (above each function/method), using another tool I wrote named GMLDocMaker. So, this means that all documentation is essentially inside the gooey script. You can use the find functionality (or middle click a function name in Gamemaker) and it will show you the explanation.
If you still need the offline documentation I could try to generate an offline version in a format like PDF or so. It won't be pretty, but it might work.
Let me know if I can further help!
Hi again,
UIPanels are not meant to be nested (at least I didn't design it that way!), so I'm interested in your use case for that and how are you implementing it. I can see you would have problems destroying them, but there might be other things that don't work as you think, just because again, when I thought about UIPanels I always conceived them as top-level widgets.
It would be really useful if you could share your code and/or images to see how you are using them nested.
Best,
manta ray
Hi, regarding the library import, can you please post the exact error? What do you mean by "installing" the local package? You should import it into your project by using Tools > Import Local Package instead.
Regarding the demo project, I actually saved it in 2023.8 by mistake, so that's why you couldn't open it (you seem to be using a 2022 Gamemaker version). I uploaded the LTS version of the YYZ demo project. Hope it helps!
Thanks for your kind comments. The game is 540x960, I didn't have time to implement dynamic resolution. Did you fullscreen it to make it work?
Web build eventually loads, it takes a long time though because of the level backgrounds.
Options menu is not implemented, and I actually removed it on the web build.
In general the last three days of the jam period I was away on a business trip, so I didn't have enough time :)
Thanks :)
Hi, there's currently no click-through method for elements. What I'm doing to circumvent this in my games is I'm setting the LEFT_RELEASE callback of the sprite and calling the button callback:
with (_panel.add(new UISprite("YourSprite", _x, _y, _w, _h, _spr, 0))) { setCallback(UI_EVENT.LEFT_RELEASE, function() { var _f = UI.get("YourButton").getCallback(UI_EVENT.LEFT_RELEASE); _f(); }); }