reelSet.getCellBounds(reel, cell) returns the screen rect of a visible cell. Paylines, win outlines and hit areas are all drawn from it, so they line up with the symbols. The engine itself draws no paylines. For a banner reel above the grid, see Sideways and upward reels.
Cell rects#
The rect of any visible cell, used here to outline cells and draw a line through them.
Loading recipe…
Paylines#
From win events#
WinPresenter animates the winning symbols and draws nothing else. Subscribe to win:group and draw each line from getCellBounds. win:symbol fires per winning symbol, for anything drawn per cell.
Loading recipe…
With WinLines#
WinLines from pixi-reels/debug draws the cells it is given. A payline is one stroke through one cell per reel. A payway joins every winning cell to every winning cell on the next reel. The demo alternates: one spin pays ten fixed lines and draws each as the presenter reaches it, the next pays ways and draws all of them at once.
Loading recipe…
Tappable cells#
One pointer target per cell, built from getCellBounds. Hover previews a cell, a click toggles a pick, and picks stay through spins.
Fill the hit rect with alpha 0 rather than setting visible = false. A transparent filled rect still receives pointer events; a hidden one does not.
Loading recipe…
Horizontal sets#
Rects#
getCellBounds(reel, cell) takes the same arguments on either axis, and (0, 0) is still the first cell of the first reel. The rect it returns is transposed: on a horizontal set the reel index goes down the screen and the cell index goes across it.
So a line through the same cell index on every reel runs vertically here, where the same code draws a horizontal line on a vertical set. Read the rects instead of working them out from the indices.
Loading recipe…
Hit areas#
The same loop over reels and cells as the vertical demo, with no orientation check. The rects are already in screen space, so the hit areas sit on the symbols either way.
Loading recipe…