Function MultiboardSetItemColorBJ
- Line
- 6286
- Location
- blizzard.j
- Constant?
- no
- Type
- function
- Arguments
- multiboard mb, integer col, integer row, real red, real green, real blue, real transparency
- Returns
- nothing
| 6286 | function MultiboardSetItemColorBJ takes multiboard mb, integer col, integer row, real red, real green, real blue, real transparency returns nothing |
| 6287 | local integer curRow = 0 |
| 6288 | local integer curCol = 0 |
| 6289 | local integer numRows = MultiboardGetRowCount(mb) |
| 6290 | local integer numCols = MultiboardGetColumnCount(mb) |
| 6291 | local multiboarditem mbitem = null |
| 6292 | |
| 6293 | // Loop over rows, using 1-based index
|
| 6294 | loop
|
| 6295 | set curRow = curRow + 1 |
| 6296 | exitwhen curRow > numRows |
| 6297 | |
| 6298 | // Apply setting to the requested row, or all rows (if row is 0)
|
| 6299 | if (row == 0 or row == curRow) then |
| 6300 | // Loop over columns, using 1-based index
|
| 6301 | set curCol = 0 |
| 6302 | loop
|
| 6303 | set curCol = curCol + 1 |
| 6304 | exitwhen curCol > numCols |
| 6305 | |
| 6306 | // Apply setting to the requested column, or all columns (if col is 0)
|
| 6307 | if (col == 0 or col == curCol) then |
| 6308 | set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1) |
| 6309 | call MultiboardSetItemValueColor(mbitem, PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100.0-transparency)) |
| 6310 | call MultiboardReleaseItem(mbitem) |
| 6311 | endif
|
| 6312 | endloop
|
| 6313 | endif
|
| 6314 | endloop
|
| 6315 | endfunction
|