Closed eight04 closed 4 years ago
@eight04 Thank you for your request.
In v1.1.0, I added Mino
class that more flexible object than operation
and changed returning placed mino at Field::fill(), Field::put()
.
so you can write your sample as follows:
const pages = decoder.decode(data);
const field = pages[0].field.copy();
const changed = field.fill(pages[0].operation); // `changed` is mino object as like `operation`
for (let y = 0; y < 20; y++) {
for (let x = 0; x < 10; x++) {
myCanvas.draw(x, y, field.at(x, y));
}
}
for (const {x, y} of changed.positions()) {
myCanvas.lighten(x, y);
}
If you have no problems, please close the issue.
Here is the tool: https://github.com/eight04/fumen-svg
I'll probably build a server as an API.
I'd like to draw the current operation with a lightened color. I need the position after the piece is filled in the field. Example:
Maybe we can also add this feature to
field.put
?