Skip to content

Commit

Permalink
Fixed web fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
nemene21 committed Jul 6, 2024
1 parent a795433 commit 74071aa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion build/shell.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@
overflow: hidden;
background-color: black;
}
canvas.emscripten { border: 0px none; background-color: black;}
canvas.emscripten {
border: 0px none; background-color: black;
display: block;
width: 100vw;
height: 100vh;
}
</style>
<script type='text/javascript' src="https://cdn.jsdelivr.net/gh/eligrey/FileSaver.js/dist/FileSaver.min.js"> </script>
<script type='text/javascript'>
Expand Down
Binary file added build/web_build/export.zip
Binary file not shown.
1 change: 1 addition & 0 deletions src/framework/framework.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

// Misc
#include <misc.hpp>
#include <input.hpp>

// Component/entity/scene
#include <entity.hpp>
Expand Down
2 changes: 2 additions & 0 deletions src/framework/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Vector2 mouse_screen_pos() {
draw_width = GetScreenHeight() * (res.x / res.y);
}

std::cout << draw_width << ", " << draw_height << std::endl;

Vector2 pos = GetMousePosition();
pos.x = (pos.x / draw_width ) * res.x;
pos.y = (pos.y / draw_height) * res.y;
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <scenes/game.hpp>

int main() {
Framework::init("ne_mene's framework", {320, 180}, 4);
Framework::init("ne_mene's framework", {320, 180}, 2);

new GameScene();
SceneManager::set_scene("game_scene");
Expand Down

0 comments on commit 74071aa

Please sign in to comment.