-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tamaño automatico de canvas #134
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #134 +/- ##
=======================================
Coverage 85.63% 85.63%
=======================================
Files 9 9
Lines 696 696
Branches 161 161
=======================================
Hits 596 596
Misses 100 100 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grosooo! 🎉
Ahí dejé algunos comments.
var positionX = | ||
visuals[i].position.x * cellPixelSize * (windowWidth / widthGame) | ||
var y = windowHeight - 20 - visuals[i].position.y * cellPixelSize | ||
var positionX = visuals[i].position.x * cellPixelSize | ||
var y = gameHeight - visuals[i].position.y * cellPixelSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acá es dónde pasa la magia? Se podría poner en una función y testear?
widthGame = size[0] | ||
gameWidth = size[0] | ||
gameHeight = size[1] | ||
resizeCanvas(gameWidth, gameHeight) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acá me perdí un toque, este size
es el size del game o del canvas de la pantalla?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hola, size es un parámetro que viene desde al backend y representa el ancho y alto del juego (calculado por wollok-ts)
Este PR implementa el tamaño automático del canvas, basado en la cantidad y tamaño de las celdas
Nota: la primera vez que se abre el juego, el canvas ocupa toda la pantalla, esto se corrige en el PR #132
Closes #131