Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Thanks for the reply manta ray! I will look into the GMLDocMaker that you wrote. 

Is it possible to make the items in the grid scrollable from within the panel? I.e. level select buttons? Seems like the buttons I'm making are getting compressed to the panel size.

(1 edit)

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!


Thank you for the quick reply, fix, and demo! I'm having a hard time trying it out because the buttons get scaled strangely (I've had this happen a few times now when dragging the panel)

Can you send me your project or object code?

I'm running it on mobile (android), does that make a difference?

I can send you something, whats the best way to send?

I just tested in on mobile and it should work. You can:

  • upload it somewhere then paste the link here
  • log in to Discord and contact me (manta.ray) (mantaray#2771)
  • send it to biyectivo@gmail.com

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.