Skip to main content

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

Thanks so much for sharing this awesome UI framework for free. Saves me a ton of work and it functions intuitively and is quite stable.

One thing I want to share is that it seems UIGrid.scroll doesn't move the children in cells. The cell groups themselves move (I can see that with setShowGridOverlay), but the children stay where they are initially placed.


For others struggling with this: I've made this (temporary) workaround that hotfixes the problem. Call it on the grid you want to scroll with the same parameters you would give to the .scroll method:

function ui_grid_scroll(_ui_grid, _orientation = UI_ORIENTATION.HORIZONTAL, _sign = 1, _amount = UI_SCROLL_SPEED)
{
    // Just this scrolls the cell groups, but their children aren't updated. BUG?
    _ui_grid.scroll(_orientation, _sign, _amount)
    
    // HOTFIX that triggers the children to update to their correct position
    var _children = _ui_grid.getChildren()
    
    for (var _i = 0; _i < array_length(_children); _i++) {
        var _child = _children[_i]
        
        _child.scroll(_orientation, _sign, 0)
    }    
}

Thanks so much for the compliments, I'm glad to hear it's being useful!

I will check this and fix it if necessary, as soon as I can. One question, are your child elements in the grid cells UIPanels (as commented in the other question above)?

Heya :)

No the UIGrid did not contain any UIPanels, however the structure was somewhat complex:

  • UIPanel
    • UIGrid (2 rows, 1 column)
      • UIGrid in 1st row (1 row, 3 columns - column definitions [1, 1, 1])
        • UIButton (column 1)
        • UIButton (column 2)
        • UIButton (column 3)

Sadly I can't share a minimal, reproducible example atm since a lot of the code is intertwined with custom functions and little time to extract it.

(+1)

Hi, just to let you know, I just published 2024.1 version which hopefully fixes the scrolling bug.