Skip to content

Commit

Permalink
use set_view instead of set_windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AGulev committed Sep 21, 2021
1 parent f3fe82c commit 084ded1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ Add the latest dependency URL from the
[releases page](https://github.com/subsoap/defos/releases) to your
dependencies field in `game.project`.

## game.project
## game.project

> (From Defold 1.2.188)
It's possible to change the initial window size and position by changing `game.project`. Just open `game.project` in a text editor and add the following lines:

```
[defos]
window_width = 640
window_height = 480
window_x = 20
window_y = 40
view_width = 640
view_height = 480
view_x = 20
view_y = 40
```

It's possible use `window_width` and `window_heigh` without `window_x` and `window_y` but not vice versa.
It's possible use `view_width` and `view_height` without `view_x` and `view_y` but not vice versa.

## Methods

Expand Down
4 changes: 2 additions & 2 deletions defos/src/defos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,11 @@ dmExtension::Result InitializeDefos(dmExtension::Params *params)
{
if (window_x != -1.0 && window_y != -1.0)
{
defos_set_window_size(window_x, window_y, window_width, window_height);
defos_set_view_size(window_x, window_y, window_width, window_height);
}
else
{
defos_set_window_size(nanf(""), nanf(""), window_width, window_height);
defos_set_view_size(nanf(""), nanf(""), window_width, window_height);
}
}

Expand Down
6 changes: 3 additions & 3 deletions game.project
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ bundle_identifier = com.subsoap.defos
bundle_identifier = com.subsoap.defos

[defos]
window_width = 640
window_height = 480
window_x = 20
window_width = 800
window_height = 600
window_x = 60
window_y = 40

0 comments on commit 084ded1

Please sign in to comment.