I think some screen shots would help. Are you getting an error message, or it’s just not doing what you want? What is the modified code?
The “scrolling text marquee 2D” pattern looks upright on my mapped panels. It’s possible that your map is upside down in the mapper. The multi panel mapper pattern makes it pretty easy to rotate each panel (and you can make a single one if you like). Pay special attention to the racing dots to ensure they follow the LED wiring.
If that’s still giving you trouble, this one liner will take a 2D map
array and flip the y axis, add it just before the return map
line:
map = map.map(([x,y]) => [x,-y])
You can even do this to your JSON map if you save it to a variable first, e.g.:
function (pixelCount) {
var map = [
[1,2],...
];
map = map.map(([x,y]) => [x,-y])
return map
}
If in the end you just want to flip the scrolling text pattern, you can change line 99 to this:
row = matrixRows-1-floor(y * matrixRows)
With either that or the map one liner, on my panel here the text is still scrolling from left to right, but is upside down and both cancel each other out and it’s upright again.
This isn’t something you should need to do, especially for a matrix in a fixed configuration. The pixel map describes how the pixels are physically arranged which doesn’t change (except perhaps with something like this).
The mapper type code only works on the editor on the mapper tab. However, if you really want to, you can write your own index to coordinate lookup system in a pattern and implement anything you want. To do that, you wouldn’t implement render2D
or render3D
, instead doing the coordinate work in a render
function. Something like this:
var myMap = [
[1,2],
[2,3],
//...
]
export function render(index) {
var x = myMap[index][0]
var y = myMap[index][1]
//...
}
In this case your (x,y)
comes from the map directly, no normalization is done and it’s in whatever units you defined.