-
Notifications
You must be signed in to change notification settings - Fork 5
STANNcam Manager
To start using STANNcam I recommend creating a new dedicated persistent camera object, or you can also use any Persistent manager object you have.
Initializes stanncam with different resolutions.
Argument | Type | Description |
---|---|---|
game_w | Integer |
The width of the actual game, this will be scaled up to match the resolution |
game_h | Integer |
The height of the actual game, this will be scaled up to match the resolution |
[resolution_w] | Integer |
The window resolution width Default: same as game_w
|
[resolution_h] | Integer |
The window resolution height Default: same as game_h
|
[gui_w] | Integer |
The GUI width resolution, can be independent of the game res Default: Same as game_w
|
[gui_h] | Integer |
The GUI height resolution, can be independent of the game res Default: Same as game_h
|
[window_mode] | STANNCAM_WINDOW_MODE |
The window mode can be either STANNCAM_WINDOW_MODE.WINDOWED , STANNCAM_WINDOW_MODE.FULLSCREEN , STANNCAM_WINDOW_MODE.BORDERLESS Default: STANNCAM_WINDOW_MODE.WINDOWED
|
Example:
// GUI by default is identical to the game resolution
// So if that's what we want we can just not specify it
stanncam_init(320, 240, 1920, 1080);
It also sets these global variables which you can use throughout your game afterwards.
Global Var | Description |
---|---|
global.stanncams | Array containing all stanncam camerasDefault: -1 |
global.game_w | Game width |
global.game_h | Game height |
global.res_w | Display resolution width, ie the final window size |
global.res_h | Display resolution height, ie the final window size |
global.gui_w | GUI width |
global.gui_h | GUI height |
global.window_mode |
STANNCAM_WINDOW_MODE.WINDOWED , STANNCAM_WINDOW_MODE.FULLSCREEN , or STANNCAM_WINDOW_MODE.BORDERLESS
|
These methods control the global variables for STANNcam, and stuff such as resolution and setting whether the game should be fullscreened, borderless or windowed.
Changes the display resolution of the game. The game size will also scale to match the display resolution. This will keep everything looking pixel perfect!
Argument | Type | Description |
---|---|---|
resolution_w | Integer |
Display/window resolution width |
resolution_h | Integer |
Display/window resolution height |
Sets the game's display mode.
Argument | Type | Description |
---|---|---|
window_mode | STANNCAM_WINDOW_MODE |
Possible display modes:STANNCAM_WINDOW_MODE.WINDOWED , STANNCAM_WINDOW_MODE.FULLSCREEN , or STANNCAM_WINDOW_MODE.BORDERLESS
|
Sets the game to be displayed in a window.
Sets the game to be displayed at full screen.
Sets the game to be displayed in a borderless window.
It sets whether the game should maintain it's aspect ratio. It is on by default.
If your game res is 640x480(4:3), but your display resolution is 1920x1080(16:9), then the game will be stretched out to match.
So if you don't want that you can toggle it on, this will effectively overwrite the display resolution to 1440x1080(4:3)
Argument | Type | Description |
---|---|---|
on_off | Boolean |
either enables or disables it |
Returns whether or not keep_aspect_ratio
is enabled.
Returns: Boolean
If keep_aspect_ratio
is turned on, and the window is wider than the resolution.
Then the game wouldn't match the display resolutions, and so when drawing the game there would be a lot of black space on the right of the screen.
This methods returns half of that empty space, so the drawing can be offset and appear in the middle of the screen.
The stanncam.draw
method already uses this by default, so it's rarely needed.
Returns: Float
Changes the GUI resolution of the game. It also updates global.gui_w
and global.gui_h
.
Argument | Type | Description |
---|---|---|
gui_w | Integer |
Width of the GUI resolution |
gui_h | Integer |
Height of the GUI resolution |
How much bigger the GUI resolution is from the game resolution.
Returns: Float
How much bigger the Display resolution is from the game resolution.
Returns: Float
Toggles whether or not to pause the stanncam
camera.
Returns: Undefined
Sets whether or not to pause the stanncam
camera.
Argument | Type | Description |
---|---|---|
paused | Boolean |
Whether to pause or unpause all stanncam camera pause states |
Returns: Undefined
Pauses each stanncam
camera.
Returns: Undefined
Unpauses each stanncam
camera.
Returns: Undefined